Index: branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsChangeLedgerData.cs
===================================================================
--- branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsChangeLedgerData.cs	(revision 194)
+++ branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsChangeLedgerData.cs	(revision 195)
@@ -58,19 +58,19 @@
         {
             try
             {
-                string strSQL = string.Empty;
+                StringBuilder strSQL = new StringBuilder();
                 bool bRet = true;
                 foreach (int ConstrCode in ConstrCodeList)
                 {
                     // 工事台帳実行データよりグループごとの合計金額を取得する
-                    strSQL = "SELECT GROUPCOUNT, SUM(PAYMENTAMOUNT)";
-                    strSQL += " FROM CONSTRUCTIONLEDGEREXCUTE";
-                    strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", ConstrCode);
-                    strSQL += " GROUP BY GROUPCOUNT";
-                    strSQL += " ORDER BY GROUPCOUNT";
+                    strSQL.Append("SELECT GROUPCOUNT, SUM(PAYMENTAMOUNT)");
+                    strSQL.Append(" FROM CONSTRUCTIONLEDGEREXCUTE");
+                    strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", ConstrCode);
+                    strSQL.Append(" GROUP BY GROUPCOUNT");
+                    strSQL.Append(" ORDER BY GROUPCOUNT");
 
                     ArrayList InData = new ArrayList();
-                    if (!LedgerExcuteDB.ExecuteReader(strSQL, ref InData, false)) continue;
+                    if (!LedgerExcuteDB.ExecuteReader(strSQL.ToString(), ref InData, false)) continue;
 
                     // データ無は次のデータ
                     if (InData.Count == 0) continue;
@@ -104,13 +104,14 @@
                     int Billing = CalcGetTotal(InData, GroupCodeList);                              // ----- 請求額
 
                     // ----- 工事詳細台帳更新
-                    strSQL = "UPDATE CONSTRUCTIONLEDGER SET";
-                    strSQL += string.Format(" TOTALPAYMENT = {0}", Payment);
-                    strSQL += string.Format(" , GROSSPROFIT = {0}", (Billing - Payment));
-                    strSQL += string.Format(" , Allowance = {0}", Allowance);
-                    strSQL += string.Format(" , NETPROFIT = {0}", (Billing - (Payment + Allowance + PExpenses)));
-                    strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", ConstrCode);
-                    if (!LedgerExcuteDB.ExecuteNonQuery(strSQL, false))
+                    strSQL.Clear();
+                    strSQL.Append("UPDATE CONSTRUCTIONLEDGER SET");
+                    strSQL.AppendFormat(" TOTALPAYMENT = {0}", Payment);
+                    strSQL.AppendFormat(" , GROSSPROFIT = {0}", (Billing - Payment));
+                    strSQL.AppendFormat(" , Allowance = {0}", Allowance);
+                    strSQL.AppendFormat(" , NETPROFIT = {0}", (Billing - (Payment + Allowance + PExpenses)));
+                    strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", ConstrCode);
+                    if (!LedgerExcuteDB.ExecuteNonQuery(strSQL.ToString(), false))
                     {
                         bRet = false;
                         break;
@@ -198,20 +199,22 @@
                 LedgerExDB.connect(); LedgerExDB.beginTran();
                 PersonDB.connect(); PersonDB.beginTran();
 
+                StringBuilder DetailSQL = new StringBuilder();
                 foreach (ConstructionLedger LedgerRec in LedgerList)
                 {
 
                     // 工事詳細台帳明細データ取得
                     List<ConstructionLedgerDetail> DetailList = new List<ConstructionLedgerDetail>();
-                    string DetailSQL = LedgerDeDB.CreatePrimarykeyString(LedgerRec.ConstructionCode);
-                    DetailSQL += string.Format(" AND OperatingFlg = {0}", (int)CommonDefine.SalaryOperateKind.Oparateing);  // 対応中フラグ
-                    DetailSQL += string.Format(" AND SALARYFLG != {0}", (int)CommonDefine.SalaryDevision.Noting);           // 給与振分区分
-                    DetailSQL += string.Format(" AND GROUPCOUNT IN ({0},{1},{2})",
+                    DetailSQL.Clear();
+                    DetailSQL.Append(LedgerDeDB.CreatePrimarykeyString(LedgerRec.ConstructionCode));
+                    DetailSQL.AppendFormat(" AND OperatingFlg = {0}", (int)CommonDefine.SalaryOperateKind.Oparateing);  // 対応中フラグ
+                    DetailSQL.AppendFormat(" AND SALARYFLG != {0}", (int)CommonDefine.SalaryDevision.Noting);           // 給与振分区分
+                    DetailSQL.AppendFormat(" AND GROUPCOUNT IN ({0},{1},{2})",
                                                                     (int)FrmConstructionLedger.DataGroup.Instructor,        // 指導員給料
                                                                     (int)FrmConstructionLedger.DataGroup.Assistant,         // 副担当者給料
                                                                     (int)FrmConstructionLedger.DataGroup.Payroll);          // 担当者給料行
 
-                    if (!LedgerDeDB.SelectAction(DetailSQL, ref DetailList, false) || DetailList.Count == 0) continue;
+                    if (!LedgerDeDB.SelectAction(DetailSQL.ToString(), ref DetailList, false) || DetailList.Count == 0) continue;
 
                     DateTime TargetDate = DateTime.Now.Date;
                     // 対象月より書込みカラム位置を取得する
@@ -226,11 +229,6 @@
                         // 施工管理中担当者ではない場合は処理しない
                         if (CurRec.OperatingFlg == (int)CommonDefine.SalaryOperateKind.Complate) continue;
 
-                        //if (LedgerRec.ConstructionCode == 2016043601)
-                        //{
-                        //    Debug.WriteLine("stop");
-                        //}
-
                         // セットする金額を計算する
                         switch (CurRec.SalaryFlg)
                         {
@@ -488,13 +486,14 @@
             try
             {
                 // キー作成
-                string strSQL = LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount, ColumnCount);
-                strSQL += string.Format(" AND DATE(TargetMonth) = STR_TO_DATE('{0}','%Y/%m/%d')", ColumnDate.ToShortDateString());
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount, ColumnCount));
+                strSQL.AppendFormat(" AND DATE(TargetMonth) = STR_TO_DATE('{0}','%Y/%m/%d')", ColumnDate.ToShortDateString());
 
                 // データ読込み
                 List<ConstructionLedgerExcute> LedgerExDBList = new List<ConstructionLedgerExcute>();
                 ConstructionLedgerExcute LedgerExDBRec = new ConstructionLedgerExcute();
-                bool ReadData = LedgerExDB.SelectAction(strSQL, ref LedgerExDBList, false);
+                bool ReadData = LedgerExDB.SelectAction(strSQL.ToString(), ref LedgerExDBList, false);
                 if (!ReadData || LedgerExDBList.Count == 0)
                 {
                     LedgerExDBRec.ConstructionCode = ConstrCode;	// 工事コード
@@ -512,7 +511,7 @@
 
                 // データ更新
                 if (!LedgerExDB.UpdateFeild(ConstrCode, GroupCount, LineCount, ColumnCount
-                                            , (int)IOConstructionLedgerExcute.TableColumn.PaymentAmount, DaySalary, false)) return false;
+                                            , (int)IOConstructionLedgerExcute.TableColumn.PaymentAmount, (double)DaySalary, false)) return false;
 
                 return true;
             }
Index: branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsSystemOnceExecute.cs
===================================================================
--- branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsSystemOnceExecute.cs	(revision 194)
+++ branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsSystemOnceExecute.cs	(revision 195)
@@ -395,35 +395,7 @@
             IOMessageBoardData mbdDB = new IOMessageBoardData();
             IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
 
-            string strSQL = "SELECT";
-            strSQL += " t1.MaterialItemCode";
-            strSQL += ", t1.ProcessDate";
-            strSQL += ", t1.SeqNo";
-            strSQL += ", t1.RecKind";
-            strSQL += ", t1.ConstructionCode";
-            strSQL += ", t1.PersonCode";
-            strSQL += ", t1.MaterialCount";
-            strSQL += ", MAX(t1.REPAYPLANDATE) AS RepayPlanDate";
-            strSQL += ", t1.CommentText";
-            strSQL += ", t1.EntryDate";
-            strSQL += ", t1.UpdateDate";
-            strSQL += " FROM";
-            strSQL += " MATERIALRECORDINFO AS t1";
-            strSQL += " INNER JOIN CONSTRUCTIONMATERIALINFO AS t2";
-            strSQL += " ON t1.CONSTRUCTIONCODE = t2.CONSTRUCTIONCODE";
-            strSQL += " AND t1.MATERIALITEMCODE = t2.MATERIALITEMCODE";
-            strSQL += " AND t2.COMPLETEFLG = 0";
-            strSQL += " WHERE";
-            strSQL += " t1.CONSTRUCTIONCODE > 0";
-            strSQL += " AND t1.CONSTRUCTIONCODE IS NOT NULL";
-            strSQL += " AND t1.RECKIND = 0";
-            strSQL += " AND t1.REPAYPLANDATE <= DATE_FORMAT(NOW(), '%Y/%m/%d')";
-            strSQL += " GROUP BY";
-            strSQL += " t1.CONSTRUCTIONCODE";
-            strSQL += ", t1.PERSONCODE";
-            strSQL += " ORDER BY";
-            strSQL += " t1.CONSTRUCTIONCODE";
-            strSQL += " , t1.REPAYPLANDATE";
+            StringBuilder strSQL = new StringBuilder();
 
             try
             {
@@ -434,17 +406,20 @@
 
                 bool procflg = true;
 
+                CreateGetMaterialDataSQL(ref strSQL);
+
                 // 資材履歴情報の返却未完了の貸出データを取得する
                 IOMaterialRecordInfo mrDB = new IOMaterialRecordInfo();
                 ArrayList mrData = new ArrayList();
                 List<MaterialRecordInfo> data = new List<MaterialRecordInfo>();
 
-                if (mrDB.ExecuteReader(strSQL, ref mrData))
+                if (mrDB.ExecuteReader(strSQL.ToString(), ref mrData))
                 {
                     foreach (object[] objwrk in mrData)
                     {
                         MaterialRecordInfo wrkRec = new MaterialRecordInfo();
                         mrDB.Reader2Struct(objwrk, ref wrkRec);
+
                         // チェック
                         TermMaster term = new TermMaster();
                         MaterualStatusCheck(wrkRec, StartDate, ref term);
@@ -491,6 +466,52 @@
         }
         #endregion
 
+        #region 資材返却チェックデータ取得SQL作成
+        /// <summary>
+        /// 資材返却チェックデータ取得SQL作成
+        /// </summary>
+        /// <param name="strSQL"></param>
+        private void CreateGetMaterialDataSQL(ref StringBuilder strSQL)
+        {
+            try
+            {
+                strSQL.Append("SELECT");
+                strSQL.Append(" t1.MaterialItemCode");
+                strSQL.Append(", t1.ProcessDate");
+                strSQL.Append(", t1.SeqNo");
+                strSQL.Append(", t1.RecKind");
+                strSQL.Append(", t1.ConstructionCode");
+                strSQL.Append(", t1.PersonCode");
+                strSQL.Append(", t1.MaterialCount");
+                strSQL.Append(", MAX(t1.REPAYPLANDATE) AS RepayPlanDate");
+                strSQL.Append(", t1.CommentText");
+                strSQL.Append(", t1.EntryDate");
+                strSQL.Append(", t1.UpdateDate");
+                strSQL.Append(" FROM");
+                strSQL.Append(" MATERIALRECORDINFO AS t1");
+                strSQL.Append(" INNER JOIN CONSTRUCTIONMATERIALINFO AS t2");
+                strSQL.Append(" ON t1.CONSTRUCTIONCODE = t2.CONSTRUCTIONCODE");
+                strSQL.Append(" AND t1.MATERIALITEMCODE = t2.MATERIALITEMCODE");
+                strSQL.Append(" AND t2.COMPLETEFLG = 0");
+                strSQL.Append(" WHERE");
+                strSQL.Append(" t1.CONSTRUCTIONCODE > 0");
+                strSQL.Append(" AND t1.CONSTRUCTIONCODE IS NOT NULL");
+                strSQL.Append(" AND t1.RECKIND = 0");
+                strSQL.Append(" AND t1.REPAYPLANDATE <= DATE_FORMAT(NOW(), '%Y/%m/%d')");
+                strSQL.Append(" GROUP BY");
+                strSQL.Append(" t1.CONSTRUCTIONCODE");
+                strSQL.Append(", t1.PERSONCODE");
+                strSQL.Append(" ORDER BY");
+                strSQL.Append(" t1.CONSTRUCTIONCODE");
+                strSQL.Append(" , t1.REPAYPLANDATE");
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}", ex.Message);
+            }
+        }
+        #endregion
+
         #region 工事情報チェック処理
         /// <summary>
         /// 日付の期限チェックを行う
@@ -504,10 +525,11 @@
             try
             {
                 // 工事基本情報を期限テーブルに設定している状態分取得する
-                string strSQL = " WHERE CONSTRUCTIONSTATUSFLG IN (SELECT DISTINCT A1.CONSTRUCTIONSTATUSFLG FROM TERMMASTER A1)";
-                strSQL = " ORDER BY CONSTRUCTIONSTATUSFLG ASC, CONSTRUCTIONCODE ASC";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(" WHERE CONSTRUCTIONSTATUSFLG IN (SELECT DISTINCT A1.CONSTRUCTIONSTATUSFLG FROM TERMMASTER A1)");
+                strSQL.Append(" ORDER BY CONSTRUCTIONSTATUSFLG ASC, CONSTRUCTIONCODE ASC");
                 List<ConstructionBaseInfo> cbiList = new List<ConstructionBaseInfo>();
-                if (!cbiDB.SelectAction(strSQL, ref cbiList)) return true;
+                if (!cbiDB.SelectAction(strSQL.ToString(), ref cbiList)) return true;
 
                 // 経過日数を取得する
                 TimeSpan ts = DateTime.Now - StartDate;
@@ -747,15 +769,16 @@
             try
             {
                 // 工事名称・営業担当者・工事担当者取得
-                string strSQL = "SELECT A.DETAILSTRING, B.PERSONCODE SCODE, B.PERSONNAME SNAME, C.PERSONCODE CCODE, C.PERSONNAME CNAME";
-                strSQL += " FROM CONSTRUCTIONBASEINFO P";
-                strSQL += " LEFT JOIN PERSONINCHARGEMASTER B ON B.PERSONCODE = P.SALESPERSONCODE";
-                strSQL += " LEFT JOIN PERSONINCHARGEMASTER C ON C.PERSONCODE = P.CONSTRUCTIONPERSONCODE";
-                strSQL += " , CONSTRUCTIONBASEINFODETAIL A";
-                strSQL += string.Format(" WHERE P.CONSTRUCTIONCODE = {0}",wrkRec.ConstructionCode);
-                strSQL += string.Format(" AND A.CONSTRUCTIONCODE = P.CONSTRUCTIONCODE AND A.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.DETAILSTRING, B.PERSONCODE SCODE, B.PERSONNAME SNAME, C.PERSONCODE CCODE, C.PERSONNAME CNAME");
+                strSQL.Append(" FROM CONSTRUCTIONBASEINFO P");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER B ON B.PERSONCODE = P.SALESPERSONCODE");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER C ON C.PERSONCODE = P.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(", CONSTRUCTIONBASEINFODETAIL A");
+                strSQL.AppendFormat(" WHERE P.CONSTRUCTIONCODE = {0}",wrkRec.ConstructionCode);
+                strSQL.AppendFormat(" AND A.CONSTRUCTIONCODE = P.CONSTRUCTIONCODE AND A.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
                 ArrayList arList = new ArrayList();
-                if (!cbiDB.ExecuteReader(strSQL, ref arList)) return false;
+                if (!cbiDB.ExecuteReader(strSQL.ToString(), ref arList)) return false;
                 
                 string DetailString = string.Empty;
                 int SalesPersonCode = 0;
@@ -778,9 +801,9 @@
 
                 // 掲示板メッセージ
                 WriteData.FromCode = CommonDefine.s_MsgBoardSystemCode;	                                    // 書込み者コード
-                WriteData.FromName = string.Format(CommonDefine.s_MsgBoardSystemNameFormat, "秘書");          // 書込み者名
+                WriteData.FromName = string.Format(CommonDefine.s_MsgBoardSystemNameFormat, "秘書");        // 書込み者名
 
-                WriteData.MessageTitle = CheckRec.SendTitle;                                              // 伝言タイトル
+                WriteData.MessageTitle = CheckRec.SendTitle;                                                // 伝言タイトル
 
                 // リンク情報
                 WriteData.LinkType = (int)CommonDefine.LinkType.ConstructionInfo;
@@ -843,18 +866,21 @@
                 int iCode3 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("見積提出")).Key;
 
                 // 対象データが存在するかを確認する
-                string strSQL = "SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING FROM CONSTRUCTIONBASEINFO A";
-                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.OrdersDecisionComment);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING");
+                strSQL.Append(" FROM CONSTRUCTIONBASEINFO A");
+                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
+                strSQL.AppendFormat(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.OrdersDecisionComment);
 
-                string strWHERE = " WHERE DATE(A.ESTIMATESSUBMITTEDDATE) != STR_TO_DATE('0001/01/01', '%Y/%m/%d')";
-                strWHERE += string.Format(" AND DATE(DATE_ADD(ESTIMATESSUBMITTEDDATE, INTERVAL '{0}' DAY))", s_NonOrderDay);
-                strWHERE += string.Format(" < STR_TO_DATE('{0}','%Y/%m/%d')", DateTime.Now.ToShortDateString());
-                strWHERE += string.Format(" AND A.CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3);
-                strWHERE += string.Format(" AND A.ESTIMATETYPE IN ({0}, {1})", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget);
-                strSQL += strWHERE;
+                StringBuilder strWHERE = new StringBuilder();
+                strWHERE.AppendFormat(" WHERE DATE(A.ESTIMATESSUBMITTEDDATE) != STR_TO_DATE('{0}', '%Y/%m/%d')", DateTime.MinValue);
+                strWHERE.AppendFormat(" AND DATE(DATE_ADD(A.ESTIMATESSUBMITTEDDATE, INTERVAL '{0}' DAY))", s_NonOrderDay);
+                strWHERE.AppendFormat(" < STR_TO_DATE('{0}','%Y/%m/%d')", DateTime.Now.ToShortDateString());
+                strWHERE.AppendFormat(" AND A.CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3);
+                strWHERE.AppendFormat(" AND A.ESTIMATETYPE IN ({0}, {1})", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget);
+                strSQL.Append(strWHERE.ToString());
                 ArrayList arList = new ArrayList();
-                if (!BaseDB.ExecuteReader(strSQL, ref arList))
+                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref arList))
                 {
                     logger.ErrorFormat("工事基本情報読込エラー　非受注案件移行処理失敗：{0}：{1}", CommonMotions.GetMethodName(), strSQL);
                     return false;
@@ -867,10 +893,11 @@
                 DetailDB.connect(); DetailDB.beginTran();
 
                 // 工事基本情報データ
-                strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO A SET A.CONSTRUCTIONSTATUSFLG = {0},", iCode1);
-                strSQL += string.Format(" A.NONORDERDATE = STR_TO_DATE('{0}','%Y/%m/%d')", DateTime.Today.ToShortDateString());
-                strSQL += strWHERE;
-                if (!BaseDB.ExecuteNonQuery(strSQL, false))
+                strSQL.Clear();
+                strSQL.AppendFormat("UPDATE CONSTRUCTIONBASEINFO A SET A.CONSTRUCTIONSTATUSFLG = {0},", iCode1);
+                strSQL.AppendFormat(" A.NONORDERDATE = STR_TO_DATE('{0}','%Y/%m/%d')", DateTime.Today.ToShortDateString());
+                strSQL.Append(strWHERE.ToString());
+                if (!BaseDB.ExecuteNonQuery(strSQL.ToString(), false))
                 {
                     BaseDB.rollback();
                     logger.ErrorFormat("工事基本情報更新エラー　非受注案件移行処理失敗：{0}：{1}", CommonMotions.GetMethodName(), strSQL);
@@ -969,15 +996,16 @@
                 int iCode2 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("施工完了")).Key;
 
                 // 入力完了以外を対象にする
-                string strSQL = string.Format(" A WHERE A.ComplateFlg <> {0}", (int)CommonDefine.ComplateTitleNo.Complated);
-                strSQL += " AND A.CONSTRUCTIONCODE IN (SELECT A1.CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO A1";
-                strSQL += string.Format(" WHERE A1.CONSTRUCTIONSTATUSFLG != {0}", iCode1);
-                strSQL += string.Format(" AND A1.CONSTRUCTIONSTATUSFLG < {0})", iCode2);
-                strSQL += " AND DATE(A.CONSTRUCTIONSTART) <= DATE(NOW())";
-                strSQL += " ORDER BY A.CONSTRUCTIONSTART ASC";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" A WHERE A.ComplateFlg <> {0}", (int)CommonDefine.ComplateTitleNo.Complated);
+                strSQL.Append(" AND A.CONSTRUCTIONCODE IN (SELECT A1.CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO A1");
+                strSQL.AppendFormat(" WHERE A1.CONSTRUCTIONSTATUSFLG != {0}", iCode1);
+                strSQL.AppendFormat(" AND A1.CONSTRUCTIONSTATUSFLG < {0})", iCode2);
+                strSQL.Append(" AND DATE(A.CONSTRUCTIONSTART) <= DATE(NOW())");
+                strSQL.Append(" ORDER BY A.CONSTRUCTIONSTART ASC");
                 List<ConstructionLedger> LedgerList = new List<ConstructionLedger>();
                 // エラーもしくはデータが無い場合は処理しない
-                if (!LedgerDB.SelectAction(strSQL, ref LedgerList) || LedgerList.Count == 0) return true;
+                if (!LedgerDB.SelectAction(strSQL.ToString(), ref LedgerList) || LedgerList.Count == 0) return true;
 
                 // 給与を加算する
                 ClsChangeLedgerData.CalculatePayment(LedgerList);
@@ -1007,16 +1035,17 @@
             try
             {
                 // 適用する給与と金額が違うデータを検索する
-                string strSQL = "SELECT A.PERSONCODE, A.MONTHLYSALARY, A.YEARSALARY, A.STARTDATE, C.MONTHLYSALARY, C.YEARSALARY";
-                strSQL += " FROM PERSONSALARYMASTER A,";
-                strSQL += " (SELECT PERSONCODE, MAX(STARTDATE) sDate FROM PERSONSALARYMASTER";
-                strSQL += string.Format(" WHERE DATE(STARTDATE) <= STR_TO_DATE('{0}', '%Y/%m/%d') GROUP BY PERSONCODE) B,", DateTime.Today.ToShortDateString());
-                strSQL += " PERSONINCHARGEMASTER C";
-                strSQL += "  WHERE A.PERSONCODE = B.PERSONCODE AND A.STARTDATE = B.sDate";
-                strSQL += " AND C.PERSONCODE = A.PERSONCODE";
-                strSQL += " AND (A.MONTHLYSALARY != C.MONTHLYSALARY OR A.YEARSALARY <> C.YEARSALARY)";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.PERSONCODE, A.MONTHLYSALARY, A.YEARSALARY, A.STARTDATE, C.MONTHLYSALARY, C.YEARSALARY");
+                strSQL.Append(" FROM PERSONSALARYMASTER A,");
+                strSQL.Append(" (SELECT B1.PERSONCODE, MAX(B1.STARTDATE) sDate FROM PERSONSALARYMASTER B1");
+                strSQL.AppendFormat(" WHERE DATE(B1.STARTDATE) <= STR_TO_DATE('{0}', '%Y/%m/%d') GROUP BY PERSONCODE) B,", DateTime.Today.ToShortDateString());
+                strSQL.Append(" PERSONINCHARGEMASTER C");
+                strSQL.Append("  WHERE A.PERSONCODE = B.PERSONCODE AND A.STARTDATE = B.sDate");
+                strSQL.Append(" AND C.PERSONCODE = A.PERSONCODE");
+                strSQL.Append(" AND (A.MONTHLYSALARY != C.MONTHLYSALARY OR A.YEARSALARY <> C.YEARSALARY)");
                 ArrayList arList = new ArrayList();
-                if (!PersonDB.ExecuteReader(strSQL, ref arList)) return false;
+                if (!PersonDB.ExecuteReader(strSQL.ToString(), ref arList)) return false;
 
                 // 更新処理
                 PersonDB.connect(); PersonDB.beginTran();
Index: branches/src/DataCheckExcute/DataCheckExcute/DataCheckExcute.csproj
===================================================================
--- branches/src/DataCheckExcute/DataCheckExcute/DataCheckExcute.csproj	(revision 194)
+++ branches/src/DataCheckExcute/DataCheckExcute/DataCheckExcute.csproj	(revision 195)
@@ -193,9 +193,6 @@
     <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\CostomerRegist.cs">
       <Link>DataModel\CostomerRegist.cs</Link>
     </Compile>
-    <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\DailyData.cs">
-      <Link>DataModel\DailyData.cs</Link>
-    </Compile>
     <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\DailyDataConstruction.cs">
       <Link>DataModel\DailyDataConstruction.cs</Link>
     </Compile>
@@ -487,9 +484,6 @@
     <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IOCostomerRegist.cs">
       <Link>DB\IOAccess\IOCostomerRegist.cs</Link>
     </Compile>
-    <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IODailyData.cs">
-      <Link>DB\IOAccess\IODailyData.cs</Link>
-    </Compile>
     <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IODailyDataConstruction.cs">
       <Link>DB\IOAccess\IODailyDataConstruction.cs</Link>
     </Compile>
