Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs	(revision 334)
@@ -2741,8 +2741,8 @@
                 strSQL.AppendFormat(" AND DATE(CONCAT(A1.years, '/', A2.month, '/', A3.days)) <= DATE('{0}'))", dtLast.ToShortDateString());
                 strSQL.Append(" ORDER BY d) A");
                 strSQL.Append(", PERSONSALARYMASTER AS B");
-                strSQL.Append(" WHERE B.STARTDATE <= A.d");
-                strSQL.AppendFormat(" AND B.PERSONCODE = {0}", PersonCode);
+                strSQL.AppendFormat(" WHERE B.PERSONCODE = {0}", PersonCode);
+                strSQL.Append("       AND B.STARTDATE <= A.d");
                 strSQL.Append(" ORDER BY A.d, B.STARTDATE DESC) AS AX");
                 strSQL.Append(" GROUP BY AX.hiduke");
                 strSQL.Append(" ORDER BY AX.hiduke");
@@ -2749,7 +2749,7 @@
                 strSQL.Append(" ) AS SAL");
 
                 ArrayList ArData = new ArrayList();
-                SalDB.ExecuteReader(strSQL.ToString(), ref ArData);
+                if(!SalDB.ExecuteReader(strSQL.ToString(), ref ArData)) return 0;
 
                 foreach (object[] objRec in ArData)
                 {
@@ -2771,14 +2771,18 @@
         /// æœŸé–“ã‚ˆã‚Šé›¶ã‚Œã�ŸçµŒé�Žçµ¦ä¸Žã‚’å�–å¾—ã�™ã‚‹
         /// </summary>
         /// <returns></returns>
-        public static int CalcSpilledSalary(IOMPersonInCharge SalDB, int TargetYear, DateTime dtStart, DateTime dtLast, int PersonCode)
+        public static void CalcSpilledSalary(IOMPersonInCharge SalDB
+                                            , int TargetYear, DateTime dtStart, DateTime dtLast
+                                            , int PersonCode
+                                            , ref int NextDiffDay
+                                            , ref int PrevDiffDay)
         {
             try
             {
-                int RetSalary = 0;
 
+                DateTime dtDefaultEnd = CommonMotions.GetOpeningEndDate(TargetYear, false);
+
                 StringBuilder strSQL = new StringBuilder();
-
                 strSQL.Append("Select");
                 strSQL.Append(" Base.ConstructionCode");
                 strSQL.Append(", Ledger.ConstructionStart");
@@ -2786,9 +2790,6 @@
                 strSQL.Append(", LDetail.GroupCount");
                 strSQL.Append(", LDetail.SalaryFlg");
                 strSQL.Append(", LDetail.SalaryDays");
-                strSQL.Append(", Salary.SalaryPerson");
-                strSQL.Append(", Salary.DaySalary");
-                strSQL.Append(", (LDetail.SalaryDays * Salary.DaySalary) As SalVal");
                 strSQL.Append(" From");
                 strSQL.Append(" constructionbaseinfo As Base");
                 strSQL.Append(" Inner Join constructionledger As Ledger");
@@ -2798,32 +2799,83 @@
                 strSQL.AppendFormat(" And LDetail.GroupCount = {0}", (int)FrmConstructionLedger.DataGroup.Payroll);
                 strSQL.AppendFormat(" And LDetail.CompanyCode = {0}", PersonCode);
                 strSQL.AppendFormat(" And LDetail.SalaryFlg = {0}", (int)CommonDefine.SalaryDevision.DaysInput);
-                strSQL.Append(" Inner Join(");
+                strSQL.Append(" Where");
+                strSQL.AppendFormat(" Base.ConstructionPeriod = {0}", TargetYear);
+                strSQL.AppendFormat(" And Base.ConstructionPersonCode = {0}", PersonCode);
+                strSQL.Append(" And(");
+                strSQL.AppendFormat("DATE('{0}') <= DATE(Ledger.ConstructionStart)", dtLast.ToShortDateString());
+                strSQL.AppendFormat(" And DATE(Ledger.ConstructionEnd) <= DATE('{0}')", dtDefaultEnd.ToShortDateString());
+                strSQL.Append(")");
+
+                ArrayList ArData = new ArrayList();
+                if (!SalDB.ExecuteReader(strSQL.ToString(), ref ArData)) return;
+
+                // å�Šç«¯åˆ†ã�®æ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
+                NextDiffDay = ArData.Cast<object[]>().Sum(x => CommonMotions.cnvInt(x[5]));
+
+                // å…ˆæœŸã�®å�Šç«¯åˆ†ã�®æ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
+                PrevDiffDay = CalcSpilledPreviusDay(SalDB, TargetYear, dtStart, PersonCode);
+
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region å…ˆæœŸã�®çµ‚äº†å¾Œé›¶ã‚Œã�Ÿæ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
+        /// <summary>
+        /// å…ˆæœŸã�®çµ‚äº†å¾Œé›¶ã‚Œã�Ÿæ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
+        /// </summary>
+        /// <returns></returns>
+        private static int CalcSpilledPreviusDay(IOMPersonInCharge SalDB
+                                            , int TargetYear, DateTime dtStart, int PersonCode)
+        {
+            try
+            {
+                int RetDay = 0;
+
+                // å…ˆæœŸã�®æœŸæœ«ã‚’å�–å¾—ã�™ã‚‹
+                int PrevTargetYear = (TargetYear - 1);
+                if (PrevTargetYear < 1) return 0;
+                DateTime dtPrevEnd = CommonMotions.GetOpeningEndDate((TargetYear - 1), false);
+
+                // ä»ŠæœŸã�®æœ€åˆ�ã�Œå…ˆæœŸã�®æœ€å¾Œã‚ˆã‚Šå¤§ã��ã�„å ´å�ˆã�¯å‡¦ç�†ã�—ã�ªã�„
+                if (dtPrevEnd< dtStart) return 0;
+
+                StringBuilder strSQL = new StringBuilder();
                 strSQL.Append("Select");
-                strSQL.Append(" B.PersonCode As SalaryPerson");
-                strSQL.AppendFormat(", ROUND(B.MonthlySalary* {0} / 30) As DaySalary", CommonDefine.s_SalaryCorrection);
+                strSQL.Append(" Base.ConstructionCode");
+                strSQL.Append(", Ledger.ConstructionStart");
+                strSQL.Append(", Ledger.ConstructionEnd");
+                strSQL.Append(", LDetail.GroupCount");
+                strSQL.Append(", LDetail.SalaryFlg");
+                strSQL.Append(", LDetail.SalaryDays");
                 strSQL.Append(" From");
-                strSQL.Append(" PERSONSALARYMASTER As B");
+                strSQL.Append(" constructionbaseinfo As Base");
+                strSQL.Append(" Inner Join constructionledger As Ledger");
+                strSQL.Append("       On Ledger.ConstructionCode = Base.ConstructionCode");
+                strSQL.Append(" Inner Join constructionledgerdetail As LDetail");
+                strSQL.Append("       On LDetail.ConstructionCode = Base.ConstructionCode");
+                strSQL.AppendFormat(" And LDetail.GroupCount = {0}", (int)FrmConstructionLedger.DataGroup.Payroll);
+                strSQL.AppendFormat(" And LDetail.CompanyCode = {0}", PersonCode);
+                strSQL.AppendFormat(" And LDetail.SalaryFlg = {0}", (int)CommonDefine.SalaryDevision.DaysInput);
                 strSQL.Append(" Where");
-                strSQL.AppendFormat(" DATE(B.STARTDATE) <= DATE('{0}')", dtLast.ToShortDateString());
-                strSQL.AppendFormat(" AND B.PERSONCODE = {0}", PersonCode);
-                strSQL.Append(" Order By B.StartDate DESC limit 1");
-                strSQL.Append(") AS Salary");
-                strSQL.AppendFormat(" On Salary.SalaryPerson = {0}", PersonCode);
-                strSQL.Append(" Where");
-                strSQL.AppendFormat(" Base.ConstructionPeriod = {0}", TargetYear);
+                strSQL.AppendFormat(" Base.ConstructionPeriod = {0}", PrevTargetYear);
                 strSQL.AppendFormat(" And Base.ConstructionPersonCode = {0}", PersonCode);
                 strSQL.Append(" And(");
-                strSQL.AppendFormat("DATE('{0}') <= DATE(Ledger.ConstructionStart)", dtStart.ToShortDateString());
-                strSQL.AppendFormat(" And DATE(Ledger.ConstructionEnd) <= DATE('{0}')", dtLast.ToShortDateString());
+                strSQL.AppendFormat("DATE('{0}') <= DATE(Ledger.ConstructionStart)", (dtStart.AddDays(-1)).ToShortDateString());
+                strSQL.AppendFormat(" And DATE(Ledger.ConstructionEnd) <= DATE('{0}')", dtPrevEnd.ToShortDateString());
                 strSQL.Append(")");
 
                 ArrayList ArData = new ArrayList();
-                SalDB.ExecuteReader(strSQL.ToString(), ref ArData);
+                if (!SalDB.ExecuteReader(strSQL.ToString(), ref ArData)) return 0;
 
-                RetSalary = ArData.Cast<object[]>().Sum(x => CommonMotions.cnvInt(x[8]));
+                // å�Šç«¯åˆ†ã�®æ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
+                RetDay = ArData.Cast<object[]>().Sum(x => CommonMotions.cnvInt(x[5]));
 
-                return RetSalary;
+                return RetDay;
             }
             catch (Exception ex)
             {
@@ -2830,7 +2882,6 @@
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
                 return 0;
             }
-
         }
         #endregion
 
@@ -2997,7 +3048,9 @@
                 {   // ä»ŠæœŸã�¯å‰Šé™¤ã�•ã‚Œã�¦ã�„ã�ªã�„ã‚‚ã�®
                     //strSQL.Append(" A.DELETEFLG = 0");
                     DateTime dtDefaultEnd = CommonMotions.GetOpeningEndDate(nTargetCount, false);
-                    strSQL.AppendFormat(" DATE(A.StartDate) <= DATE('{0}')", dtDefaultEnd.ToShortDateString());
+
+                    strSQL.AppendFormat(" C.ConstructionPeriod = {0}", nTargetCount);
+                    strSQL.AppendFormat(" And DATE(A.StartDate) <= DATE('{0}')", dtDefaultEnd.ToShortDateString());
                     // ã‚·ã‚¹ãƒ†ãƒ ç®¡ç�†è€…ä»¥å¤–ã�¯éƒ¨ç½²å�‚ç…§ãƒžã‚¹ã‚¿ã‚ˆã‚Šãƒ‡ãƒ¼ã‚¿å�–å¾—
                     if (CommonMotions.LoginUserData.PersonCode != CommonDefine.AdminCode)
                     {
Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 334)
@@ -14,7 +14,7 @@
         /// <summary>
         /// æœ¬ä½“ãƒ�ãƒ¼ã‚¸ãƒ§ãƒ³
         /// </summary>
-        public static int s_SystemVersion = 163;
+        public static int s_SystemVersion = 167;
 
         /// <summary>
         /// ã‚³ãƒ”ãƒ¼ãƒ»ç’°å¢ƒãƒ�ãƒ¼ã‚¸ãƒ§ãƒ³
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOActionScheduleData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOActionScheduleData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOActionScheduleData.cs	(revision 334)
@@ -148,7 +148,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                     
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceDailyData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceDailyData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceDailyData.cs	(revision 334)
@@ -282,7 +282,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceData.cs	(revision 334)
@@ -265,7 +265,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs	(revision 334)
@@ -456,7 +456,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfoDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfoDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfoDetail.cs	(revision 334)
@@ -234,7 +234,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs	(revision 334)
@@ -341,7 +341,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudgetDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudgetDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudgetDetail.cs	(revision 334)
@@ -286,7 +286,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs	(revision 334)
@@ -315,7 +315,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs	(revision 334)
@@ -326,7 +326,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs	(revision 334)
@@ -271,7 +271,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLink.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLink.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLink.cs	(revision 334)
@@ -202,11 +202,6 @@
         /// </summary>
         /// <param name="data">å·¥äº‹å¢—æ¸›æƒ…å ±ãƒ‡ãƒ¼ã‚¿</param>
         /// <returns>trueï¼šæˆ�åŠŸ falseï¼šå¤±æ•—</returns>
-        /// <summary>
-        /// å·¥äº‹å¢—æ¸›æƒ…å ±è¿½åŠ 
-        /// </summary>
-        /// <param name="data">å·¥äº‹å¢—æ¸›æƒ…å ±ãƒ‡ãƒ¼ã‚¿</param>
-        /// <returns>trueï¼šæˆ�åŠŸ falseï¼šå¤±æ•—</returns>
         public bool InsertAction(List<ConstructionLink> data, bool bConnect = true)
         {
             StringBuilder strcmd = new StringBuilder();
@@ -240,7 +235,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false; return true;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false; return true;
             }
             catch (Exception ex)
             {
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionProgressDate.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionProgressDate.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionProgressDate.cs	(revision 334)
@@ -160,7 +160,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false; 
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false; 
                 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostDataOfPerson.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostDataOfPerson.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostDataOfPerson.cs	(revision 334)
@@ -273,7 +273,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostomerRegist.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostomerRegist.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostomerRegist.cs	(revision 334)
@@ -337,7 +337,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataConstruction.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataConstruction.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataConstruction.cs	(revision 334)
@@ -241,7 +241,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataDetail.cs	(revision 334)
@@ -290,7 +290,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataField.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataField.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataField.cs	(revision 334)
@@ -262,7 +262,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataMaterials.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataMaterials.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataMaterials.cs	(revision 334)
@@ -278,7 +278,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataSubcontractors.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataSubcontractors.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataSubcontractors.cs	(revision 334)
@@ -259,7 +259,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataVehicles.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataVehicles.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataVehicles.cs	(revision 334)
@@ -289,7 +289,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudget.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudget.cs	(revision 334)
@@ -262,7 +262,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudgetDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudgetDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateBudgetDetail.cs	(revision 334)
@@ -266,7 +266,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateData.cs	(revision 334)
@@ -248,7 +248,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataBody.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataBody.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataBody.cs	(revision 334)
@@ -251,7 +251,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOEstimateDataDetail.cs	(revision 334)
@@ -288,7 +288,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
              
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOInputSearchLogData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOInputSearchLogData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOInputSearchLogData.cs	(revision 334)
@@ -188,7 +188,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMApproval.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMApproval.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMApproval.cs	(revision 334)
@@ -148,7 +148,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBizPeriodHistory.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBizPeriodHistory.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBizPeriodHistory.cs	(revision 334)
@@ -245,7 +245,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
              
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBusinessType.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBusinessType.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMBusinessType.cs	(revision 334)
@@ -138,7 +138,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLarge.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLarge.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLarge.cs	(revision 334)
@@ -201,7 +201,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLinkMS.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLinkMS.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostLinkMS.cs	(revision 334)
@@ -242,7 +242,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddle.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddle.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddle.cs	(revision 334)
@@ -206,7 +206,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddleSearchWord.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddleSearchWord.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCommonCostMiddleSearchWord.cs	(revision 334)
@@ -244,7 +244,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponent.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponent.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponent.cs	(revision 334)
@@ -256,7 +256,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponentLink.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponentLink.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMComponentLink.cs	(revision 334)
@@ -240,7 +240,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionItem.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionItem.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionItem.cs	(revision 334)
@@ -252,7 +252,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpec.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpec.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpec.cs	(revision 334)
@@ -258,7 +258,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpecUnitPrice.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpecUnitPrice.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionSpecUnitPrice.cs	(revision 334)
@@ -242,7 +242,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false; 
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false; 
                 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionTypeMaster.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionTypeMaster.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMConstructionTypeMaster.cs	(revision 334)
@@ -260,7 +260,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartment.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartment.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartment.cs	(revision 334)
@@ -210,7 +210,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartmentExpenses.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartmentExpenses.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartmentExpenses.cs	(revision 334)
@@ -277,7 +277,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDivision.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDivision.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDivision.cs	(revision 334)
@@ -204,7 +204,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMHolidayCalender.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMHolidayCalender.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMHolidayCalender.cs	(revision 334)
@@ -184,7 +184,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMOrderers.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMOrderers.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMOrderers.cs	(revision 334)
@@ -240,7 +240,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonDepartment.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonDepartment.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonDepartment.cs	(revision 334)
@@ -239,7 +239,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonSalary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonSalary.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonSalary.cs	(revision 334)
@@ -246,7 +246,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMProcessExcute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMProcessExcute.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMProcessExcute.cs	(revision 334)
@@ -241,7 +241,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSecurity.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSecurity.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSecurity.cs	(revision 334)
@@ -254,7 +254,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractor.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractor.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractor.cs	(revision 334)
@@ -313,7 +313,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorItem.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorItem.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorItem.cs	(revision 334)
@@ -203,7 +203,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobCategory.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobCategory.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobCategory.cs	(revision 334)
@@ -246,7 +246,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobItem.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobItem.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobItem.cs	(revision 334)
@@ -199,7 +199,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobLink.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobLink.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobLink.cs	(revision 334)
@@ -197,7 +197,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSuppliers.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSuppliers.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSuppliers.cs	(revision 334)
@@ -278,7 +278,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSystem.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSystem.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSystem.cs	(revision 334)
@@ -342,7 +342,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
              
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTerm.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTerm.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTerm.cs	(revision 334)
@@ -210,7 +210,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTypeExpenses.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTypeExpenses.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMTypeExpenses.cs	(revision 334)
@@ -251,7 +251,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMUnit.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMUnit.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMUnit.cs	(revision 334)
@@ -137,7 +137,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicle.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicle.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicle.cs	(revision 334)
@@ -192,7 +192,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicleRecordData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicleRecordData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMVehicleRecordData.cs	(revision 334)
@@ -153,7 +153,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardData.cs	(revision 334)
@@ -289,7 +289,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardDataTerget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardDataTerget.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardDataTerget.cs	(revision 334)
@@ -246,7 +246,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBrowsingHistory.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBrowsingHistory.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBrowsingHistory.cs	(revision 334)
@@ -235,7 +235,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOOrdersPriceData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOOrdersPriceData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOOrdersPriceData.cs	(revision 334)
@@ -255,7 +255,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPeriodAvoidance.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPeriodAvoidance.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPeriodAvoidance.cs	(revision 334)
@@ -182,7 +182,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
                 return true;
             }
             catch (Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApproval.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApproval.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApproval.cs	(revision 334)
@@ -215,7 +215,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalCommnet.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalCommnet.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalCommnet.cs	(revision 334)
@@ -208,7 +208,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalDetail.cs	(revision 334)
@@ -213,7 +213,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsData.cs	(revision 334)
@@ -264,7 +264,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataAttend.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataAttend.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataAttend.cs	(revision 334)
@@ -262,7 +262,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataDetail.cs	(revision 334)
@@ -265,7 +265,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApproval.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApproval.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApproval.cs	(revision 334)
@@ -215,7 +215,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalCommnet.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalCommnet.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalCommnet.cs	(revision 334)
@@ -205,7 +205,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProcessApprovalDetail.cs	(revision 334)
@@ -202,7 +202,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrder.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrder.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrder.cs	(revision 334)
@@ -351,7 +351,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDate.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDate.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDate.cs	(revision 334)
@@ -258,7 +258,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs	(revision 334)
@@ -290,7 +290,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORequestOrderDate.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORequestOrderDate.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORequestOrderDate.cs	(revision 334)
@@ -240,7 +240,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPData.cs	(revision 334)
@@ -211,7 +211,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPDataDetail.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSFPDataDetail.cs	(revision 334)
@@ -197,7 +197,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSalesGraphData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSalesGraphData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSalesGraphData.cs	(revision 334)
@@ -195,7 +195,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobItemRegist.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobItemRegist.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobItemRegist.cs	(revision 334)
@@ -251,7 +251,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobLinkRegist.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobLinkRegist.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrJobLinkRegist.cs	(revision 334)
@@ -249,7 +249,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrRegist.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrRegist.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSubConstrRegist.cs	(revision 334)
@@ -337,7 +337,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs	(revision 334)
@@ -203,7 +203,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOTranceportDailyData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOTranceportDailyData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOTranceportDailyData.cs	(revision 334)
@@ -286,7 +286,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOVehicleScheduleData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOVehicleScheduleData.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOVehicleScheduleData.cs	(revision 334)
@@ -151,7 +151,7 @@
                     bDataFirst = false;
                 }
 
-                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
+                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
                 return true;
             }
Index: branches/src/ProcessManagement/ProcessManagement/DataModel/DepartmentMaster.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DataModel/DepartmentMaster.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/DataModel/DepartmentMaster.cs	(revision 334)
@@ -17,7 +17,7 @@
         private int         m_ActionScheduleFlg = 0;	        // è¡Œå‹•äºˆå®šè¡¨ç¤ºãƒ•ãƒ©ã‚°
         private int         m_StaffAssignFlg = 0;               // äººå“¡é…�ç½®è¡¨ç¤ºãƒ•ãƒ©ã‚°
         private DateTime    m_StartDate = DateTime.Now;         // é–‹å§‹æ—¥ä»˜
-        private DateTime    m_CompDate = DateTime.MinValue;     // çµ‚äº†æ—¥ä»˜
+        private DateTime    m_CompDate = DateTime.MinValue;     // çµ‚äº†æ—¥ä»˜
         private int         m_DeleteFlg = 0;	                // å‰Šé™¤ãƒ•ãƒ©ã‚°
         private DateTime    m_EntryDate = DateTime.Now;         // ç™»éŒ²æ—¥ä»˜
         private DateTime    m_UpdateDate = DateTime.Now;        // æ›´æ–°æ—¥ä»˜
@@ -90,7 +90,7 @@
         {
             get { return m_CompDate; }
             set { m_CompDate = value; }
-        }
+        }
         /// <summary>
         /// ç™»éŒ²æ—¥ä»˜
         /// </summary>
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalList/FrmApprovalList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalList/FrmApprovalList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalList/FrmApprovalList.cs	(revision 334)
@@ -284,13 +284,13 @@
         {
             if (m_bInitFlg) return;
 
-
             // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
-
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
         }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.cs	(revision 334)
@@ -319,6 +319,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 334)
@@ -3447,12 +3447,6 @@
                 // ƒf�[ƒ^“o˜^
                 if (!DataAllEntryProcess(MsgOn)) return false;
 
-                // ˆÚŠÇ‚ª”­�¶‚µ‚Ä‚¢‚½�ê�‡
-                if (m_TransferMesageFlg) MessageBoardEntry();
-
-                // ˆøŒp’S“–ŽÒ�Ý’è‚ª”­�¶‚µ‚Ä‚¢‚½�ê�‡
-                if (m_Transfer2MesageFlg) MessageBoardEntry2();
-
                 m_bChengeAns = false;
 
                 // •Ï�Xƒtƒ‰ƒO‚ðON
@@ -3500,6 +3494,9 @@
             IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail();    // �HŽ–�Ú�×‘ä’ –¾�×ƒf�[ƒ^
             IOConstructionLedgerExcute LedgerEDB = new IOConstructionLedgerExcute();    // �HŽ–�Ú�×‘ä’ Žx•¥‚¢ƒf�[ƒ^
 
+            IOMessageBoardData mbdDB = new IOMessageBoardData();                        // ŒfŽ¦”Âƒf�[ƒ^
+            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();                    // ŒfŽ¦‘Î�ÛŽÒƒe�[ƒuƒ‹
+
             FrmConstructionLedger frm = new FrmConstructionLedger();                    // �HŽ–�Ú�×‘ä’ “ü—Í
             try
             {
@@ -3542,21 +3539,12 @@
                     TyingDataFlag = true;
 
                 // ˆêŠ‡�ˆ—�‚È‚Ì‚Å�Ú‘±‚ð�s‚¤
-                cbiDB.connect(); cbiDB.beginTran();
-                cbidDB.connect(); cbidDB.beginTran();
-                cpdDB.connect(); cpdDB.beginTran();
-                cbLinkDB.connect(); cbLinkDB.beginTran();
+                DBBeginTran(cbiDB, cbidDB, cpdDB, cbLinkDB,
+                            ApprovalDB, PersonDB,
+                            BudgetDB, BudgetDDB,
+                            LedgerDB, LedgerDDB, LedgerEDB,
+                            mbdDB, mbtDB);
 
-                ApprovalDB.connect(); ApprovalDB.beginTran();
-                PersonDB.connect(); PersonDB.beginTran();
-
-                BudgetDB.connect(); BudgetDB.beginTran();
-                BudgetDDB.connect(); BudgetDDB.beginTran();
-
-                LedgerDB.connect(); LedgerDB.beginTran();
-                LedgerDDB.connect(); LedgerDDB.beginTran();
-                LedgerEDB.connect(); LedgerEDB.beginTran();
-
                 // ƒf�[ƒ^“o˜^
                 if (!ConstructionBaseInfoDataEntry(cbiDB, cpdDB))
                 {
@@ -3565,7 +3553,8 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
@@ -3576,7 +3565,8 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
@@ -3591,7 +3581,8 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
@@ -3608,7 +3599,8 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
@@ -3623,7 +3615,8 @@
                                             cbiDB, cbidDB, cpdDB, cbLinkDB,
                                             ApprovalDB, PersonDB,
                                             BudgetDB, BudgetDDB,
-                                            LedgerDB, LedgerDDB, LedgerEDB);
+                                            LedgerDB, LedgerDDB, LedgerEDB,
+                                            mbdDB, mbtDB);
 
                         return false;
                     }
@@ -3638,7 +3631,8 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
@@ -3651,17 +3645,51 @@
                                         cbiDB, cbidDB, cpdDB, cbLinkDB,
                                         ApprovalDB, PersonDB,
                                         BudgetDB, BudgetDDB,
-                                        LedgerDB, LedgerDDB, LedgerEDB);
+                                        LedgerDB, LedgerDDB, LedgerEDB,
+                                        mbdDB, mbtDB);
 
                     return false;
                 }
 
+                // ˆÚŠÇ‚ª”­�¶‚µ‚Ä‚¢‚½�ê�‡
+                if (m_TransferMesageFlg)
+                {
+                    if (!MessageBoardEntry(mbdDB, mbtDB))
+                    {
+                        MessageBox.Show("•”��ˆÚŠÇ�F�X�VƒGƒ‰�[‚Å‚·�B", "�X�VƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                        RollBackCommitProc(true,
+                                            cbiDB, cbidDB, cpdDB, cbLinkDB,
+                                            ApprovalDB, PersonDB,
+                                            BudgetDB, BudgetDDB,
+                                            LedgerDB, LedgerDDB, LedgerEDB,
+                                            mbdDB, mbtDB);
+                        return false;
+                    }
+                }
+
+                // ˆøŒp’S“–ŽÒ�Ý’è‚ª”­�¶‚µ‚Ä‚¢‚½�ê�‡
+                if (m_Transfer2MesageFlg)
+                {
+                    if (!MessageBoardEntry2(mbdDB, mbtDB))
+                    {
+                        MessageBox.Show("’S“–ŽÒˆøŒp�F�X�VƒGƒ‰�[‚Å‚·�B", "�X�VƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                        RollBackCommitProc(true,
+                                            cbiDB, cbidDB, cpdDB, cbLinkDB,
+                                            ApprovalDB, PersonDB,
+                                            BudgetDB, BudgetDDB,
+                                            LedgerDB, LedgerDDB, LedgerEDB,
+                                            mbdDB, mbtDB);
+                        return false;
+                    }
+                }
+
                 // DBCommit
                 RollBackCommitProc(false,
                                     cbiDB, cbidDB, cpdDB, cbLinkDB,
                                     ApprovalDB, PersonDB,
                                     BudgetDB, BudgetDDB,
-                                    LedgerDB, LedgerDDB, LedgerEDB);
+                                    LedgerDB, LedgerDDB, LedgerEDB,
+                                    mbdDB, mbtDB);
 
                 // �HŽ–ƒR�[ƒh‚ÌƒZƒbƒg
                 frm.ConstructionCode = ProcConstrCode;
@@ -3702,11 +3730,59 @@
                 LedgerDDB.close(); LedgerDDB = null;
                 LedgerEDB.close(); LedgerEDB = null;
 
+                mbdDB.close(); mbdDB = null;
+                mbtDB.close(); mbtDB = null;
+
                 frm.Dispose(); frm = null;
             }
         }
         #endregion
 
+        #region ˆêŠ‡ƒgƒ‰ƒ“ƒUƒNƒVƒ‡ƒ“�ˆ—�
+        /// <summary>
+        /// ˆêŠ‡ƒgƒ‰ƒ“ƒUƒNƒVƒ‡ƒ“�ˆ—�
+        /// </summary>
+        private void DBBeginTran(IOConstructionBaseInfo cbiDB,           // �HŽ–Šî–{�î•ñ
+                                IOConstructionBaseInfoDetail cbidDB,    // �HŽ–Šî–{�î•ñ–¾�×
+                                IOConstructionProgressDate cpdDB,       // ˆÄŒ��i’»“ú•tƒf�[ƒ^
+                                IOConstructionLink cbLinkDB,            // �HŽ–‘�Œ¸�î•ñ
+                                IOProcessApproval ApprovalDB,           // �³”Fƒf�[ƒ^
+                                IOMPersonInCharge PersonDB,             // ’S“–ŽÒƒ}ƒXƒ^
+                                IOConstructionBudget BudgetDB,          // �HŽ–—\ŽZ�‘ƒf�[ƒ^
+                                IOConstructionBudgetDetail BudgetDDB,   // �HŽ–—\ŽZ�‘–¾�×ƒf�[ƒ^
+                                IOConstructionLedger LedgerDB,          // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^
+                                IOConstructionLedgerDetail LedgerDDB,   // �HŽ–�Ú�×‘ä’ –¾�×ƒf�[ƒ^
+                                IOConstructionLedgerExcute LedgerEDB,   // �HŽ–�Ú�×‘ä’ Žx•¥‚¢ƒf�[ƒ^
+                                IOMessageBoardData mbdDB,               // ŒfŽ¦”Âƒf�[ƒ^
+                                IOMessageBoardTerget mbtDB)             // ŒfŽ¦‘Î�ÛŽÒƒe�[ƒuƒ‹
+        {
+            try
+            {
+                cbiDB.connect(); cbiDB.beginTran();
+                cbidDB.connect(); cbidDB.beginTran();
+                cpdDB.connect(); cpdDB.beginTran();
+                cbLinkDB.connect(); cbLinkDB.beginTran();
+
+                ApprovalDB.connect(); ApprovalDB.beginTran();
+                PersonDB.connect(); PersonDB.beginTran();
+
+                BudgetDB.connect(); BudgetDB.beginTran();
+                BudgetDDB.connect(); BudgetDDB.beginTran();
+
+                LedgerDB.connect(); LedgerDB.beginTran();
+                LedgerDDB.connect(); LedgerDDB.beginTran();
+                LedgerEDB.connect(); LedgerEDB.beginTran();
+
+                mbdDB.connect(); mbdDB.beginTran();
+                mbtDB.connect(); mbtDB.beginTran();
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region “o˜^ŽžˆêŠ‡RollBack�ECommit�ˆ—�
         /// <summary>
         /// “o˜^ŽžˆêŠ‡RollBack�ECommit�ˆ—�
@@ -3722,7 +3798,9 @@
                                         IOConstructionBudgetDetail BudgetDDB,   // �HŽ–—\ŽZ�‘–¾�×ƒf�[ƒ^
                                         IOConstructionLedger LedgerDB,          // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^
                                         IOConstructionLedgerDetail LedgerDDB,   // �HŽ–�Ú�×‘ä’ –¾�×ƒf�[ƒ^
-                                        IOConstructionLedgerExcute LedgerEDB    // �HŽ–�Ú�×‘ä’ Žx•¥‚¢ƒf�[ƒ^
+                                        IOConstructionLedgerExcute LedgerEDB,   // �HŽ–�Ú�×‘ä’ Žx•¥‚¢ƒf�[ƒ^
+                                        IOMessageBoardData mbdDB,               // ŒfŽ¦”Âƒf�[ƒ^
+                                        IOMessageBoardTerget mbtDB              // ŒfŽ¦‘Î�ÛŽÒƒe�[ƒuƒ‹
                                         )
         {
             try
@@ -3740,6 +3818,8 @@
                     LedgerDB.rollback();
                     LedgerDDB.rollback();
                     LedgerEDB.rollback();
+                    mbdDB.rollback();
+                    mbtDB.rollback();
                 }
 
                 // DB“o˜^
@@ -3754,6 +3834,8 @@
                 LedgerDB.commit();
                 LedgerDDB.commit();
                 LedgerEDB.commit();
+                mbdDB.commit();
+                mbtDB.commit();
             }
             catch (System.Exception ex)
             {
@@ -3828,32 +3910,24 @@
         /// •”��ˆøŒpŒfŽ¦”Âƒf�[ƒ^“o˜^
         /// </summary>
         /// <returns></returns>
-        private bool MessageBoardEntry()
+        private bool MessageBoardEntry(IOMessageBoardData mbdDB, IOMessageBoardTerget mbtDB)
         {
-            IOMessageBoardData mbdDB = new IOMessageBoardData();
-            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
             try
             {
                 // ‘I‘ð–³‚Í�ˆ—�‚µ‚È‚¢
                 if (cmbTransferConstruction.Text.Length == 0) return true;
 
-                mbdDB.connect();
-                mbdDB.beginTran();
-
-                mbtDB.connect();
-                mbtDB.beginTran();
-
                 List<MessageBoardData> list = new List<MessageBoardData>();
                 MessageBoardData data = new MessageBoardData();
 
                 // ƒL�[ƒR�[ƒhƒZƒbƒg
-                data.RecordNumber = mbtDB.SelectMaxMessageBoardTergetKeyCount("", false) + 1;
+                data.RecordNumber = mbdDB.SelectMaxMessageBoardDataKeyCount("", false) + 1;
                 data.BranchNumber = 0;
                 string strWhere = mbdDB.CreatePrimarykeyString(data.RecordNumber, data.BranchNumber);
 
                 // ƒf�[ƒ^ƒZƒbƒg
-                int transferCode = CommonMotions.cnvInt(cmbTransferConstruction.SelectedValue.ToString());
-                KeyValuePair<int, string> wkselect = (KeyValuePair<int, string>)cmbTransferConstruction.SelectedItem;
+                int transferCode = CommonMotions.cnvInt(cmbTransferConstruction.SelectedValue);
+                string wkselect = cmbTransferConstruction.Text;
 
                 string titleofhonor = "";
                 if (transferCode > 99999)
@@ -3860,13 +3934,13 @@
                     titleofhonor = "“a";
 
                 // ‘—�MŽÒƒZƒbƒg
-                data.FromCode = CommonMotions.cnvInt(((ComboBox)m_DspCtrl[(int)DspCnt.SalesPersonCode]).SelectedValue);
-                data.FromName = ((ComboBox)m_DspCtrl[(int)DspCnt.SalesPersonCode]).Text;
+                data.FromCode = CommonMotions.cnvInt(cmbDisplayPerson.SelectedValue);
+                data.FromName = cmbDisplayPerson.Text;
 
                 data.MessageTitle = "�HŽ–ˆÄŒ�ˆøŒp‚ÌŒ�";
-                data.MessageContent = string.Format("�HŽ–”Ô�†�F{0}\r\n",m_DspCtrl[(int)DspCnt.ConstructionCode].Text);
+                data.MessageContent = string.Format("�HŽ–”Ô�†�F{0}\r\n", m_DspCtrl[(int)DspCnt.ConstructionCode].Text);
                 data.MessageContent += string.Format("�HŽ––¼�Ì�F{0}‚ð\r\n", m_DspCtrl[(int)DspCnt.ConstructionName].Text);
-                data.MessageContent += string.Format("{0}{1}‚ÖˆøŒp‚Ü‚·�B\r\n", wkselect.Value, titleofhonor);
+                data.MessageContent += string.Format("{0}{1}‚ÖˆøŒp‚Ü‚·�B\r\n", wkselect, titleofhonor);
                 data.MessageContent += "‚È‚¨�HŽ–“à—eˆøŒp‚Ì‚½‚ß�A�Š‘®’·‚Æ’S“–ŽÒ‚Í‰c‹Æ’S“–‚ÆŽŠ‹}‘Å‚¿�‡‚í‚¹‚Ä‰º‚³‚¢�iŒ´‘¥3“úˆÈ“à�j\r\n";
                 data.MessageContent += "‚æ‚ë‚µ‚­‚¨Šè‚¢‚µ‚Ü‚·�B";
 
@@ -3889,13 +3963,7 @@
 
                 list.Add(data);
                 // ƒf�[ƒ^“o˜^
-                if (!mbdDB.InsertAction(list, false))
-                {
-                    MessageBox.Show("“o˜^‚ÉŽ¸”s‚µ‚Ü‚µ‚½�B", "“o˜^ƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    mbdDB.rollback();
-                    mbtDB.rollback();
-                    return false;
-                }
+                if (!mbdDB.InsertAction(list, false)) return false;                
 
                 string strMBT = mbtDB.CreatePrimarykeyString(data.RecordNumber, data.BranchNumber);
                 mbtDB.DeleteAction(strMBT, false);
@@ -3910,21 +3978,13 @@
                 wrkTer.BranchNumber = data.BranchNumber;
                 wrkTer.SeqNum = ++icnt;
                 wrkTer.ToCode = transferCode;
-                wrkTer.ToName = wkselect.Value;
+                wrkTer.ToName = wkselect;
 
                 terList.Add(wrkTer);
 
                 // ƒf�[ƒ^“o˜^
-                if (!mbtDB.InsertAction(terList, false))
-                {
-                    mbdDB.rollback();
-                    mbtDB.rollback();
-                    return false;
-                }
+                if (!mbtDB.InsertAction(terList, false)) return false;
 
-                mbdDB.commit();
-                mbtDB.commit();
-
                 return true;
             }
             catch (Exception ex)
@@ -3932,11 +3992,6 @@
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
                 return false;
             }
-            finally
-            {
-                mbdDB.close(); mbdDB = null;
-                mbtDB.close(); mbtDB = null;
-            }
         }
         #endregion
 
@@ -3945,12 +4000,9 @@
         /// ˆøŒp’S“–ŽÒŠ„“–ŒfŽ¦”Âƒf�[ƒ^“o˜^
         /// </summary>
         /// <returns></returns>
-        private bool MessageBoardEntry2()
+        private bool MessageBoardEntry2(IOMessageBoardData mbdDB
+                                        , IOMessageBoardTerget mbtDB)
         {
-            IOMessageBoardData mbdDB = new IOMessageBoardData();
-            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
-            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
-
             // ƒf�[ƒ^ƒZƒbƒgŽž‚ÉˆøŒp’†ˆÈŠO‚Í�ˆ—�‚µ‚È‚¢
             if (rdbStatusHikitugiFlg.Checked) return true;
             try
@@ -3962,22 +4014,22 @@
                 MessageBoardData data = new MessageBoardData();
 
                 // ƒL�[ƒR�[ƒhƒZƒbƒg
-                data.RecordNumber = mbtDB.SelectMaxMessageBoardTergetKeyCount("") + 1;
+                data.RecordNumber = mbdDB.SelectMaxMessageBoardDataKeyCount("", false) + 1;
                 data.BranchNumber = 0;
                 string strWhere = mbdDB.CreatePrimarykeyString(data.RecordNumber, data.BranchNumber);
 
                 string titleofhonor = "“a";
                 // �HŽ–’S“–ŽÒƒZƒbƒg
-                int transferCode = CommonMotions.cnvInt(cmbDisplayConstructionPerson.SelectedValue.ToString());
-                KeyValuePair<int, string> wkselect = (KeyValuePair<int, string>)cmbDisplayConstructionPerson.SelectedItem;
+                int transferCode = CommonMotions.cnvInt(cmbDisplayConstructionPerson.SelectedValue);
+                string wkselect = cmbDisplayConstructionPerson.Text;
 
                 // �HŽ–Žw“±ˆõƒZƒbƒg
-                int InstractorCode = CommonMotions.cnvInt(cmbConstructionInstructor.SelectedValue.ToString());
+                int InstractorCode = CommonMotions.cnvInt(cmbConstructionInstructor.SelectedValue);
                 string InstractorName = "";
-                KeyValuePair<int, string> wkInst = (KeyValuePair<int, string>)cmbConstructionInstructor.SelectedItem;
+                string wkInst = cmbConstructionInstructor.Text;
                 if (InstractorCode > 0)
                 {
-                    InstractorName = "\r\n" + wkInst.Value + titleofhonor + "‚ð�HŽ–Žw“±ˆõ‚Æ";
+                    InstractorName = "\r\n" + wkInst + titleofhonor + "‚ð�HŽ–Žw“±ˆõ‚Æ";
                 }
                 // ‘—�MŽÒƒZƒbƒg
                 data.FromCode = CommonMotions.LoginUserData.PersonCode;
@@ -3986,7 +4038,7 @@
                 data.MessageTitle = string.Format("{0}‚Ì�HŽ–’S“–ŽÒ‚É‚Â‚¢‚Ä", m_DspCtrl[(int)DspCnt.ConstructionName].Text);
                 data.MessageContent = string.Format("�HŽ–”Ô�†�F{0}\r\n", m_DspCtrl[(int)DspCnt.ConstructionCode].Text);
                 data.MessageContent += string.Format("�HŽ––¼�Ì�F{0}‚ð\r\n", m_DspCtrl[(int)DspCnt.ConstructionName].Text);
-                data.MessageContent += string.Format("{0}{1}‚ð�HŽ–’S“–ŽÒ‚É{2}‚µ‚Ü‚·�B\r\n", wkselect.Value, titleofhonor, InstractorName);
+                data.MessageContent += string.Format("{0}{1}‚ð�HŽ–’S“–ŽÒ‚É{2}‚µ‚Ü‚·�B\r\n", wkselect, titleofhonor, InstractorName);
                 data.MessageContent += "‚È‚¨�HŽ–“à—eˆøŒp‚Ì‚½‚ß�A�Š‘®’·‚Æ’S“–ŽÒ‚Í‰c‹Æ’S“–‚ÆŽŠ‹}‘Å‚¿�‡‚í‚¹‚Ä‰º‚³‚¢�iŒ´‘¥3“úˆÈ“à�j\r\n";
                 data.MessageContent += "‘Å‚¿�‡‚í‚¹Œã�A‘¬‚â‚©‚ÉŽ{�H�€”õ‚ÉŠ|‚©‚Á‚Ä‰º‚³‚¢�B\r\n";
                 data.MessageContent += "‚æ‚ë‚µ‚­‚¨Šè‚¢‚µ‚Ü‚·�B";
@@ -4010,18 +4062,8 @@
 
                 list.Add(data);
 
-                // ƒe�[ƒuƒ‹ƒRƒlƒNƒg
-                mbdDB.connect(); mbdDB.beginTran();
-                mbtDB.connect(); mbtDB.beginTran();
-
                 // ƒf�[ƒ^“o˜^
-                if (!mbdDB.InsertAction(list, false))
-                {
-                    MessageBox.Show("“o˜^‚ÉŽ¸”s‚µ‚Ü‚µ‚½�B", "“o˜^ƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    mbdDB.rollback();
-                    mbtDB.rollback();
-                    return false;
-                }
+                if (!mbdDB.InsertAction(list, false)) return false;
 
                 // ƒ�‚ÁƒZ�[ƒWŽ}”ÔŽæ“¾
                 string strMBT = mbtDB.CreatePrimarykeyString(data.RecordNumber, data.BranchNumber);
@@ -4039,7 +4081,7 @@
                 wrkTer.SeqNum = ++icnt;
                 // �HŽ–’S“–ŽÒ‚ðƒZƒbƒg‚·‚é
                 wrkTer.ToCode = transferCode;
-                wrkTer.ToName = wkselect.Value;
+                wrkTer.ToName = wkselect;
 
                 terList.Add(wrkTer);
 
@@ -4050,21 +4092,13 @@
                     wrkTer2.BranchNumber = data.BranchNumber;
                     wrkTer2.SeqNum = ++icnt;
                     wrkTer2.ToCode = InstractorCode;
-                    wrkTer2.ToName = wkInst.Value;
+                    wrkTer2.ToName = wkInst;
                     terList.Add(wrkTer2);
                 }
 
                 // ƒf�[ƒ^“o˜^
-                if (!mbtDB.InsertAction(terList, false))
-                {
-                    mbdDB.rollback();
-                    mbtDB.rollback();
-                    return false;
-                }
+                if (!mbtDB.InsertAction(terList, false)) return false;
 
-                mbdDB.commit();
-                mbtDB.commit();
-
                 return true;
             }
             catch (Exception ex)
@@ -4072,12 +4106,6 @@
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
                 return false;
             }
-            finally
-            {
-                mbdDB.close(); mbdDB = null;
-                mbtDB.close(); mbtDB = null;
-                PersonDB.close(); PersonDB = null;
-            }
         }
         #endregion
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoin.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoin.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoin.cs	(revision 334)
@@ -318,6 +318,8 @@
             SetcmbDepartment();
             // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹å¤‰æ›´
             SetcmbPersons();
+            // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã‚»ãƒƒãƒˆæ™‚éƒ¨ç½²ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+            if (!SetPerosonToDepartment()) return;
 
             // ãƒ‡ãƒ¼ã‚¿è¡¨ç¤º
             InitDataLoad();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/CreateLedgerSQL.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/CreateLedgerSQL.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/CreateLedgerSQL.cs	(revision 334)
@@ -231,7 +231,7 @@
                     // é–‹å§‹ãƒ»çµ‚äº†æ—¥ã�Œç„¡ã�„å ´å�ˆã�¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã�®æœŸé¦–ãƒ»æœŸæœ«ã‚’ä½¿ç”¨ã�™ã‚‹
                     stDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
                     edDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
-                    CreateLedgerSQL.CalcStartCompDate(TargetNum,
+                    CalcStartCompDate(TargetNum,
                                         dtDefaultStart, dtDefaultEnd,
                                         CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
                                         CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
@@ -240,14 +240,28 @@
                                         ref stDate, ref edDate);
 
                     int nDepartmentCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.DepartmentCode]);
+                    int nPersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
 
+                    // é›¶ã‚Œã�Ÿçµ¦ä¸Žæ—¥æ•°å�–å¾—
+                    int TargetY = TargetNum;
+                    int NextDiffDay = 0;
+                    int PrevDiffDay = 0;
+                    CommonMotions.CalcSpilledSalary(SalaryDB, TargetY, stDate, edDate, nPersonCode, ref NextDiffDay, ref PrevDiffDay);
+                    // ä»ŠæœŸçµ‚äº†æ—¥å¤‰æ›´
+                    DateTime wrkDate = edDate.AddDays(NextDiffDay);
+                    if (dtDefaultEnd.Date < wrkDate.Date) wrkDate = dtDefaultEnd;
+                    ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate] = wrkDate;
+                    // ä»ŠæœŸé–‹å§‹æ—¥å¤‰æ›´
+                    wrkDate = stDate.AddDays(PrevDiffDay);
+                    if (dtDefaultEnd.Date < wrkDate.Date) wrkDate = dtDefaultEnd;
+                    ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate] = wrkDate;
+
+                    stDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
+                    edDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
+
                     // çµ¦ä¸Žç´¯ç©�å�–å¾—
-                    int nPersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
+                    int workSalary = CommonMotions.CalcElapsedSalary(SalaryDB, stDate, edDate, nPersonCode);
 
-                    int workSalary = CommonMotions.CalcElapsedSalary(SalaryDB, stDate, edDate, nPersonCode);
-                    // é›¶ã‚Œã�Ÿçµ¦ä¸Žç´¯ç©�å�–å¾—
-                    int TargetY = TargetNum;
-                    workSalary += CommonMotions.CalcSpilledSalary(SalaryDB, TargetY, stDate, edDate, nPersonCode);
                     // é…�åˆ—ã‚»ãƒƒãƒˆ
                     ArrarySalary.Add(new SalaryClass(nDepartmentCode, nPersonCode, workSalary, stDate, edDate));
                 }
@@ -287,9 +301,6 @@
                 // å…¥ç¤¾æ—¥ã�ŒæœŸå†…ã�ªã‚‰ã�°é–‹å§‹ã‚’å…¥ç¤¾æ—¥ã�«ã�™ã‚‹
                 if (dtDefaultStart < HireStartDate && HireStartDate < dtDefaultEnd) StartDate = HireStartDate;
 
-                // æœ€å¤§æ—¥ã�Œä»Šæ—¥ã‚ˆã‚Šå¤§ã��ã�„å ´å�ˆã�¯å‡¦ç�†ã�—ã�ªã�„
-                //if (CompDate.Date > DateTime.Today.Date) return;
-
                 // ----- è¨ˆç®—çµ‚äº†æ—¥ã‚»ãƒƒãƒˆ
                 // Defaultã�¯æœŸæœ«
                 CompDate = dtDefaultEnd;
@@ -328,37 +339,43 @@
                 // æŒ¯åˆ†çµ¦ä¸Žé‡‘é¡�å�–å¾—
                 StringBuilder strSQL = new StringBuilder();
                 strSQL.Append("SELECT");
-                strSQL.Append(" SUM(C3.PAYMENTAMOUNT)");
-                strSQL.Append(",SUM(C2.PAYMENTAMOUNT)");
+                if (bExec)
+                    strSQL.Append(" SUM(C2.PAYMENTAMOUNT)");
+                else
+                    strSQL.Append(" SUM(C3.PAYMENTAMOUNT)");
+
                 strSQL.Append(" FROM");
                 strSQL.Append(" CONSTRUCTIONLEDGER P");
                 strSQL.Append(", CONSTRUCTIONBASEINFO B");
                 strSQL.Append(", CONSTRUCTIONLEDGERDETAIL C");
 
-                strSQL.Append(" LEFT JOIN");
-                strSQL.Append(" (Select");
-                strSQL.Append(" CC2.ConstructionCode AS ConstructionCode");
-                strSQL.Append(", CC2.GroupCount AS GroupCount");
-                strSQL.Append(", CC2.LineCount AS LineCount");
-                strSQL.Append(", SUM(CC2.PaymentAmount) AS PaymentAmount");
-                strSQL.Append(" From constructionledgerexcute AS CC2");
-                strSQL.Append(" Group By CC2.ConstructionCode, CC2.GroupCount, CC2.LineCount");
-                strSQL.Append(" ) AS C2");
-                strSQL.Append(" ON C2.ConstructionCode = C.ConstructionCode");
-                strSQL.Append(" And C2.GroupCount = C.GroupCount");
-                strSQL.Append(" And C2.LineCount = C.LineCount");
+                if (bExec)
+                {
+                    strSQL.Append(" LEFT JOIN");
+                    strSQL.Append(" (Select");
+                    strSQL.Append(" CC2.ConstructionCode AS ConstructionCode");
+                    strSQL.Append(", CC2.GroupCount AS GroupCount");
+                    strSQL.Append(", ifnull(SUM(CC2.PaymentAmount), 0) AS PaymentAmount");
+                    strSQL.Append(" From constructionledgerexcute AS CC2");
+                    strSQL.Append(" Group By CC2.ConstructionCode, CC2.GroupCount");
+                    strSQL.Append(" ) AS C2");
+                    strSQL.Append(" ON C2.ConstructionCode = C.ConstructionCode");
+                    strSQL.Append(" And C2.GroupCount = C.GroupCount");
+                }
+                else
+                {
+                    strSQL.Append(" LEFT JOIN");
+                    strSQL.Append(" (Select");
+                    strSQL.Append(" CC3.ConstructionCode AS ConstructionCode");
+                    strSQL.Append(", CC3.GroupCount AS GroupCount");
+                    strSQL.Append(", ifnull(SUM(CC3.OrderDesiredAmount), 0) AS PaymentAmount");
+                    strSQL.Append(" From constructionbudgetdetail AS CC3");
+                    strSQL.Append(" Group By CC3.ConstructionCode, CC3.GroupCount");
+                    strSQL.Append(") AS C3");
+                    strSQL.Append(" ON ROUND((C3.ConstructionCode / 100), 0) = ROUND((C.ConstructionCode / 100), 0)");
+                    strSQL.AppendFormat(" And C3.GroupCount = (C.GroupCount + {0})", nGroupDiff);
+                }
 
-                strSQL.Append(" LEFT JOIN");
-                strSQL.Append(" (Select");
-                strSQL.Append(" CC3.ConstructionCode AS ConstructionCode");
-                strSQL.Append(", CC3.GroupCount AS GroupCount");
-                strSQL.Append(", SUM(CC3.OrderDesiredAmount) AS PaymentAmount");
-                strSQL.Append(" From constructionbudgetdetail AS CC3");
-                strSQL.Append(" Group By CC3.ConstructionCode, CC3.GroupCount");
-                strSQL.Append(") AS C3");
-                strSQL.Append(" ON C3.ConstructionCode = C.ConstructionCode");
-                strSQL.AppendFormat(" And C3.GroupCount = (C.GroupCount + {0})", nGroupDiff);
-
                 // æŒ¯åˆ†ç„¡ã�§ã�¯ç„¡ã�„
                 strSQL.AppendFormat(" WHERE B.CONSTRUCTIONPERIOD = {0}", ConstructionPeriod);
                 strSQL.AppendFormat(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
@@ -380,10 +397,7 @@
                 ArrayList arList = new ArrayList();
                 if (!LedgerDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
                 object[] objSalary = (object[])arList[0];
-                if (bExec)
-                    OnSalary = CommonMotions.cnvInt(objSalary[0]);
-                else
-                    OnSalary = CommonMotions.cnvInt(objSalary[1]);
+                OnSalary = CommonMotions.cnvInt(objSalary[0]);
             }
             catch (Exception ex)
             {
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs	(revision 334)
@@ -619,6 +619,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs	(revision 334)
@@ -625,19 +625,8 @@
                 Array.Clear(CostValue, 0, CostValue.Length);
 
                 // �‡Œv‚ð�WŒv‚·‚é
-                DateTime stDate = DateTime.MaxValue;
-                DateTime edDate = DateTime.MaxValue;
-                // for (int ii = 0; ii < PersonCDArray.Count; ii++)
                 foreach (object[] ObjRec in TargetList)
                 {
-                    CreateLedgerSQL.CalcStartCompDate((int)numUDConstPro.Value,
-                                                        dtDefaultStart, dtDefaultEnd,
-                                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
-                                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
-                                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextStartDate]),
-                                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextCompDate]),
-                                                        ref stDate, ref edDate);
-
                     int PersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
                     // Œo”ïŽæ“¾
                     PersonExpensesCost[] GetCostList = ArraryCost.Where(x => x.PersonCode == PersonCode).ToArray();
@@ -645,12 +634,9 @@
                     {
                         for (int i = 0; i < CostValue.Length; i++)
                         {
-                            CostValue[i] = CurCostRec.CostValue[i];
+                            CostValue[i] += CurCostRec.CostValue[i];
                         }
                     }
-                    //CreateLedgerSQL.GetPersonExpensesCostValue(CostDB, 0,
-                    //                            CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]),
-                    //                            dtDefaultStart, dtDefaultEnd, ref CostValue);
                 }
 
                 // ----- Œo”ï‚Ì�WŒv
@@ -731,7 +717,7 @@
                 int ConstrCost = 0;
                 int PayrollCost = CommonMotions.cnvInt(lblPayroll.Text);
                 // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
-                CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref ConstrCost, false);
+                CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref ConstrCost);
                 ConstrCost -= PayrollCost;
                 // �s�ì�¬
                 RowCnt = dgv.Rows.Add(1);
@@ -1075,7 +1061,11 @@
                 
                 // �ƒ—˜‰v
                 TotalArea[(int)DispColumn.NetProfit] -= Expenses;                   // �ƒ—˜‰v-Œo”ï
-                TotalArea[(int)DispColumn.NetProfit] += Auxiliary;                  // �ƒ—˜‰v+•â�•�lŒ�”ï
+                
+                if (Auxiliary < 0)
+                    TotalArea[(int)DispColumn.NetProfit] += Auxiliary;              // �ƒ—˜‰v+•â�•�lŒ�”ï
+                else
+                    TotalArea[(int)DispColumn.NetProfit] -= Auxiliary;              // �ƒ—˜‰v-•â�•�lŒ�”ï(�lŒ�”ï‚ª�{‚É‚È‚Á‚½�ê�‡‚Í‚»‚ê‚ðˆø‚­)
 
                 // ----- ‘��‡Œv�s•\Ž¦
                 dgv.Rows.Add();       // ‹ó�s
@@ -1386,13 +1376,6 @@
                     // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
                     stDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
                     edDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
-                    CreateLedgerSQL.CalcStartCompDate((int)numUDConstPro.Value,
-                                        dtDefaultStart, dtDefaultEnd,
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextStartDate]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextCompDate]),
-                                        ref stDate, ref edDate);
 
                     // ’S“–ŽÒŽæ“¾
                     PersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
@@ -1402,7 +1385,7 @@
 
                     // ’S“–ŽÒ‘I‘ðŽž�F�U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
                     int wrkSalary = 0;
-                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref wrkSalary);
+                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref wrkSalary, false);
                     OnSalary += wrkSalary;
 
                     // •\Ž¦“ú•tŽæ“¾
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionSplit/FrmConstructionSplit.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionSplit/FrmConstructionSplit.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionSplit/FrmConstructionSplit.cs	(revision 334)
@@ -207,6 +207,8 @@
             SetcmbDepartment();
             // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹å¤‰æ›´
             SetcmbPersons();
+            // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã‚»ãƒƒãƒˆæ™‚éƒ¨ç½²ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+            if (!SetPerosonToDepartment()) return;
 
             // ãƒ‡ãƒ¼ã‚¿è¡¨ç¤º
             InitDataLoad();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CopyTargetList/FrmCopyTargetList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CopyTargetList/FrmCopyTargetList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CopyTargetList/FrmCopyTargetList.cs	(revision 334)
@@ -274,6 +274,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CostomerRegist/FrmCostomerRegistList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CostomerRegist/FrmCostomerRegistList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CostomerRegist/FrmCostomerRegistList.cs	(revision 334)
@@ -278,6 +278,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRList/FrmDRList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRList/FrmDRList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRList/FrmDRList.cs	(revision 334)
@@ -286,6 +286,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs	(revision 334)
@@ -279,17 +279,6 @@
                         int nDepCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.DepartmentCode]);
                         if (nDepCode != DepartmentCode) continue;
 
-                        // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
-                        stDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
-                        edDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
-                        CreateLedgerSQL.CalcStartCompDate((int)numUDConstPro.Value,
-                                        dtDefaultStart, dtDefaultEnd,
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextStartDate]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextCompDate]),
-                                            ref stDate, ref edDate);
-
                         CurPersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
                         // Œo”ïŽæ“¾
                         PersonExpensesCost[] GetCostList = ArraryCost.Where(x => x.PersonCode == CurPersonCode).ToArray();
@@ -300,12 +289,6 @@
                                 CostValue2[i] += CurCostRec.CostValue[i];
                             }
                         }
-                        //Array.Clear(CostValue2Dep, 0, CostValue2Dep.Length);
-                        //CreateLedgerSQL.GetPersonExpensesCostValue(CostDB, 0, CurPersonCode, dtDefaultStart, dtDefaultEnd, ref CostValue2Dep);
-                        //for (int i = 0; i < CostValue2.Length; i++)
-                        //{
-                        //    CostValue2[i] += CostValue2Dep[i];
-                        //}
 
                         // ‹‹—^—Ý�ÏŽæ“¾
                         TotalSalary += ArrarySalary.Where(x => x.DepartmentCode == DepartmentCode && x.PersonCode == CurPersonCode).Sum(y => y.SalaryValue);
@@ -312,7 +295,7 @@
                     }
 
                     // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
-                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, 0, ref OnSalary, false);
+                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, 0, ref OnSalary);
                 }
                 else
                 {
@@ -328,17 +311,6 @@
                     }
                     if (ObjCur == null) return;
 
-                    // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
-                    stDate = CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
-                    edDate = CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
-                    CreateLedgerSQL.CalcStartCompDate((int)numUDConstPro.Value,
-                                        dtDefaultStart, dtDefaultEnd,
-                                        CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
-                                        CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
-                                        CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.NextStartDate]),
-                                        CommonMotions.cnvDate(ObjCur[(int)CreateLedgerSQL.GetPersonTerm.NextCompDate]),
-                                        ref stDate, ref edDate);
-
                     // Œo”ïŽæ“¾
                     PersonExpensesCost[] GetCostList = ArraryCost.Where(x => x.PersonCode == PersonCode).ToArray();
                     foreach (PersonExpensesCost CurCostRec in GetCostList)
@@ -351,7 +323,7 @@
                     //CreateLedgerSQL.GetPersonExpensesCostValue(CostDB, 0, PersonCode, dtDefaultStart, dtDefaultEnd, ref CostValue2);
 
                     // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
-                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref OnSalary, false);
+                    CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, PersonCode, ref OnSalary);
 
                     // ‹‹—^—Ý�ÏŽæ“¾
                     TotalSalary = ArrarySalary.Where(x => x.PersonCode == PersonCode).Sum(y => y.SalaryValue);
@@ -1303,13 +1275,6 @@
                     // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
                     stDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.StartDate]);
                     edDate = CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.CompDate]);
-                    CreateLedgerSQL.CalcStartCompDate((int)numUDConstPro.Value,
-                                        dtDefaultStart, dtDefaultEnd,
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireStartDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.HireCompDays]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextStartDate]),
-                                        CommonMotions.cnvDate(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.NextCompDate]),
-                                        ref stDate, ref edDate);
 
                     // ‹‹—^—Ý�ÏŽæ“¾
                     int nPersonCode = CommonMotions.cnvInt(ObjRec[(int)CreateLedgerSQL.GetPersonTerm.PersonCode]);
@@ -1325,7 +1290,7 @@
 
                 // ----- •\Ž¦�ˆ—�
                 // �U•ª‹‹—^‹àŠz
-                CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, 0, ref OnSalary);
+                CreateLedgerSQL.ProfitGeneral(LedgerDB, (int)numUDConstPro.Value, DepartmentCode, 0, ref OnSalary, false);
 
                 // �U•ª‹‹—^‹àŠz•\Ž¦
                 lblCalcValue1.Text = OnSalary.ToString("#,0");
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/ConstrMATLList/FrmConstrMATLList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/ConstrMATLList/FrmConstrMATLList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/ConstrMATLList/FrmConstrMATLList.cs	(revision 334)
@@ -277,6 +277,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.cs	(revision 334)
@@ -243,6 +243,8 @@
             SetcmbDepartment();
             // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹å¤‰æ›´
             SetcmbPersons();
+            // æ‹…å½“è€…ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã‚»ãƒƒãƒˆæ™‚éƒ¨ç½²ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+            if (!SetPerosonToDepartment()) return;
 
             // ãƒ‡ãƒ¼ã‚¿è¡¨ç¤º
             DispData();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderStatus/FrmPurchaseOrderStatus.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderStatus/FrmPurchaseOrderStatus.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderStatus/FrmPurchaseOrderStatus.cs	(revision 334)
@@ -290,7 +290,9 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
-            
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
+
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
         }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ReqbillingStatus/FrmReqBillingStatus.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ReqbillingStatus/FrmReqBillingStatus.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ReqbillingStatus/FrmReqBillingStatus.cs	(revision 334)
@@ -316,6 +316,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInputList/FrmReqInputList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInputList/FrmReqInputList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInputList/FrmReqInputList.cs	(revision 334)
@@ -291,6 +291,8 @@
             SetcmbDepartment();
             // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/SubConstrRegist/FrmSubConstrRegistList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/SubConstrRegist/FrmSubConstrRegistList.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/SubConstrRegist/FrmSubConstrRegistList.cs	(revision 334)
@@ -275,13 +275,12 @@
         {
             if (m_OpeRestrict) return;
 
-            // ƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒg
-            int DepCode = CommonMotions.cnvInt(cmbDepartment.SelectedValue);
-            int PerCode = CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
+            // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbDepartment();
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX•Ï�X
             SetcmbPersons();
-            cmbDepartment.SelectedValue = DepCode;
-            cmbConstructionPerson.SelectedValue = PerCode;
+            // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+            if (!SetPerosonToDepartment()) return;
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
Index: branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 333)
+++ branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 334)
@@ -32,7 +32,7 @@
 // ã�™ã�¹ã�¦ã�®å€¤ã‚’æŒ‡å®šã�™ã‚‹ã�‹ã€�ä¸‹ã�®ã‚ˆã�†ã�« '*' ã‚’ä½¿ã�£ã�¦ãƒ“ãƒ«ãƒ‰ã�Šã‚ˆã�³ãƒªãƒ“ã‚¸ãƒ§ãƒ³ç•ªå�·ã‚’ 
 // æ—¢å®šå€¤ã�«ã�™ã‚‹ã�“ã�¨ã�Œã�§ã��ã�¾ã�™:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.1.163")]
-[assembly: AssemblyFileVersion("1.0.1.163")]
+[assembly: AssemblyVersion("1.0.1.167")]
+[assembly: AssemblyFileVersion("1.0.1.167")]
 // Log4netã‚’ä½¿ç”¨ã�™ã‚‹
 [assembly: log4net.Config.XmlConfigurator(ConfigFile = @"log4net.config", Watch = true)]
\ No newline at end of file
