プロジェクト

全般

プロフィール

リビジョン 484

堀内4年以上前に追加

評価点処理追加
発注者マスタ:50音追加
工事日報:工事毎にキー等変更
SQLワイルドカードをフィールドドリスト作成に変更
SQLシングルコート・カンマのコントロールコードを持つ文字列をCONCAT関数により登録する様に変更

差分を表示:

trunk/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs
4248 4248
                DateTime dtDefaultStart = CommonMotions.GetOpeningEndDate(nTargetYear, true);
4249 4249
                DateTime dtDefaultEnd = CommonMotions.GetOpeningEndDate(nTargetYear, false);
4250 4250

  
4251
                strSQL.Append("Select A.* From");
4251
                strSQL.AppendFormat("Select {0} From", IOMPersonInCharge.CreateFieldNameList("A."));
4252 4252
                strSQL.Append(" personinchargemaster As A");
4253 4253
                strSQL.Append(" Left Join chgchargedep As B");
4254 4254
                strSQL.Append("       On B.PersonCode = A.PersonCode");
......
4347 4347
                strSQL.Append(", A.PersonName");
4348 4348
                strSQL.Append(", B.DepartmentCode");
4349 4349
                strSQL.Append(", B.DepartmentName");
4350
                strSQL.Append(" From");
4351
                strSQL.Append(" personinchargemaster As A");
4352
                strSQL.Append(" Left Join chgchargedep As B");
4353
                strSQL.Append("       On B.PersonCode = A.PersonCode");
4350
                strSQL.Append(" From personinchargemaster As A");
4351
                strSQL.Append("      Left Join chgchargedep As B");
4352
                strSQL.Append("           On B.PersonCode = A.PersonCode");
4354 4353

  
4355
                strSQL.AppendFormat(" WHERE ((DATE(A.STARTDATE) <= DATE('{0}'))", dtDefaultEnd.ToShortDateString());
4354
                strSQL.Append(" WHERE");
4355
                strSQL.AppendFormat(" ((DATE(A.STARTDATE) <= DATE('{0}'))", dtDefaultEnd.ToShortDateString());
4356 4356
                strSQL.AppendFormat(" AND (DATE('{0}') <= DATE(A.ENDDATE)", dtDefaultStart.ToShortDateString());
4357 4357
                strSQL.AppendFormat(" OR DATE('{0}') = DATE(A.ENDDATE)))", DateTime.MinValue.ToShortDateString());
4358 4358

  
......
4694 4694
        /// <summary>
4695 4695
        /// 営業日だけのn日前の日付を取る
4696 4696
        /// </summary>
4697
        public static DateTime GetPrevBusinessDate( DateTime WorktDate, int nCount)
4697
        public static DateTime GetPrevBusinessDate( DateTime WorktDate, int nCount, int PersonCode = 0)
4698 4698
        {
4699 4699
            IOMHolidayCalender CalDB = new IOMHolidayCalender();
4700
            IOAllFreeSQL FreeDB = new IOAllFreeSQL();
4700 4701
            try
4701 4702
            {
4702
                // 当月以前は翌月1日をセットして抜ける
4703
                if(WorktDate.Year < DateTime.Today.Year
4704
                    || WorktDate.Month < DateTime.Today.Month)
4703
                // 当月以前は当月1日をセットして抜ける
4704
                int nCheckDay = (WorktDate.Year * 100) + WorktDate.Month;
4705
                int nToday = (DateTime.Today.Year * 100) + DateTime.Today.Month;
4706
                if (nCheckDay < nToday)
4705 4707
                {
4706
                    DateTime dtTarget = new DateTime(WorktDate.Year, WorktDate.Month, 1).AddMonths(1);
4708
                    DateTime dtTarget = new DateTime(WorktDate.Year, WorktDate.Month, 1);
4707 4709
                    return dtTarget;
4708 4710
                }
4709 4711

  
4710 4712
                StringBuilder strSQL = new StringBuilder();
4711 4713

  
4712
                strSQL.Append("SELECT t1.d, DATE_FORMAT(C.HOLIDAY, '%Y/%m/%d') HOLIDAY FROM");
4714
                strSQL.Append("SELECT t1.d");
4715
                strSQL.Append("     , DATE_FORMAT(C.HOLIDAY, '%Y/%m/%d') HOLIDAY");
4716
                strSQL.Append("     , WEEKDAY(t1.d)");
4717
                strSQL.Append(" FROM");
4713 4718
                strSQL.Append("     (SELECT A1.years, A2.month, A3.days");
4714 4719
                strSQL.Append("           , CAST(CONCAT(A1.years, '/', A2.month, '/', A3.days) as DATE) as d");
4715 4720
                strSQL.Append("      FROM yearmaster as A1");
......
4726 4731
                ArrayList arList = new ArrayList();
4727 4732
                CalDB.ExecuteReader(strSQL.ToString(), ref arList);
4728 4733

  
4734
                // 担当者コードがある場合は勤務シフトの月曜日を0として読み込む
4735
                ArrayList WeekList = new ArrayList();
4736
                object[] objWeek = null;
4737
                DateTime dtEnd = DateTime.Today;
4738
                if (PersonCode > 0)
4739
                {
4740
                    strSQL.Clear();
4741
                    strSQL.Append("Select");
4742
                    strSQL.Append(" B.MonValue");
4743
                    strSQL.Append(", B.TueValue");
4744
                    strSQL.Append(", B.WedValue");
4745
                    strSQL.Append(", B.ThuValue");
4746
                    strSQL.Append(", B.FriValue");
4747
                    strSQL.Append(", B.SatValue");
4748
                    strSQL.Append(", B.SunValue");
4749
                    strSQL.Append(", A.PersonCode");
4750
                    strSQL.Append(", A.PersonName");
4751
                    strSQL.Append(", A.EndDate");
4752
                    strSQL.Append(" From personinchargemaster As A");
4753
                    strSQL.Append(" Inner Join workingtime As B");
4754
                    strSQL.Append("       On B.WorkingCode = A.WorkingCode");
4755
                    strSQL.Append(" Where");
4756
                    strSQL.AppendFormat(" A.Personcode = {0}", PersonCode);
4757

  
4758
                    FreeDB.ExecuteReader(strSQL.ToString(), ref WeekList);
4759

  
4760
                    objWeek = (object[])WeekList[0];
4761
                    // 退職日が無い場合は日付をMAXにする
4762
                    dtEnd = CommonMotions.cnvDate(objWeek[9]).Date == DateTime.MinValue.Date
4763
                                                                            ? DateTime.MaxValue.Date
4764
                                                                            : CommonMotions.cnvDate(objWeek[9]).Date;
4765
                }
4766

  
4729 4767
                DateTime dtRet = DateTime.MinValue;
4730 4768
                int nPrevCount = 0;
4731 4769
                foreach(object[] objCalender in arList)
......
4738 4776
                    DateTime dtholiday = CommonMotions.cnvDate(objCalender[1]);
4739 4777
                    if (DateTime.MinValue.Date != dtholiday.Date) continue;
4740 4778

  
4779
                    // 担当者コードがある場合は勤務シフトの比較を行う
4780
                    if (PersonCode > 0)
4781
                    {
4782
                        if(PersonCode== 20200401) { Debug.WriteLine(""); }
4783
                        int nWeekFlg = CommonMotions.cnvInt(objCalender[2]);
4784
                        // 休みの曜日は除外する
4785
                        if (CommonMotions.cnvInt(objWeek[nWeekFlg]) == 1) continue;
4786

  
4787
                        //退職日以降は除外する
4788
                        if (dtEnd < dtwork.Date) continue;
4789
                    }
4790

  
4741 4791
                    nPrevCount++;
4742 4792
                    if (nCount <= nPrevCount)
4743 4793
                    {
......
4756 4806
            finally
4757 4807
            {
4758 4808
                CalDB.close(); CalDB = null;
4809
                FreeDB.close(); FreeDB = null;
4759 4810
            }
4760 4811
        }
4761 4812
        #endregion
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
139 139
            ConstrExpenses = 126,               // 126:施工経費区分登録
140 140
            MaterialKind = 127,                 // 127:資材種類マスタ
141 141
            MaterialItem = 128,                 // 128:資材品目マスタ
142
            SalesConfirm = 129,                 // 129:売上確認
142
            SalesConfirm = 129,                 // 129:売上一覧確認
143 143
            BankBusinessDay = 130,              // 130:銀行営業日マスタ
144 144
            BudgetCodeSum = 131,                // 131:予算書集計コードマスタ
145 145
            AddressConvert = 132,               // 132:郵便番号変換処理
......
147 147
            QualificationD = 134,               // 134:資格マスタ分類
148 148
            QualificationQ = 135,               // 135:資格マスタ区分
149 149
            WorkingTime = 136,                  // 136:就業時間マスタ
150
            EvalScore = 137,                    // 137:評価点数登録
151
            AverageScore = 138,                 // 138:評価点一覧確認
150 152
        }
151 153
        #endregion
152 154

  
......
328 330
                                                                                { (int)MaintenanceExecuteNo.QualificationD,             "資格マスタ区分登録" },        // 134
329 331
                                                                                { (int)MaintenanceExecuteNo.QualificationQ,             "資格マスタ登録" },            // 135
330 332
                                                                                { (int)MaintenanceExecuteNo.WorkingTime,                "就業時間マスタ" },            // 136
333
                                                                                { (int)MaintenanceExecuteNo.EvalScore,                  "評価点数登録" },              // 137
334
                                                                                { (int)MaintenanceExecuteNo.AverageScore,               "評価点一覧確認" },            // 138
331 335
                                                                                };
332 336
        #endregion
333 337

  
......
986 990
                        case (int)ClsExcute.MaintenanceExecuteNo.WorkingTime:               // 136:就業時間マスタ
987 991
                            MaintenanceExecuteNo_WorkingTime(m_ProcControlPara[NowPoint]);
988 992
                            break;
993
                        case (int)ClsExcute.MaintenanceExecuteNo.EvalScore:                 // 137:評価点数登録
994
                            MaintenanceExecuteNo_EvalScore(m_ProcControlPara[NowPoint]);
995
                            break;
996
                        case (int)ClsExcute.MaintenanceExecuteNo.AverageScore:              // 138:評価点一覧確認
997
                            MaintenanceExecuteNo_AverageScore(m_ProcControlPara[NowPoint]);
998
                            break;
989 999

  
990 1000
                        #endregion
991 1001

  
......
1784 1794
                frm.ConstructionCode = CurrentPara.IntExecParameter[0];
1785 1795
                frm.OrderNo = CurrentPara.IntExecParameter[1];
1786 1796
                int nApprovalNo = CurrentPara.IntExecParameter[2];
1787
                frm.PersonCode = CurrentPara.IntExecParameter[3];
1788 1797
                frm.CreateData = CurrentPara.BoolExecParameter[0];
1789 1798

  
1790 1799
                // フォーム表示
......
4541 4550
            }
4542 4551
        }
4543 4552
        #endregion
4553

  
4554
        #region 評価点数登録
4555
        /// <summary>
4556
        /// 評価点数登録
4557
        /// </summary>
4558
        /// <param name="CurrentPara"></param>
4559
        public static void MaintenanceExecuteNo_EvalScore(ProcessParameter CurrentPara)
4560
        {
4561
            // 評価点数登録
4562
            FrmEvalScore frm = new FrmEvalScore();
4563
            try
4564
            {
4565
                int ProcessNo = (int)MaintenanceExecuteNo.EvalScore;
4566
                // 起動・編集フラグ
4567
                int EditFlg = (int)CommonDefine.ProcessDataEdit.Reference;
4568
                if (!ClsSecurityPermission.GetExecutePermission(ProcessNo, ref EditFlg))
4569
                {
4570
                    BackProcess();
4571
                    return;
4572
                }
4573
                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditLock = true;
4574

  
4575
                // フォーム表示
4576
                frm.ShowDialog();
4577
            }
4578
            catch (Exception ex)
4579
            {
4580
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
4581
            }
4582
            finally
4583
            {
4584
                frm.Dispose(); frm = null;
4585
            }
4586
        }
4544 4587
        #endregion
4545 4588

  
4589
        #region 評価点数一覧確認
4590
        /// <summary>
4591
        /// 評価点数一覧確認
4592
        /// </summary>
4593
        /// <param name="CurrentPara"></param>
4594
        public static void MaintenanceExecuteNo_AverageScore(ProcessParameter CurrentPara)
4595
        {
4596
            // 評価点一覧確認
4597
            FrmAverageScore frm = new FrmAverageScore();
4598
            try
4599
            {
4600
                int ProcessNo = (int)MaintenanceExecuteNo.AverageScore;
4601
                // 起動・編集フラグ
4602
                int EditFlg = (int)CommonDefine.ProcessDataEdit.Reference;
4603
                if (!ClsSecurityPermission.GetExecutePermission(ProcessNo, ref EditFlg))
4604
                {
4605
                    BackProcess();
4606
                    return;
4607
                }
4608
                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditLock = true;
4609

  
4610
                // フォーム表示
4611
                frm.ShowDialog();
4612
            }
4613
            catch (Exception ex)
4614
            {
4615
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
4616
            }
4617
            finally
4618
            {
4619
                frm.Dispose(); frm = null;
4620
            }
4621
        }
4622
        #endregion
4623

  
4624
        #endregion
4625

  
4546 4626
        #region サブフォーム
4547 4627
        #region 掲示板メッセージ入力
4548 4628
        /// <summary>
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsMessageBoradAccess.cs
196 196
                // 対象データの取得
197 197
                StringBuilder strSQL = new StringBuilder();
198 198
                strSQL.Append("SELECT");
199
                strSQL.Append(" A.*, B.*, C.*");
199
                strSQL.AppendFormat(" {0}", IOMessageBoardData.CreateFieldNameList("A."));
200
                strSQL.AppendFormat(",{0}", IOMPersonInCharge.CreateFieldNameList("B."));
201
                strSQL.AppendFormat(",{0}", IOMSecurity.CreateFieldNameList("C."));
200 202
                strSQL.Append(" FROM");
201 203
                strSQL.Append(" MESSAGEBOARDDATA A");
202 204
                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER B");
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsOtherProc.cs
491 491

  
492 492
                // 工事日報入力起動
493 493
                frm.ConstructionCode = ClsProcessExist.GetParentConstrCode(ConstrCode);
494
                frm.PersonCode = PersonCode;
494
                //frm.PersonCode = PersonCode;
495 495
                frm.EditLock = EditLock;
496 496
                frm.SubForm = true;
497 497
                frm.ShowInTaskbar = true;
trunk/src/ProcessManagement/ProcessManagement/DB/Core/ABaseDBProcess.cs
3 3
using System.Data;
4 4
using System.Linq;
5 5
using System.Text;
6
using System.Diagnostics;
6 7
using System.Collections;
7 8

  
8 9
using MySql.Data.MySqlClient; 
......
326 327
                        //objwrk[i++] = www.ToString().Equals("null") ? "" : www;
327 328
                        objwrk[i++] = www is null ? "" : www;
328 329
                    }
329

  
330 330
                    arData.Add(objwrk);
331 331

  
332 332
                }
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOActionScheduleData.cs
137 137

  
138 138
                    strcmd.AppendFormat(" STR_TO_DATE('{0}','%Y/%m/%d')", work.TargetDate.ToShortDateString());
139 139
                    strcmd.AppendFormat(", {0}", work.PersonCode.ToString());
140
                    strcmd.AppendFormat(", '{0}'", work.ActionSchedule);
140
                    strcmd.AppendFormat(", {0}", SeparateString(work.ActionSchedule));
141 141
                    strcmd.AppendFormat(", {0}", work.TargetYear.ToString());
142 142
                    strcmd.AppendFormat(", {0}", work.TargetMonth.ToString());
143 143
                    strcmd.AppendFormat(", {0}", work.TargetDay.ToString());
......
186 186

  
187 187
                strcmd.AppendFormat(" STR_TO_DATE('{0}','%Y/%m/%d')", data.TargetDate.ToShortDateString());
188 188
                strcmd.AppendFormat(", {0}", data.PersonCode.ToString());
189
                strcmd.AppendFormat(", '{0}'", data.ActionSchedule);
189
                strcmd.AppendFormat(", {0}", SeparateString(data.ActionSchedule));
190 190
                strcmd.AppendFormat(", {0}", data.TargetYear.ToString());
191 191
                strcmd.AppendFormat(", {0}", data.TargetMonth.ToString());
192 192
                strcmd.AppendFormat(", {0}", data.TargetDay.ToString());
......
226 226

  
227 227
                strcmd.AppendFormat(" TargetDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.TargetDate.ToShortDateString());
228 228
                strcmd.AppendFormat(",PersonCode = {0}", data.PersonCode.ToString());
229
                strcmd.AppendFormat(",ActionSchedule = '{0}'", data.ActionSchedule);
229
                strcmd.AppendFormat(",ActionSchedule = {0}", SeparateString(data.ActionSchedule));
230 230
                strcmd.AppendFormat(",TargetYear = {0}", data.TargetYear.ToString());
231 231
                strcmd.AppendFormat(",TargetMonth = {0}", data.TargetMonth.ToString());
232 232
                strcmd.AppendFormat(",TargetDay = {0}", data.TargetDay.ToString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttNoticeConstrction.cs
189 189
                strcmd.AppendFormat(", {0}", work.AttendanceMonth);                             // 出勤管理年月
190 190
                strcmd.AppendFormat(", {0}", work.OrderNo);                                     // 届番号
191 191
                strcmd.AppendFormat(", {0}", work.ConstructionCode);                            // 工事コード
192
                strcmd.AppendFormat(",'{0}'", work.ConstructionName);                           // 工事名称
192
                strcmd.AppendFormat(", {0}", SeparateString(work.ConstructionName));            // 工事名称
193 193

  
194 194
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
195 195
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
......
238 238
                    strcmd.AppendFormat(", {0}", work.AttendanceMonth);                             // 出勤管理年月
239 239
                    strcmd.AppendFormat(", {0}", work.OrderNo);                                     // 届番号
240 240
                    strcmd.AppendFormat(", {0}", work.ConstructionCode);                            // 工事コード
241
                    strcmd.AppendFormat(",'{0}'", work.ConstructionName);                           // 工事名称
241
                    strcmd.AppendFormat(", {0}", SeparateString(work.ConstructionName));            // 工事名称
242 242

  
243 243
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
244 244
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
......
278 278
                strcmd.AppendFormat(", AttendanceMonth = {0}", data.AttendanceMonth);                       // 出勤管理年月
279 279
                strcmd.AppendFormat(", OrderNo = {0}", data.OrderNo);                                       // 届番号
280 280
                strcmd.AppendFormat(", ConstructionCode = {0}", data.ConstructionCode);                     // 工事コード
281
                strcmd.AppendFormat(", ConstructionName = '{0}'", data.ConstructionName);                   // 工事名称
281
                strcmd.AppendFormat(", ConstructionName = {0}", SeparateString(data.ConstructionName));     // 工事名称
282 282

  
283 283
                strcmd.Append(", UpdateDate = NOW()");
284 284
                strcmd.Append(AddSQLString);
......
349 349
                        strcmd.AppendFormat(" ConstructionCode = {0}", (int)value);
350 350
                        break;
351 351
                    case (int)TableColumn.ConstructionName:     // 工事名称
352
                        strcmd.AppendFormat(" ConstructionName = '{0}'", value.ToString());
352
                        strcmd.AppendFormat(" ConstructionName = {0}", SeparateString(value.ToString()));
353 353
                        break;
354 354
                }
355 355

  
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceDailyData.cs
104 104

  
105 105
        #endregion
106 106

  
107
        #region テーブルのフィールドリストを作成する
108
        /// <summary>
109
        /// テーブルのフィールドリストを作成する
110
        /// </summary>
111
        /// <returns></returns>
112
        public static string CreateFieldNameList(string strAlias = "")
113
        {
114
            StringBuilder strcmd = new StringBuilder();
115
            try
116
            {
117
                strcmd.Append(" ");
118
                bool bColFirst = true;
119
                string strWork = string.Empty;
120
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
121
                {
122
                    strWork = gender.ToString();
123
                    if (!bColFirst) strcmd.Append(",");
124
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate")
125
                        || strWork.Equals("StartTime") || strWork.Equals("CompTime"))
126
                    {
127
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d %H:%i:%s') As {1}", strAlias, strWork);
128
                    }
129
                    else if (strWork.Equals("AttendanceDate"))
130
                    {
131
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d') As {1}", strAlias, strWork);
132
                    }
133
                    else
134
                    {
135
                        strcmd.AppendFormat(" {0}{1}", strAlias, strWork);
136
                    }
137
                    bColFirst = false;
138
                }
139

  
140
                return strcmd.ToString();
141
            }
142
            catch (Exception ex)
143
            {
144
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
145
                return string.Empty;
146
            }
147
        }
148
        #endregion
149

  
107 150
        #region SQL作成
108 151
        /// <summary>
109 152
        /// SQL作成
110 153
        /// </summary>
111 154
        private string CreateSelectSQL()
112 155
        {
113
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
114 156
            StringBuilder strcmd = new StringBuilder();
115
            strcmd.Append("SELECT");
157
            try
158
            {
159
                strcmd.AppendFormat("SELECT {0} FROM AttendanceDailyData", CreateFieldNameList());
116 160

  
117
            bool bColFirst = true;
118
            string strWork = string.Empty;
119
            foreach (var gender in Enum.GetValues(typeof(TableColumn)))
161
                return strcmd.ToString();
162
            }
163
            catch (Exception ex)
120 164
            {
121
                strWork = gender.ToString();
122
                if (!bColFirst) strcmd.Append(",");
123
                if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate")
124
                    || strWork.Equals("StartTime") || strWork.Equals("CompTime"))
125
                {
126
                    strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
127
                }
128
                else if (strWork.Equals("AttendanceDate"))
129
                {
130
                    strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d')", strWork);
131
                }
132
                else
133
                {
134
                    strcmd.AppendFormat(" {0}", strWork);
135
                }
136
                bColFirst = false;
165
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
166
                return string.Empty;
137 167
            }
138

  
139
            strcmd.Append(" FROM AttendanceDailyData");
140

  
141
            return strcmd.ToString();
142 168
        }
143 169
        #endregion
144 170

  
......
236 262
                                            , work.AttendanceDate.ToShortDateString());             // 日報作成日
237 263
                strcmd.AppendFormat(", {0}", work.SeqNo);                                           // 明細行番号
238 264
                strcmd.AppendFormat(", {0}", work.ConstructionCode);                                // 工事番号
239
                strcmd.AppendFormat(",'{0}'", work.ActionResult);                                   // 行動実績
265
                strcmd.AppendFormat(", {0}", SeparateString(work.ActionResult));                    // 行動実績
240 266
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.StartTime);    // 開始時間
241 267
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.CompTime);     // 終了時間
242 268
                strcmd.AppendFormat(", {0}", work.DayTimes);                                        // 稼働時間
243 269
                strcmd.AppendFormat(", {0}", work.Overtime);                                        // 時間外就業
244 270
                strcmd.AppendFormat(", {0}", work.OvertimeWA);                                      // 残業認可時間
245
                strcmd.AppendFormat(",'{0}'", work.WorkingComment);                                 // コメント
271
                strcmd.AppendFormat(", {0}", SeparateString(work.WorkingComment));                  // コメント
246 272
                strcmd.AppendFormat(", {0}", work.WorkKindFlg);                                     // 作業区分フラグ
247 273

  
248 274
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
......
289 315
                                                , work.AttendanceDate.ToShortDateString());             // 日報作成日
290 316
                    strcmd.AppendFormat(", {0}", work.SeqNo);                                           // 明細行番号
291 317
                    strcmd.AppendFormat(", {0}", work.ConstructionCode);                                // 工事番号
292
                    strcmd.AppendFormat(",'{0}'", work.ActionResult);                                   // 行動実績
318
                    strcmd.AppendFormat(", {0}", SeparateString(work.ActionResult));                    // 行動実績
293 319
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.StartTime);    // 開始時間
294 320
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.CompTime);     // 終了時間
295 321
                    strcmd.AppendFormat(", {0}", work.DayTimes);                                        // 稼働時間
296 322
                    strcmd.AppendFormat(", {0}", work.Overtime);                                        // 時間外就業
297 323
                    strcmd.AppendFormat(", {0}", work.OvertimeWA);                                      // 残業認可時間
298
                    strcmd.AppendFormat(",'{0}'", work.WorkingComment);                                 // コメント
324
                    strcmd.AppendFormat(", {0}", SeparateString(work.WorkingComment));                  // コメント
299 325
                    strcmd.AppendFormat(", {0}", work.WorkKindFlg);                                     // 作業区分フラグ
300 326

  
301 327
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
......
339 365
                                        , data.AttendanceDate.ToShortDateString());         // 日報作成日
340 366
                strcmd.AppendFormat(",SeqNo =  {0} ", data.SeqNo);                          // 明細行番号
341 367
                strcmd.AppendFormat(",ConstructionCode = {0}", data.ConstructionCode);      // 工事番号
342
                strcmd.AppendFormat(",ActionResult = '{0}'", data.ActionResult);            // 行動実績
368
                strcmd.AppendFormat(",ActionResult = {0}", SeparateString(data.ActionResult));  // 行動実績
343 369

  
344 370
                strcmd.AppendFormat(",StartTime = STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')"
345 371
                                        , data.StartTime);                                  // 開始時間
......
349 375
                strcmd.AppendFormat(",DayTimes = {0}", data.DayTimes);                      // 稼働時間
350 376
                strcmd.AppendFormat(",Overtime = {0}", data.Overtime);                      // 時間外就業
351 377
                strcmd.AppendFormat(",OvertimeWA = {0}", data.OvertimeWA);                  // 残業認可時間
352
                strcmd.AppendFormat(",WorkingComment = '{0}'", data.WorkingComment);        // コメント
378
                strcmd.AppendFormat(",WorkingComment = {0}", SeparateString(data.WorkingComment));  // コメント
353 379
                strcmd.AppendFormat(",WorkKindFlg = {0}", data.WorkKindFlg);                // 作業区分フラグ
354 380

  
355 381
                strcmd.Append(", UpdateDate = NOW()");
......
421 447
                        strcmd.AppendFormat(" ConstructionCode = {0}", (int)value);
422 448
                        break;
423 449
                    case (int)TableColumn.ActionResult:
424
                        strcmd.AppendFormat(" ActionResult = '{0}'", value.ToString());
450
                        strcmd.AppendFormat(" ActionResult = {0}", SeparateString(value.ToString()));
425 451
                        break;
426 452
                    case (int)TableColumn.StartTime:
427 453
                        strcmd.AppendFormat(" StartTime = STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", ((DateTime)value).ToString());
......
439 465
                        strcmd.AppendFormat(" OvertimeWA = {0}", (decimal)value);
440 466
                        break;
441 467
                    case (int)TableColumn.WorkingComment:
442
                        strcmd.AppendFormat(" WorkingComment = '{0}'", CommonMotions.cnvString(value));
468
                        strcmd.AppendFormat(" WorkingComment = {0}", SeparateString(value.ToString()));
443 469
                        break;
444 470
                    case (int)TableColumn.WorkKindFlg:
445 471
                        strcmd.AppendFormat(" WorkKindFlg = {0}", (int)value);
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOAttendanceNotice.cs
203 203
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.ToDate);   // 申請終了日時
204 204
                strcmd.AppendFormat(", {0}", work.NoticePeriod);                                // 勤怠期間日
205 205
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", work.TransferDay.ToShortDateString());   // 振替日
206
                strcmd.AppendFormat(", '{0}'", work.Reason);                                    // 事由
207
                strcmd.AppendFormat(", '{0}'", work.Note);                                      // 備考
206
                strcmd.AppendFormat(", {0}", SeparateString(work.Reason));                      // 事由
207
                strcmd.AppendFormat(", {0}", SeparateString(work.Note));                        // 備考
208 208
                strcmd.AppendFormat(", {0}", work.ApprovalDate);                                // 承認日
209 209
                strcmd.AppendFormat(", {0}", work.ApprovalNo);                                  // 承認受付番号
210 210
                strcmd.AppendFormat(", {0}", work.DeleteFlg);                                   // 削除フラグ
......
261 261
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.ToDate);   // 申請終了日時
262 262
                    strcmd.AppendFormat(", {0}", work.NoticePeriod);                                // 勤怠期間日
263 263
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", work.TransferDay.ToShortDateString());   // 振替日
264
                    strcmd.AppendFormat(", '{0}'", work.Reason);                                    // 事由
265
                    strcmd.AppendFormat(", '{0}'", work.Note);                                      // 備考
264
                    strcmd.AppendFormat(", {0}", SeparateString(work.Reason));                      // 事由
265
                    strcmd.AppendFormat(", {0}", SeparateString(work.Note));                        // 備考
266 266
                    strcmd.AppendFormat(", {0}", work.ApprovalDate);                                // 承認日
267 267
                    strcmd.AppendFormat(", {0}", work.ApprovalNo);                                  // 承認受付番号
268 268
                    strcmd.AppendFormat(", {0}", work.DeleteFlg);                                   // 削除フラグ
......
308 308
                strcmd.AppendFormat(", HolidayReason = {0}", data.HolidayReason);                           // 休み区分
309 309
                strcmd.AppendFormat(", FromDate = STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.FromDate);  // 申請開始日時
310 310
                strcmd.AppendFormat(", ToDate = STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.ToDate);      // 申請終了日時
311
                strcmd.AppendFormat(", NoticePeriod = {0}", data.NoticePeriod);                                // 勤怠期間日
311
                strcmd.AppendFormat(", NoticePeriod = {0}", data.NoticePeriod);                             // 勤怠期間日
312 312
                strcmd.AppendFormat(", TransferDay = STR_TO_DATE('{0}','%Y/%m/%d')", data.TransferDay.ToShortDateString()); // 振替日
313
                strcmd.AppendFormat(", Reason = '{0}'", data.Reason);                                       // 事由
314
                strcmd.AppendFormat(", Note = '{0}'", data.Note);                                           // 備考
313
                strcmd.AppendFormat(", Reason = {0}", SeparateString(data.Reason));                         // 事由
314
                strcmd.AppendFormat(", Note = {0}", SeparateString(data.Note));                             // 備考
315 315
                strcmd.AppendFormat(", ApprovalDate = {0}", data.ApprovalDate);                             // 承認日
316 316
                strcmd.AppendFormat(", ApprovalNo = {0}", data.ApprovalNo);                                 // 承認受付番号
317 317
                strcmd.AppendFormat(", DeleteFlg = {0}", data.DeleteFlg);                                   // 削除フラグ
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBankBusinessDayMaster.cs
123 123

  
124 124
                    strcmd.AppendFormat("  {0}", work.YearMonth.ToString());
125 125
                    strcmd.AppendFormat(", {0}", work.BankBusinessDay.ToString());
126
                    strcmd.AppendFormat(", '{0}'", work.Note.ToString());
126
                    strcmd.AppendFormat(", {0}", SeparateString(work.Note.ToString()));
127 127
                    strcmd.AppendFormat(", {0}", work.DeleteFlg.ToString());
128 128

  
129 129
                    strcmd.Append(", NOW()");
......
160 160

  
161 161
                strcmd.AppendFormat(" YearMonth = {0}", data.YearMonth.ToString());
162 162
                strcmd.AppendFormat(",BankBusinessDay = {0}", data.BankBusinessDay.ToString());
163
                strcmd.AppendFormat(",Note = '{0}'", data.Note);
163
                strcmd.AppendFormat(",Note = {0}", SeparateString(data.Note));
164 164
                strcmd.AppendFormat(",DeleteFlg = {0}", data.DeleteFlg.ToString());
165 165

  
166 166
                strcmd.Append(", UpdateDate = NOW()");
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingCostDataLink.cs
38 38
            SeqNoB,
39 39
            LineCount,
40 40
            LabourKind,
41
            LinkType,
41 42
            YearNumber,
42 43
            CostType,
43 44
            TargetType,
44 45
            TargetCode,
45 46
            SeqNoC,
47
            PersonCode,
48
            ActionDate,
49
            DataType,
50
            DataAddCount,
46 51
            EntryDate,
47 52
            UpdateDate,
48 53
        }
......
192 197
                strcmd.AppendFormat(", {0}", work.SeqNoB);
193 198
                strcmd.AppendFormat(", {0}", work.LineCount);
194 199
                strcmd.AppendFormat(", {0}", work.LabourKind);
200
                strcmd.AppendFormat(", {0}", work.LinkType);
195 201
                strcmd.AppendFormat(", {0}", work.YearNumber);
196 202
                strcmd.AppendFormat(", {0}", work.CostType);
197 203
                strcmd.AppendFormat(", {0}", work.TargetType);
198 204
                strcmd.AppendFormat(", {0}", work.TargetCode);
199 205
                strcmd.AppendFormat(", {0}", work.SeqNoC);
206
                strcmd.AppendFormat(", {0}", work.PersonCode);
207
                strcmd.AppendFormat(", DATE('{0}')", work.ActionDate.ToShortDateString());
208
                strcmd.AppendFormat(", {0}", work.DataType);
209
                strcmd.AppendFormat(", {0}", work.DataAddCount);
200 210

  
201 211
                strcmd.Append(", NOW()");
202 212
                strcmd.Append(", NOW()");
......
248 258
                    strcmd.AppendFormat(", {0}", work.SeqNoB);
249 259
                    strcmd.AppendFormat(", {0}", work.LineCount);
250 260
                    strcmd.AppendFormat(", {0}", work.LabourKind);
261
                    strcmd.AppendFormat(", {0}", work.LinkType);
251 262
                    strcmd.AppendFormat(", {0}", work.YearNumber);
252 263
                    strcmd.AppendFormat(", {0}", work.CostType);
253 264
                    strcmd.AppendFormat(", {0}", work.TargetType);
254 265
                    strcmd.AppendFormat(", {0}", work.TargetCode);
255 266
                    strcmd.AppendFormat(", {0}", work.SeqNoC);
267
                    strcmd.AppendFormat(", {0}", work.PersonCode);
268
                    strcmd.AppendFormat(", DATE('{0}')", work.ActionDate.ToShortDateString());
269
                    strcmd.AppendFormat(", {0}", work.DataType);
270
                    strcmd.AppendFormat(", {0}", work.DataAddCount);
256 271

  
257 272
                    strcmd.Append(", NOW()");
258 273
                    strcmd.Append(", NOW()");
......
292 307
                strcmd.AppendFormat(", SeqNoB = {0}", data.SeqNoB);
293 308
                strcmd.AppendFormat(", LineCount = {0}", data.LineCount);
294 309
                strcmd.AppendFormat(", LabourKind = {0}", data.LabourKind);
310
                strcmd.AppendFormat(", LinkType = {0}", data.LinkType);
295 311
                strcmd.AppendFormat(", YearNumber = {0}", data.YearNumber);
296 312
                strcmd.AppendFormat(", CostType = {0}", data.CostType);
297 313
                strcmd.AppendFormat(", TargetType = {0}", data.TargetType);
298 314
                strcmd.AppendFormat(", TargetCode = {0}", data.TargetCode);
299 315
                strcmd.AppendFormat(", SeqNo = {0}", data.SeqNoC);
316
                strcmd.AppendFormat(", PersonCode = {0}", data.PersonCode);
317
                strcmd.AppendFormat(", ActionDate = DATE('{0}')", data.ActionDate.ToShortDateString());
318
                strcmd.AppendFormat(", DataType = {0}", data.DataType);
319
                strcmd.AppendFormat(", DataAddCount = {0}", data.DataAddCount);
300 320

  
301 321
                strcmd.Append(", UpdateDate = NOW()");
302 322
                strcmd.Append(AddSQLString);
......
343 363
                    case (int)NameColumn.LabourKind:
344 364
                        strcmd.AppendFormat(" LabourKind = {0}", (int)value);
345 365
                        break;
366
                    case (int)NameColumn.LinkType:
367
                        strcmd.AppendFormat(" LinkType = {0}", (int)value);
368
                        break;
346 369
                    case (int)NameColumn.YearNumber:
347 370
                        strcmd.AppendFormat(" YearNumber = {0}", (int)value);
348 371
                        break;
......
358 381
                    case (int)NameColumn.SeqNoC:
359 382
                        strcmd.AppendFormat(" SeqNoC = {0}", (int)value);
360 383
                        break;
384
                    case (int)NameColumn.PersonCode:
385
                        strcmd.AppendFormat(" PersonCode = {0}", (int)value);
386
                        break;
387
                    case (int)NameColumn.ActionDate:
388
                        strcmd.AppendFormat(" ActionDate = DATE('{0}')", ((DateTime)value).ToShortDateString());
389
                        break;
390
                    case (int)NameColumn.DataType:
391
                        strcmd.AppendFormat(" DataType = {0}", (int)value);
392
                        break;
393
                    case (int)NameColumn.DataAddCount:
394
                        strcmd.AppendFormat(" DataAddCount = {0}", (int)value);
395
                        break;
361 396
                }
362 397

  
363 398
                strcmd.Append(", UpdateDate = NOW()");
......
415 450
                wrk.SeqNoB = int.Parse(objwrk[(int)NameColumn.SeqNoB].ToString());
416 451
                wrk.LineCount= int.Parse(objwrk[(int)NameColumn.LineCount].ToString());
417 452
                wrk.LabourKind= int.Parse(objwrk[(int)NameColumn.LabourKind].ToString());
453
                wrk.LinkType = int.Parse(objwrk[(int)NameColumn.LinkType].ToString());
418 454
                wrk.YearNumber = int.Parse(objwrk[(int)NameColumn.YearNumber].ToString());
419 455
                wrk.CostType = int.Parse(objwrk[(int)NameColumn.CostType].ToString());
420 456
                wrk.TargetType = int.Parse(objwrk[(int)NameColumn.TargetType].ToString());
421 457
                wrk.TargetCode = int.Parse(objwrk[(int)NameColumn.TargetCode].ToString());
422 458
                wrk.SeqNoC = int.Parse(objwrk[(int)NameColumn.SeqNoC].ToString());
459
                wrk.PersonCode = int.Parse(objwrk[(int)NameColumn.PersonCode].ToString());
460
                wrk.ActionDate = DateTime.Parse(objwrk[(int)NameColumn.ActionDate].ToString());
461
                wrk.DataType = int.Parse(objwrk[(int)NameColumn.DataType].ToString());
462
                wrk.DataAddCount = int.Parse(objwrk[(int)NameColumn.DataAddCount].ToString());
423 463

  
424 464
                wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
425 465
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
......
464 504
        /// <summary>
465 505
        /// 行ロック
466 506
        /// </summary>
467
        /// <param name="MaterialItemCode"></param>
468
        /// <param name="bConnect"></param>
469 507
        /// <returns></returns>
470 508
        public bool RowLock(int CompanyCode, int TargetDate, int SeqNo, int LineCount, int LabourKind, bool bConnect = true)
471 509
        {
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingData.cs
434 434
        /// <summary>
435 435
        /// 行ロック
436 436
        /// </summary>
437
        /// <param name="MaterialItemCode"></param>
438
        /// <param name="bConnect"></param>
439 437
        /// <returns></returns>
440 438
        public bool RowLock(int CompanyCode, int TargetDate, int SeqNo, bool bConnect = true)
441 439
        {
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs
203 203
                strcmd.AppendFormat(", {0}", work.ConstructionRowCnt);
204 204
                strcmd.AppendFormat(", {0}", work.ConstructionColCnt);
205 205
                strcmd.AppendFormat(", {0}", work.LinkDataType);
206
                strcmd.AppendFormat(", '{0}'", work.FieldName);
206
                strcmd.AppendFormat(", {0}", SeparateString(work.FieldName));
207 207
                strcmd.AppendFormat(", {0}", work.BillPrice);
208 208
                strcmd.AppendFormat(", {0}", work.HighwPrice);
209 209
                strcmd.AppendFormat(", {0}", work.HardwPrice);
210 210
                strcmd.AppendFormat(", {0}", work.IndsWasteTax);
211 211
                strcmd.AppendFormat(", {0}", work.OverFlg);
212
                strcmd.AppendFormat(", '{0}'", work.Note);
212
                strcmd.AppendFormat(", {0}", SeparateString(work.Note));
213 213
                strcmd.AppendFormat(", {0}", work.DeleteFlg);
214 214

  
215 215
                strcmd.Append(", NOW()");
......
266 266
                    strcmd.AppendFormat(", {0}", work.ConstructionRowCnt);
267 267
                    strcmd.AppendFormat(", {0}", work.ConstructionColCnt);
268 268
                    strcmd.AppendFormat(", {0}", work.LinkDataType);
269
                    strcmd.AppendFormat(", '{0}'", work.FieldName);
269
                    strcmd.AppendFormat(", {0}", SeparateString(work.FieldName));
270 270
                    strcmd.AppendFormat(", {0}", work.BillPrice);
271 271
                    strcmd.AppendFormat(", {0}", work.HighwPrice);
272 272
                    strcmd.AppendFormat(", {0}", work.HardwPrice);
273 273
                    strcmd.AppendFormat(", {0}", work.IndsWasteTax);
274 274
                    strcmd.AppendFormat(", {0}", work.OverFlg);
275
                    strcmd.AppendFormat(", '{0}'", work.Note);
275
                    strcmd.AppendFormat(", {0}", SeparateString(work.Note));
276 276
                    strcmd.AppendFormat(", {0}", work.DeleteFlg);
277 277

  
278 278
                    strcmd.Append(", NOW()");
......
317 317
                strcmd.AppendFormat(", ConstructionRowCnt = {0}", data.ConstructionRowCnt);
318 318
                strcmd.AppendFormat(", ConstructionColCnt = {0}", data.ConstructionColCnt);
319 319
                strcmd.AppendFormat(", LinkDataType = {0}", data.LinkDataType);
320
                strcmd.AppendFormat(", FieldName = '{0}'", data.FieldName);
320
                strcmd.AppendFormat(", FieldName = {0}", SeparateString(data.FieldName));
321 321
                strcmd.AppendFormat(", BillPrice = {0}", data.BillPrice);
322 322
                strcmd.AppendFormat(", HighwPrice = {0}", data.HighwPrice);
323 323
                strcmd.AppendFormat(", HardwPrice = {0}", data.HardwPrice);
324 324
                strcmd.AppendFormat(", IndsWasteTax = {0}", data.IndsWasteTax);
325 325
                strcmd.AppendFormat(", OverFlg = {0}", data.OverFlg);
326
                strcmd.AppendFormat(", Note = '{0}'", data.Note);
326
                strcmd.AppendFormat(", Note = {0}", SeparateString(data.Note));
327 327
                strcmd.AppendFormat(", DeleteFlg = {0}", data.DeleteFlg);
328 328

  
329 329
                strcmd.Append(", UpdateDate = NOW()");
......
520 520
        /// <summary>
521 521
        /// 行ロック
522 522
        /// </summary>
523
        /// <param name="MaterialItemCode"></param>
524
        /// <param name="bConnect"></param>
525 523
        /// <returns></returns>
526 524
        public bool RowLock(int CompanyCode, int TargetDate, int SeqNo, int LineCount, int LabourKind, bool bConnect = true)
527 525
        {
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingPaymentSummary.cs
411 411
        /// <summary>
412 412
        /// 行ロック
413 413
        /// </summary>
414
        /// <param name="MaterialItemCode"></param>
415
        /// <param name="bConnect"></param>
416 414
        /// <returns></returns>
417 415
        public bool RowLock(int CompanyCode, int TargetDate, int ChargePaymentKind, bool bConnect = true)
418 416
        {
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs
108 108

  
109 109
        #endregion
110 110

  
111
        #region SELECT SQL作成
111
        #region テーブルのフィールドリストを作成する
112 112
        /// <summary>
113
        /// SQL作成
113
        /// テーブルのフィールドリストを作成する
114 114
        /// </summary>
115
        private string CreateSelectSQL()
115
        /// <returns></returns>
116
        public static string CreateFieldNameList(string strAlias = "")
116 117
        {
117 118
            StringBuilder strcmd = new StringBuilder();
118 119
            try
119 120
            {
120
                strcmd.Append("SELECT ");
121

  
121
                strcmd.Append(" ");
122 122
                bool bColFirst = true;
123 123
                string strWork = string.Empty;
124 124
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
......
127 127
                    if (!bColFirst) strcmd.Append(",");
128 128
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
129 129
                    {
130
                        strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
130
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d %H:%i:%s') As {1}", strAlias, strWork);
131 131
                    }
132 132
                    else if (strWork.Equals("RequestedDate")
133 133
                            || strWork.Equals("EstimatesSubmitDeadline")
......
159 159
                            || strWork.Equals("InspectExecuteDate")
160 160
                            || strWork.Equals("RevCompleteDate"))
161 161
                    {
162
                        strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d')", strWork);
162
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d') As {1}", strAlias, strWork);
163 163
                    }
164 164
                    else
165 165
                    {
166
                        strcmd.AppendFormat(" {0}", strWork);
166
                        strcmd.AppendFormat(" {0}{1}", strAlias, strWork);
167 167
                    }
168 168
                    bColFirst = false;
169 169
                }
170 170

  
171
                strcmd.Append(" FROM ConstructionBaseInfo");
171
                return strcmd.ToString();
172
            }
173
            catch (Exception ex)
174
            {
175
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
176
                return string.Empty;
177
            }
178
        }
179
        #endregion
172 180

  
181
        #region SELECT SQL作成
182
        /// <summary>
183
        /// SQL作成
184
        /// </summary>
185
        private string CreateSelectSQL()
186
        {
187
            StringBuilder strcmd = new StringBuilder();
188
            try
189
            {
190
                strcmd.AppendFormat("SELECT {0} FROM ConstructionBaseInfo", CreateFieldNameList());
191

  
173 192
                return strcmd.ToString();
174 193
            }
175 194
            catch (Exception ex)
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfoDetail.cs
177 177

  
178 178
                strcmd.AppendFormat("  {0}", data.ConstructionCode);
179 179
                strcmd.AppendFormat(", {0}", data.DetailNo);
180
                strcmd.AppendFormat(",'{0}'", data.DetailString);
180
                strcmd.AppendFormat(", {0}", SeparateString(data.DetailString));
181 181

  
182 182
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
183 183
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
......
225 225

  
226 226
                    strcmd.AppendFormat("  {0}", work.ConstructionCode);
227 227
                    strcmd.AppendFormat(", {0}", work.DetailNo);
228
                    strcmd.AppendFormat(",'{0}'", work.DetailString);
228
                    strcmd.AppendFormat(", {0}", SeparateString(work.DetailString));
229 229

  
230 230
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
231 231
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
......
265 265

  
266 266
                strcmd.AppendFormat("  ConstructionCode = {0}", data.ConstructionCode);
267 267
                strcmd.AppendFormat(", DetailNo = {0}", data.DetailNo);
268
                strcmd.AppendFormat(", DetailString = '{0}'", data.DetailString);
268
                strcmd.AppendFormat(", DetailString = {0}", SeparateString(data.DetailString));
269 269

  
270 270
                strcmd.Append(", UpdateDate = NOW()");
271 271
                strcmd.Append(AddSQLString);
......
362 362
                        strcmd.AppendFormat(" DetailNo = {0}", ((int)value).ToString());
363 363
                        break;
364 364
                    case (int)TableColumn.DETAILSTRING:
365
                        strcmd.AppendFormat(" DetailString = '{0}'", value.ToString());
365
                        strcmd.AppendFormat(" DetailString = {0}", SeparateString(value.ToString()));
366 366
                        break;
367 367
                }
368 368

  
......
382 382
        #endregion
383 383

  
384 384
        #region 検索の文字列を返す
385

  
386 385
        /// <summary>
387 386
        /// 主キー検索の文字列を返す
388 387
        /// </summary>
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs
231 231
                strcmd.AppendFormat("  {0}", work.ConstructionCode);                // 工事番号
232 232

  
233 233
                strcmd.AppendFormat(", {0}", work.CreatorCode);                     // 作成者コード
234
                strcmd.AppendFormat(",'{0}'", work.CreatorName);                    // 作成者名
234
                strcmd.AppendFormat(", {0}", SeparateString(work.CreatorName));     // 作成者名
235 235
                strcmd.AppendFormat(", {0}", work.CreatorCosts);                    // 作成者給与
236 236

  
237 237
                strcmd.AppendFormat(", {0}", work.AssistantCode);                   // 副担当者コード
238
                strcmd.AppendFormat(",'{0}'", work.AssistantName);                  // 副担当者名
238
                strcmd.AppendFormat(", {0}", SeparateString(work.AssistantName));   // 副担当者名
239 239
                strcmd.AppendFormat(", {0}", work.AssistantCosts);                  // 副担当者給与
240 240

  
241 241
                strcmd.AppendFormat(", {0}", work.InstructorCode);                  // 工事指導員コード
242
                strcmd.AppendFormat(",'{0}'", work.InstructorName);                 // 工事指導員名
242
                strcmd.AppendFormat(", {0}", SeparateString(work.InstructorName));  // 工事指導員名
243 243
                strcmd.AppendFormat(", {0}", work.InstructorCosts);                 // 工事指導員給与
244 244
                
245 245
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
......
306 306
                    strcmd.AppendFormat("  {0}", work.ConstructionCode);                // 工事番号
307 307

  
308 308
                    strcmd.AppendFormat(", {0}", work.CreatorCode);                     // 作成者コード
309
                    strcmd.AppendFormat(",'{0}'", work.CreatorName);                    // 作成者名
309
                    strcmd.AppendFormat(", {0} ", SeparateString(work.CreatorName));    // 作成者名
310 310
                    strcmd.AppendFormat(", {0}", work.CreatorCosts);                    // 作成者給与
311 311

  
312 312
                    strcmd.AppendFormat(", {0}", work.AssistantCode);                   // 副担当者コード
313
                    strcmd.AppendFormat(",'{0}'", work.AssistantName);                  // 副担当者名
313
                    strcmd.AppendFormat(", {0}", SeparateString(work.AssistantName));   // 副担当者名
314 314
                    strcmd.AppendFormat(", {0}", work.AssistantCosts);                  // 副担当者給与
315 315

  
316 316
                    strcmd.AppendFormat(", {0}", work.InstructorCode);                  // 工事指導員コード
317
                    strcmd.AppendFormat(",'{0}'", work.InstructorName);                 // 工事指導員名
317
                    strcmd.AppendFormat(", {0}", SeparateString(work.InstructorName));  // 工事指導員名
318 318
                    strcmd.AppendFormat(", {0}", work.InstructorCosts);                 // 工事指導員給与
319 319

  
320 320
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
......
373 373
                strcmd.AppendFormat(" ConstructionCode = {0}", data.ConstructionCode);	            // 工事番号
374 374

  
375 375
                strcmd.AppendFormat(", CreatorCode = {0}", data.CreatorCode);                       // 作成者コード
376
                strcmd.AppendFormat(", CreatorName = '{0}'", data.CreatorName);                     // 作成者名
376
                strcmd.AppendFormat(", CreatorName = {0}", SeparateString(data.CreatorName));       // 作成者名
377 377
                strcmd.AppendFormat(", CreatorCosts = {0}", data.CreatorCosts);                     // 作成者給与
378 378

  
379 379
                strcmd.AppendFormat(", AssistantCode = {0}", data.AssistantCode);                   // 副担当者コード
380
                strcmd.AppendFormat(", AssistantName = '{0}'", data.AssistantName);                 // 副担当者名
380
                strcmd.AppendFormat(", AssistantName = {0}", SeparateString(data.AssistantName));   // 副担当者名
381 381
                strcmd.AppendFormat(", AssistantCosts = {0}", data.AssistantCosts);                 // 副担当者給与
382 382

  
383 383
                strcmd.AppendFormat(", InstructorCode = {0}", data.InstructorCode);                 // 工事指導員コード
384
                strcmd.AppendFormat(", InstructorName = '{0}'", data.InstructorName);               // 工事指導員名
384
                strcmd.AppendFormat(", InstructorName = {0}", SeparateString(data.InstructorName)); // 工事指導員名
385 385
                strcmd.AppendFormat(", InstructorCosts = {0}", data.InstructorCosts);               // 工事指導員給与
386 386
                strcmd.AppendFormat(", CreateDate = STR_TO_DATE('{0}','%Y/%m/%d')",
387 387
                                                        data.CreateDate.ToShortDateString());       // 作成日
......
465 465
                        strcmd.AppendFormat(" CreatorCode = {0}", ((int)value).ToString());
466 466
                        break;
467 467
                    case (int)TableColumn.CreatorName:    	    // 作成者名
468
                        strcmd.AppendFormat(" CreatorName = '{0}'", value.ToString());
468
                        strcmd.AppendFormat(" CreatorName = {0}", SeparateString(value.ToString()));
469 469
                        break;
470 470
                    case (int)TableColumn.CreatorCosts:	        // 作成者給与
471 471
                        strcmd.AppendFormat(" CreatorCosts = {0}", ((double)value).ToString());
......
474 474
                        strcmd.AppendFormat(" AssistantCode = {0}", ((int)value).ToString());
475 475
                        break;
476 476
                    case (int)TableColumn.AssistantName:        // 副担当者名
477
                        strcmd.AppendFormat(" AssistantName = '{0}'", value.ToString());
477
                        strcmd.AppendFormat(" AssistantName = {0}", SeparateString(value.ToString()));
478 478
                        break;
479 479
                    case (int)TableColumn.AssistantCosts:       // 副担当者給与
480 480
                        strcmd.AppendFormat(" AssistantCosts = {0}", ((double)value).ToString());
......
483 483
                        strcmd.AppendFormat(" InstructorCode = {0}", ((int)value).ToString());
484 484
                        break;
485 485
                    case (int)TableColumn.InstructorName:	    // 工事指導員名
486
                        strcmd.AppendFormat(" InstructorName = '{0}'", value.ToString());
486
                        strcmd.AppendFormat(" InstructorName = {0}", SeparateString(value.ToString()));
487 487
                        break;
488 488
                    case (int)TableColumn.InstructorCosts:	    // 工事指導員給与
489 489
                        strcmd.AppendFormat(" InstructorCosts = {0}", ((double)value).ToString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudgetDetail.cs
205 205
                strcmd.AppendFormat(", {0}", work.LineCount);               // 行番号
206 206
                strcmd.AppendFormat(", {0}", work.ComponentCode);           // 構成キー
207 207
                strcmd.AppendFormat(", {0}", work.ItemCode);		        // 工種キー
208
                strcmd.AppendFormat(",'{0}'", work.FirstString);            // 項目名称
209
                strcmd.AppendFormat(",'{0}'", work.SecondString);           // 工事内容
208
                strcmd.AppendFormat(", {0}", SeparateString(work.FirstString));     // 項目名称
209
                strcmd.AppendFormat(", {0}", SeparateString(work.SecondString));    // 工事内容
210 210
                strcmd.AppendFormat(", {0}", work.CompanyType);             // 協力会社コードタイプ
211 211
                strcmd.AppendFormat(", {0}", work.CompanyCode);             // 協力会社コード
212
                strcmd.AppendFormat(",'{0}'", work.CompanyName);            // 協力会社名称
212
                strcmd.AppendFormat(", {0}", SeparateString(work.CompanyName));     // 協力会社名称
213 213
                strcmd.AppendFormat(", {0}", work.EstimatePrice);           // 見積時金額
214 214
                strcmd.AppendFormat(", {0}", work.NegotiationPrice);        // 交渉時金額
215 215
                strcmd.AppendFormat(", {0}", work.OrderDesiredAmount);      // 発注希望金額
......
267 267
                    strcmd.AppendFormat(", {0}", work.LineCount);               // 行番号
268 268
                    strcmd.AppendFormat(", {0}", work.ComponentCode);           // 構成キー
269 269
                    strcmd.AppendFormat(", {0}", work.ItemCode);		        // 工種キー
270
                    strcmd.AppendFormat(",'{0}'", work.FirstString);            // 項目名称
271
                    strcmd.AppendFormat(",'{0}'", work.SecondString);           // 工事内容
270
                    strcmd.AppendFormat(", {0}", SeparateString(work.FirstString));         // 項目名称
271
                    strcmd.AppendFormat(", {0}", SeparateString(work.SecondString));        // 工事内容
272 272
                    strcmd.AppendFormat(", {0}", work.CompanyType);             // 協力会社コードタイプ
273 273
                    strcmd.AppendFormat(", {0}", work.CompanyCode);             // 協力会社コード
274
                    strcmd.AppendFormat(",'{0}'", work.CompanyName);            // 協力会社名称
274
                    strcmd.AppendFormat(", {0}", SeparateString(work.CompanyName));         // 協力会社名称
275 275
                    strcmd.AppendFormat(", {0}", work.EstimatePrice);           // 見積時金額
276 276
                    strcmd.AppendFormat(", {0}", work.NegotiationPrice);        // 交渉時金額
277 277
                    strcmd.AppendFormat(", {0}", work.OrderDesiredAmount);      // 発注希望金額
......
321 321
                strcmd.AppendFormat(", LineCount = {0}", data.LineCount);                       // 行番号
322 322
                strcmd.AppendFormat(", ComponentCode = {0}", data.ComponentCode);               // 構成キー
323 323
                strcmd.AppendFormat(", ItemCode = {0}", data.ItemCode);		                    // 工種キー
324
                strcmd.AppendFormat(", FirstString = '{0}'", data.FirstString);                 // 項目名称名称
325
                strcmd.AppendFormat(", SecondString = '{0}'", data.SecondString);               // 工事内容
324
                strcmd.AppendFormat(", FirstString = {0}", SeparateString(data.FirstString));   // 項目名称名称
325
                strcmd.AppendFormat(", SecondString = {0}", SeparateString(data.SecondString)); // 工事内容
326 326
                strcmd.AppendFormat(", CompanyType = {0}", data.CompanyType);                   // 協力会社コードタイプ
327 327
                strcmd.AppendFormat(", CompanyCode = {0}", data.CompanyCode);                   // 協力会社コード
328
                strcmd.AppendFormat(", CompanyName = '{0}'", data.CompanyName);                 // 協力会社名称
328
                strcmd.AppendFormat(", CompanyName = {0}", SeparateString(data.CompanyName));   // 協力会社名称
329 329
                strcmd.AppendFormat(", EstimatePrice = {0}", data.EstimatePrice);               // 見積時金額
330 330
                strcmd.AppendFormat(", NegotiationPrice = {0}", data.NegotiationPrice);         // 交渉時金額
331 331
                strcmd.AppendFormat(", OrderDesiredAmount = {0}", data.OrderDesiredAmount);     // 発注希望金額
......
407 407
                        strcmd.AppendFormat(" ItemCode = {0}", ((int)value).ToString());
408 408
                        break;
409 409
                    case (int)TableColumn.FirstString:            // 項目名称
410
                        strcmd.AppendFormat(" FirstString = '{0}'", value.ToString());
410
                        strcmd.AppendFormat(" FirstString = {0}", SeparateString(value.ToString()));
411 411
                        break;
412 412
                    case (int)TableColumn.SecondString:           // 工事内容
413
                        strcmd.AppendFormat(" SecondString = '{0}'", value.ToString());
413
                        strcmd.AppendFormat(" SecondString = {0}", SeparateString(value.ToString()));
414 414
                        break;
415 415
                    case (int)TableColumn.CompanyType:            // 協力会社コードタイプ
416 416
                        strcmd.AppendFormat(" CompanyType = {0}", ((int)value).ToString());
......
419 419
                        strcmd.AppendFormat(" CompanyCode = {0}", ((int)value).ToString());
420 420
                        break;
421 421
                    case (int)TableColumn.CompanyName:            // 協力会社名称
422
                        strcmd.AppendFormat(" CompanyName = '{0}'", value.ToString());
422
                        strcmd.AppendFormat(" CompanyName = {0}", SeparateString(value.ToString()));
423 423
                        break;
424 424
                    case (int)TableColumn.EstimatePrice:          // 見積時金額
425 425
                        strcmd.AppendFormat(" EstimatePrice = {0}", ((double)value).ToString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs
215 215

  
216 216
                strcmd.AppendFormat(", {0}", work.ConstructionPeriod);              // 事業期
217 217
                strcmd.AppendFormat(", {0}", work.CreatorCode);                     // 作成者コード
218
                strcmd.AppendFormat(",'{0}'", work.CreatorName);                    // 作成者名
218
                strcmd.AppendFormat(", {0}", SeparateString(work.CreatorName));     // 作成者名
219 219
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
220
                                        work.CreateDate.ToShortDateString());           // 作成日
220
                                        work.CreateDate.ToShortDateString());       // 作成日
221 221
                strcmd.AppendFormat(", {0}", work.ConstructionTimes);               // 工期(単位・月)
222 222
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
223 223
                                        work.ConstructionStart.ToShortDateString());    // 契約工期開始
......
284 284

  
285 285
                    strcmd.AppendFormat(", {0}", work.ConstructionPeriod);              // 事業期
286 286
                    strcmd.AppendFormat(", {0}", work.CreatorCode);                     // 作成者コード
287
                    strcmd.AppendFormat(",'{0}'", work.CreatorName);                    // 作成者名
287
                    strcmd.AppendFormat(", {0}", SeparateString(work.CreatorName));     // 作成者名
288 288
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
289
                                            work.CreateDate.ToShortDateString());           // 作成日
289
                                            work.CreateDate.ToShortDateString());       // 作成日
290 290
                    strcmd.AppendFormat(", {0}", work.ConstructionTimes);               // 工期(単位・月)
291 291
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')",
292 292
                                            work.ConstructionStart.ToShortDateString());    // 契約工期開始
......
344 344

  
345 345
                strcmd.AppendFormat(", ConstructionPeriod = {0}", data.ConstructionPeriod);     // 事業期
346 346
                strcmd.AppendFormat(", CreatorCode = {0}", data.CreatorCode);                   // 作成者コード
347
                strcmd.AppendFormat(", CreatorName = '{0}'", data.CreatorName);                 // 作成者名
347
                strcmd.AppendFormat(", CreatorName = {0}", SeparateString(data.CreatorName));   // 作成者名
348 348
                strcmd.AppendFormat(", CreateDate = STR_TO_DATE('{0}','%Y/%m/%d')",
349
                                                        data.CreateDate.ToShortDateString());       // 作成日
349
                                                        data.CreateDate.ToShortDateString());   // 作成日
350 350
                strcmd.AppendFormat(", ConstructionTimes = {0}", data.ConstructionTimes);       // 工期(単位・月)
351 351
                strcmd.AppendFormat(", ConstructionStart = STR_TO_DATE('{0}','%Y/%m/%d')",
352 352
                                                        data.ConstructionStart.ToShortDateString());// 契約工期開始
......
437 437
                        strcmd.AppendFormat(" CreatorCode = {0}", ((int)value).ToString());
438 438
                        break;
439 439
                    case (int)TableColumn.CreatorName:    	        // 作成者名
440
                        strcmd.AppendFormat(" CreatorName = '{0}'", value.ToString());
440
                        strcmd.AppendFormat(" CreatorName = {0}", SeparateString(value.ToString()));
441 441
                        break;
442 442
                    case (int)TableColumn.CreateDate:	            // 作成日
443 443
                        strcmd.AppendFormat(" CreateDate = STR_TO_DATE('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs
78 78

  
79 79
        #endregion
80 80

  
81
        #region テーブルのフィールドリストを作成する
82
        /// <summary>
83
        /// テーブルのフィールドリストを作成する
84
        /// </summary>
85
        /// <returns></returns>
86
        public static string CreateFieldNameList(string strAlias = "")
87
        {
88
            StringBuilder strcmd = new StringBuilder();
89
            try
90
            {
91
                strcmd.Append(" ");
92
                bool bColFirst = true;
93
                string strWork = string.Empty;
94
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
95
                {
96
                    strWork = gender.ToString();
97
                    if (!bColFirst) strcmd.Append(",");
98
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
99
                    {
100
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d %H:%i:%s') As {1}", strAlias, strWork);
101
                    }
102
                    else
103
                    {
104
                        strcmd.AppendFormat(" {0}{1}", strAlias, strWork);
105
                    }
106
                    bColFirst = false;
107
                }
108

  
109
                return strcmd.ToString();
110
            }
111
            catch (Exception ex)
112
            {
113
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
114
                return string.Empty;
115
            }
116
        }
117
        #endregion
118

  
81 119
        #region SELECT SQL作成
82 120
        /// <summary>
83 121
        /// SQL作成
......
85 123
        private string CreateSelectSQL()
86 124
        {
87 125
            StringBuilder strcmd = new StringBuilder();
88
            strcmd.Append("SELECT");
126
            try
127
            {
128
                strcmd.AppendFormat("SELECT {0} FROM ConstructionLedgerDetail", CreateFieldNameList());
89 129

  
90
            bool bColFirst = true;
91
            string strWork = string.Empty;
92
            foreach (var gender in Enum.GetValues(typeof(TableColumn)))
130
                return strcmd.ToString();
131
            }
132
            catch (Exception ex)
93 133
            {
94
                strWork = gender.ToString();
95
                if (!bColFirst) strcmd.Append(",");
96
                if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
97
                {
98
                    strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
99
                }
100
                else
101
                {
102
                    strcmd.AppendFormat(" {0}", strWork);
103
                }
104
                bColFirst = false;
134
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
135
                return string.Empty;
105 136
            }
106

  
107
            strcmd.Append(" FROM ConstructionLedgerDetail");
108

  
109
            return strcmd.ToString();
110 137
        }
111 138
        #endregion
112 139

  
......
213 240
                strcmd.AppendFormat(", {0}", work.LineCount);               // 行番号
214 241
                strcmd.AppendFormat(", {0}", work.ComponentCode);           // 構成キー
215 242
                strcmd.AppendFormat(", {0}", work.ItemCode);		        // 工種キー
216
                strcmd.AppendFormat(",'{0}'", work.FirstString);            // 項目名称
217
                strcmd.AppendFormat(",'{0}'", work.SecondString);           // 工事内容
243
                strcmd.AppendFormat(", {0}", SeparateString(work.FirstString));     // 項目名称
244
                strcmd.AppendFormat(", {0}", SeparateString(work.SecondString));    // 工事内容
218 245
                strcmd.AppendFormat(", {0}", work.CompanyType);             // 協力会社コードタイプ
219 246
                strcmd.AppendFormat(", {0}", work.CompanyCode);             // 協力会社コード
220
                strcmd.AppendFormat(",'{0}'", work.CompanyName);            // 協力会社名称
247
                strcmd.AppendFormat(", {0}", SeparateString(work.CompanyName));     // 協力会社名称
221 248
                strcmd.AppendFormat(", {0}", work.EstimatePrice);           // 予算(見積)金額
222 249
                strcmd.AppendFormat(", {0}", work.ExecutionAmount);         // 実行金額
223 250
                strcmd.AppendFormat(", {0}", work.AmountConfigRate);        // 金額構成率
......
287 314
                    strcmd.AppendFormat(", {0}", work.LineCount);               // 行番号
288 315
                    strcmd.AppendFormat(", {0}", work.ComponentCode);           // 構成キー
289 316
                    strcmd.AppendFormat(", {0}", work.ItemCode);		        // 工種キー
290
                    strcmd.AppendFormat(",'{0}'", work.FirstString);            // 項目名称
291
                    strcmd.AppendFormat(",'{0}'", work.SecondString);           // 工事内容
317
                    strcmd.AppendFormat(", {0}", SeparateString(work.FirstString));     // 項目名称
318
                    strcmd.AppendFormat(", {0}", SeparateString(work.SecondString));    // 工事内容
292 319
                    strcmd.AppendFormat(", {0}", work.CompanyType);             // 協力会社コードタイプ
293 320
                    strcmd.AppendFormat(", {0}", work.CompanyCode);             // 協力会社コード
294
                    strcmd.AppendFormat(",'{0}'", work.CompanyName);            // 協力会社名称
321
                    strcmd.AppendFormat(", {0}", SeparateString(work.CompanyName));     // 協力会社名称
295 322
                    strcmd.AppendFormat(", {0}", work.EstimatePrice);           // 予算(見積)金額
296 323
                    strcmd.AppendFormat(", {0}", work.ExecutionAmount);         // 実行金額
297 324
                    strcmd.AppendFormat(", {0}", work.AmountConfigRate);        // 金額構成率
......
352 379
                strcmd.AppendFormat(", LineCount = {0}", data.LineCount);                       // 行番号
353 380
                strcmd.AppendFormat(", ComponentCode = {0}", data.ComponentCode);               // 構成キー
354 381
                strcmd.AppendFormat(", ItemCode = {0}", data.ItemCode);		                    // 工種キー
355
                strcmd.AppendFormat(", FirstString = '{0}'", data.FirstString);                 // 項目名称名称
356
                strcmd.AppendFormat(", SecondString = '{0}'", data.SecondString);               // 工事内容
382
                strcmd.AppendFormat(", FirstString = {0}", SeparateString(data.FirstString));   // 項目名称名称
383
                strcmd.AppendFormat(", SecondString = {0}", SeparateString(data.SecondString)); // 工事内容
357 384
                strcmd.AppendFormat(", CompanyType = {0}", data.CompanyType);                   // 協力会社コードタイプ
358 385
                strcmd.AppendFormat(", CompanyCode = {0}", data.CompanyCode);                   // 協力会社コード
359
                strcmd.AppendFormat(", CompanyName = '{0}'", data.CompanyName);                 // 協力会社名称
386
                strcmd.AppendFormat(", CompanyName = {0}", SeparateString(data.CompanyName));   // 協力会社名称
360 387
                strcmd.AppendFormat(", EstimatePrice = {0}", data.EstimatePrice);               // 予算(見積)金額
361 388
                strcmd.AppendFormat(", ExecutionAmount = {0}", data.ExecutionAmount);           // 実行金額
362 389
                strcmd.AppendFormat(", AmountConfigRate = {0}", data.AmountConfigRate);         // 金額構成率
......
561 588
                        strcmd.AppendFormat(" ItemCode = {0}", ((int)value).ToString());
562 589
                        break;
563 590
                    case (int)TableColumn.FirstString:           // 項目名称
564
                        strcmd.AppendFormat(" FirstString = '{0}'", value.ToString());
591
                        strcmd.AppendFormat(" FirstString = {0}", SeparateString(value.ToString()));
565 592
                        break;
566 593
                    case (int)TableColumn.SecondString:          // 工事内容
567
                        strcmd.AppendFormat(" SecondString = '{0}'", value.ToString());
594
                        strcmd.AppendFormat(" SecondString = {0}", SeparateString(value.ToString()));
568 595
                        break;
569 596
                    case (int)TableColumn.CompanyType:           // 協力会社コードタイプ
570 597
                        strcmd.AppendFormat(" CompanyType = {0}", ((int)value).ToString());
......
573 600
                        strcmd.AppendFormat(" CompanyCode = {0}", ((int)value).ToString());
574 601
                        break;
575 602
                    case (int)TableColumn.CompanyName:           // 協力会社名称
576
                        strcmd.AppendFormat(" CompanyName = '{0}'", value.ToString());
603
                        strcmd.AppendFormat(" CompanyName = {0}", SeparateString(value.ToString()));
577 604
                        break;
578 605
                    case (int)TableColumn.EstimatePrice:         // 予算(見積)金額
579 606
                        strcmd.AppendFormat(" EstimatePrice = {0}", ((int)value).ToString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs
75 75

  
76 76
        #endregion
77 77

  
78
        #region テーブルのフィールドリストを作成する
79
        /// <summary>
80
        /// テーブルのフィールドリストを作成する
81
        /// </summary>
82
        /// <returns></returns>
83
        public static string CreateFieldNameList(string strAlias = "")
84
        {
85
            StringBuilder strcmd = new StringBuilder();
86
            try
87
            {
88
                strcmd.Append(" ");
89
                bool bColFirst = true;
90
                string strWork = string.Empty;
91
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
92
                {
93
                    strWork = gender.ToString();
94
                    if (!bColFirst) strcmd.Append(",");
95
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
96
                    {
97
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d %H:%i:%s') As {1}", strAlias, strWork);
98
                    }
99
                    else if (strWork.Equals("TargetMonth"))
100
                    {
101
                        strcmd.AppendFormat(" DATE({0}{1}) As {1}", strAlias, strWork);
102
                    }
103
                    else
104
                    {
105
                        strcmd.AppendFormat(" {0}{1}", strAlias, strWork);
106
                    }
107
                    bColFirst = false;
108
                }
109

  
110
                return strcmd.ToString();
111
            }
112
            catch (Exception ex)
113
            {
114
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
115
                return string.Empty;
116
            }
117
        }
118
        #endregion
119

  
78 120
        #region SELECT SQL作成
79 121
        /// <summary>
80 122
        /// SQL作成
81 123
        /// </summary>
82 124
        private string CreateSelectSQL()
83 125
        {
84
            // SQL作成
85 126
            StringBuilder strcmd = new StringBuilder();
127
            try
128
            {
129
                strcmd.AppendFormat("SELECT {0} FROM ConstructionLedgerExcute", CreateFieldNameList());
86 130

  
87
            strcmd.Append("SELECT");
88
            strcmd.Append("  ConstructionCode");	        // 工事コード
89
            strcmd.Append(", GroupCount");               // グループ番号
90
            strcmd.Append(", LineCount");                // 行番号
91
            strcmd.Append(", ColumnCount");              // 列番号
92

  
93
            strcmd.Append(", PaymentAmount");            // 支払金額
94
            strcmd.Append(", DATE_FORMAT(TargetMonth, '%Y/%m/%d')");    // 対象年月
95

  
96
            strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
97
            strcmd.Append(", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
98
            strcmd.Append(" FROM ConstructionLedgerExcute");
99

  
100
            return strcmd.ToString();
131
                return strcmd.ToString();
132
            }
133
            catch (Exception ex)
134
            {
135
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
136
                return string.Empty;
137
            }
101 138
        }
102 139
        #endregion
103 140

  
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOCostDataOfCompensation.cs
42 42
            FromCodeType,       // 相手先コードタイプ
43 43
            FromCode,           // 相手先コード
44 44
            SendDate,           // 対象日付
45
            LinkCode,           // リンク先工事コード
45 46
            EntryPrice,         // 金額(税抜)
46 47
            EntryTax,           // 金額(税込)
47 48
            Content,            // 支払内容
......
64 65

  
65 66
        #endregion
66 67

  
68
        #region テーブルのフィールドリストを作成する
69
        /// <summary>
70
        /// テーブルのフィールドリストを作成する
71
        /// </summary>
72
        /// <returns></returns>
73
        public static string CreateFieldNameList(string strAlias = "")
74
        {
75
            StringBuilder strcmd = new StringBuilder();
76
            try
77
            {
78
                strcmd.Append(" ");
79
                bool bColFirst = true;
80
                string strWork = string.Empty;
81
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
82
                {
83
                    strWork = gender.ToString();
84
                    if (!bColFirst) strcmd.Append(",");
85
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
86
                    {
87
                        strcmd.AppendFormat(" DATE_FORMAT({0}{1}, '%Y/%m/%d %H:%i:%s') As {1}", strAlias, strWork);
88
                    }
89
                    else if (strWork.Equals("SendDate"))
90
                    {
91
                        strcmd.AppendFormat(" DATE({0}{1}) As {1}", strAlias, strWork);
92
                    }
93
                    else
94
                    {
95
                        strcmd.AppendFormat(" {0}{1}", strAlias, strWork);
96
                    }
97
                    bColFirst = false;
98
                }
99

  
100
                return strcmd.ToString();
101
            }
102
            catch (Exception ex)
103
            {
104
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
105
                return string.Empty;
106
            }
107
        }
108
        #endregion
109

  
67 110
        #region SQL作成
68 111
        /// <summary>
69 112
        /// SQL作成
70 113
        /// </summary>
71 114
        private string CreateSelectSQL()
72 115
        {
73
            // SQL作成
74 116
            StringBuilder strcmd = new StringBuilder();
75
            strcmd.Append("SELECT");
117
            try
118
            {
119
                strcmd.AppendFormat("SELECT {0} FROM CostDataOfCompensation", CreateFieldNameList());
76 120

  
77
            bool bColFirst = true;
78
            string strWork = string.Empty;
79
            foreach (var gender in Enum.GetValues(typeof(TableColumn)))
121
                return strcmd.ToString();
122
            }
123
            catch (Exception ex)
80 124
            {
81
                strWork = gender.ToString();
82
                if (!bColFirst) strcmd.Append(",");
83
                if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
84
                {
85
                    strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
86
                }
87
                else if (strWork.Equals("SendDate"))
88
                {
89
                    strcmd.AppendFormat(" DATE({0})", strWork);
90
                }
91
                else
92
                {
93
                    strcmd.AppendFormat(" {0}", strWork);
94
                }
95
                bColFirst = false;
125
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
126
                return string.Empty;
96 127
            }
97

  
98
            strcmd.Append(" FROM CostDataOfCompensation");
99

  
100
            return strcmd.ToString();
101 128
        }
102 129
        #endregion
103 130

  
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

他の形式にエクスポート: Unified diff