Index: trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 43)
@@ -37,8 +37,7 @@
         /// <summary>
         /// パスを定数で定義する
         /// </summary>
-        public const string s_UPDATE_FILE_PATH = @"D:\Work\Test";
-        //public const string s_UPDATE_FILE_PATH = @"Z:\52GenbaKantokuHisyo";
+        public const string s_UPDATE_FILE_PATH = @"Z:\52GenbaKantokuHisyo";
         //public const string s_UPDATE_FILE_PATH = @"Z:\5-2現場監督秘書";
         //private const string s_UPDATE_FILE_PATH = @"Z:\⑤ＩＴ事業部用\Debug";
         public const string s_UPDATECOPY_NAME = "UpDateCopy.exe";
@@ -1563,6 +1562,10 @@
             /// 作成中
             /// </summary>
             Making = 1,
+            /// <summary>
+            /// 作成しない
+            /// </summary>
+            NoMakeData = 9,
         }
         #endregion
 
Index: trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeBaseInfoData.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeBaseInfoData.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeBaseInfoData.cs	(revision 43)
@@ -178,13 +178,13 @@
                     DB27.DeleteAction(strRemove, false);
                 }
 
-                // 結合工事リンク情報更新（1件目は削除済み）
+                // 結合工事リンク情報更新
                 if (ProcSuccess)
                 {
                     // 増減工事親確認
                     if (BaseRec.TyingFlg == (int)CommonDefine.BaseInfoTyingFlg.Parent)
                     {
-                        for (int i = 1; i < RemoveList.Count; i++)
+                        for (int i = 0; i < RemoveList.Count; i++)
                         {
                             if (!DB01.UpdateFeild(RemoveList[i]
                                                 , (int)IOConstructionBaseInfo.TableColumn.TyingFlg
@@ -199,7 +199,8 @@
                     // 結合工事親確認
                     if (BaseRec.JoinFlg == (int)CommonDefine.BaseInfoJoinFlg.JoinParent)
                     {
-                        for (int i = 1; i < UpdateLinkList.Count; i++)
+                        string strSQL = string.Empty;
+                        for (int i = 0; i < UpdateLinkList.Count; i++)
                         {
                             if (!DB01.UpdateFeild(UpdateLinkList[i]
                                                 , (int)IOConstructionBaseInfo.TableColumn.JoinFlg
@@ -209,6 +210,11 @@
                                 ProcSuccess = false;
                                 break;
                             }
+                            strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO A SET A.JOINFLG = {0}", (int)CommonDefine.BaseInfoJoinFlg.Standard);
+                            strSQL += " WHERE A.CONSTRUCTIONCODE IN (SELECT AA.FLUCTUATIONCODE FROM CONSTRUCTIONLINK AA";
+                            strSQL += string.Format(" WHERE AA.CONSTRUCTIONCODE = {0}",UpdateLinkList[i]);
+                            strSQL += string.Format(" AND AA.LINKTYPE = {0})", (int)CommonDefine.LinkDataType.FluctuationType);
+                            DB01.ExecuteNonQuery(strSQL, false);
                         }
                     }
                 }
Index: trunk/src/ProcessManagement/ProcessManagement/DataModel/SystemMaster.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DataModel/SystemMaster.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/DataModel/SystemMaster.cs	(revision 43)
@@ -26,6 +26,7 @@
         private double      m_OfficeExpenses = 0;	            // 事務所経費
         private double      m_OperatingExpenses = 0;	        // 営業経費
         private double      m_ConsumptionTax = 0;	            // 消費税
+
         private string      m_ExcelSavePath = string.Empty;	    // Excel保存パス
 
         private int         m_BusinessPeriod = 0;               // 営業期数
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs	(revision 43)
@@ -1440,17 +1440,20 @@
                 List<ConstructionLink> LinkList = new List<ConstructionLink>();
                 if (!LinkDB.SelectAction(strLinkSQL, ref LinkList, false)) return false;
 
+                string strSelSQL = "SELECT COUNT(*) FROM DAILYDATACONSTRUCTION WHERE CONSTRUCTIONCODE IN (";
                 string strDelSQL = string.Format("UPDATE DAILYDATACONSTRUCTION SET CONSTRUCTIONCODE = {0} WHERE CONSTRUCTIONCODE IN (", m_ConstructionCode);
                 // 検索キー追加
                 for (int i = 0; i < LinkList.Count; i++)
                 {
                     if (i != 0) strDelSQL += " ,";
+                    if (i != 0) strSelSQL += " ,";
                     strDelSQL += string.Format("{0}", LinkList[i].FluctuationCode);
+                    strSelSQL += string.Format("{0}", LinkList[i].FluctuationCode);
 
                 }
                 strDelSQL += ")";
+                strSelSQL += ")";
 
-                string strSelSQL = string.Format("SELECT COUNT(*) FROM DAILYDATACONSTRUCTION WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
                 int DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
@@ -1462,10 +1465,10 @@
                 }
 
                 strSelSQL = strSelSQL.Replace("DAILYDATACONSTRUCTION", "DAILYDATADETAIL");
-                DataCount = 0;
+                strDelSQL = strDelSQL.Replace("DAILYDATACONSTRUCTION", "DAILYDATADETAIL");
+                DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
-                    strDelSQL = strDelSQL.Replace("DAILYDATACONSTRUCTION", "DAILYDATADETAIL");
                     if (!DailyData2.ExecuteNonQuery(strDelSQL, false))
                     {
                         DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback();
@@ -1474,10 +1477,10 @@
                 }
 
                 strSelSQL = strSelSQL.Replace("DAILYDATADETAIL", "DAILYDATAVEHICLES");
-                DataCount = 0;
+                strDelSQL = strDelSQL.Replace("DAILYDATADETAIL", "DAILYDATAVEHICLES");
+                DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
-                    strDelSQL = strDelSQL.Replace("DAILYDATADETAIL", "DAILYDATAVEHICLES");
                     if (!DailyData3.ExecuteNonQuery(strDelSQL, false))
                     {
                         DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback();
@@ -1486,10 +1489,10 @@
                 }
 
                 strSelSQL = strSelSQL.Replace("DAILYDATAVEHICLES", "DAILYDATAMATERIALS");
-                DataCount = 0;
+                strDelSQL = strDelSQL.Replace("DAILYDATAVEHICLES", "DAILYDATAMATERIALS");
+                DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
-                    strDelSQL = strDelSQL.Replace("DAILYDATAVEHICLES", "DAILYDATAMATERIALS");
                     if (!DailyData4.ExecuteNonQuery(strDelSQL, false))
                     {
                         DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback();
@@ -1498,10 +1501,10 @@
                 }
 
                 strSelSQL = strSelSQL.Replace("DAILYDATAMATERIALS", "DAILYDATASUBCONTRACTORS");
-                DataCount = 0;
+                strDelSQL = strDelSQL.Replace("DAILYDATAMATERIALS", "DAILYDATASUBCONTRACTORS");
+                DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
-                    strDelSQL = strDelSQL.Replace("DAILYDATAMATERIALS", "DAILYDATASUBCONTRACTORS");
                     if (!DailyData5.ExecuteNonQuery(strDelSQL, false))
                     {
                         DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback();
@@ -1510,10 +1513,10 @@
                 }
 
                 strSelSQL = strSelSQL.Replace("DAILYDATASUBCONTRACTORS", "DAILYDATAFIELD");
-                DataCount = 0;
+                strDelSQL = strDelSQL.Replace("DAILYDATASUBCONTRACTORS", "DAILYDATAFIELD");
+                DataCount = GetDailyDataCount(DailyData1, strSelSQL);
                 if (DataCount > 0)
                 {
-                    strDelSQL = strDelSQL.Replace("DAILYDATASUBCONTRACTORS", "DAILYDATAFIELD");
                     if (!DailyData6.ExecuteNonQuery(strDelSQL, false))
                     {
                         DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback();
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs	(revision 43)
@@ -797,7 +797,6 @@
                         OrderNo = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.OrderNo].Value);
                     }
 
-
                     // データカウント取得
                     SelectCnt++;
                 }
@@ -804,12 +803,12 @@
                 
                 if (bNoCreateData && bMakeingData && bApprovalData)
                 {
-                    MessageBox.Show("注文書：作成・編集・閲覧は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("注文書：新規作成・編集・閲覧は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return false;
                 }
                 if (bNoCreateData && bMakeingData)
                 {
-                    MessageBox.Show("注文書：作成・編集は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("注文書：新規作成・編集は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return false;
                 }
                 if (bMakeingData && bApprovalData)
@@ -819,7 +818,7 @@
                 }
                 if (bNoCreateData && bApprovalData)
                 {
-                    MessageBox.Show("注文書：作成・閲覧は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    MessageBox.Show("注文書：新規作成・閲覧は同時にできません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return false;
                 }
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs	(revision 43)
@@ -455,10 +455,6 @@
         /// </summary>
         private List<KeyValuePair<int, int>> m_ChangeCompany = new List<KeyValuePair<int, int>>();
 
-        /// <summary>
-        /// 新規プロセスフラグ
-        /// </summary>
-        private bool m_bNewProcess = false;
         #endregion
 
         #region プロパティ
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs	(revision 42)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs	(revision 43)
@@ -126,46 +126,6 @@
         }
         #endregion
 
-        #region 旧作成データと新作成データの判別処理
-        /// <summary>
-        /// 旧作成データと新作成データの判別処理
-        /// </summary>
-        /// <returns></returns>
-        private bool DisplayTypeCheck()
-        {
-            IOConstructionLedgerDetail LDetailDB = new IOConstructionLedgerDetail();
-            try
-            {
-                int ConstrSearchCode = ClsProcessExist.GetParentConstrCode(m_ConstructionCode);
-                string strSQL = LDetailDB.CreatePrimarykeyString(ConstrSearchCode, (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                if (ConstrSearchCode != m_ConstructionCode) strSQL += string.Format(" AND SOURCECODE = {0}", m_ConstructionCode);
-                strSQL += " AND COMPANYCODE > 0";
-                ConstructionLedgerDetail LDetailRec = new ConstructionLedgerDetail();
-                if (!LDetailDB.SelectAction(strSQL, ref LDetailRec)) return false;
-                
-                if (LDetailRec.PurchaseOrderFlg < (int)CommonDefine.PurchaseOrderFlg.NoCreate)
-                {
-                    m_OrderNo = 1;
-                    m_bNewProcess = false;
-                    return true;
-                }
-
-                m_bNewProcess = true;
-
-                return true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-            finally
-            {
-                LDetailDB.close(); LDetailDB = null;
-            }
-        }
-        #endregion
-
         #region 注文書明細選択画面表示
         /// <summary>
         /// 注文書明細選択画面表示
@@ -212,7 +172,12 @@
                 // ヘッダー情報表示
                 DispHeader();
 
-                if (m_bNewProcess)
+                object[] objRec = (object[])m_DetailList[0];
+                if (CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.OrderNo]) < 0)
+                {   // 旧方式のデータ表示
+                    OldType_SetPurchaseOrderData();
+                }
+                else
                 {
                     // 注文書データを読み込む
                     if (m_CreateData)
@@ -228,10 +193,6 @@
                     // 承認データ受付番号セット
                     SetApprovalOrderNo();
                 }
-                else
-                {   // 旧方式のデータ表示
-                    OldType_SetPurchaseOrderData();
-                }
 
                 // 申請・承認表示処理
                 InitApprovalDisplay();
@@ -734,7 +695,7 @@
                         binit = false;
                         continue;
                     }
-                    // 会社コードが変わればでデータセットへ行く
+                    // 会社コードが変わればデータセットへ行く
                     if (Break_CompanyCode != DetailRec.CompanyCode)
                     {
                         // 協力業者発注合計が30万以上に注文書を発行する
Index: trunk/src/ProcessManagement/ProcessManagement.v12.suo
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
