プロジェクト

全般

プロフィール

リビジョン 15

堀内約8年前に追加

給与自動計算実装
経費計算改修途中
バグ改修複数

差分を表示:

trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs
698 698
                                                                                    {12,"ConstructionPeriodEnd"},
699 699
                                                                                    {13,"BillingStartDate"},
700 700
                                                                                    {14,"BillingDate"},
701
                                                                                    {15,"ConstrPreparationDate"},   // 2016/10/07 追加
701 702
                                                                                };
702 703
        /// <summary>
703 704
        /// 工事基本情報日付項目名称テーブル
......
709 710
                                                                                    {"OrderDate","受注日"},
710 711
                                                                                    {"OrderStartingDate","開始予定日"},
711 712
                                                                                    {"OrderCompletionDate","完了予定日"},
713
                                                                                    {"ConstrPreparationDate","施工開始準備日"},
712 714
                                                                                    {"ConstructionStartingDate","施工開始日"},
713 715
                                                                                    {"ConstructionCompletionDate","施工完了日"},
714 716
                                                                                    {"TransferConstructionDate","工事移管日"},
......
779 781
            /// 14:請求日
780 782
            /// </summary>
781 783
            BillingDate,
784
            /// <summary>
785
            /// 15:施工開始準備日
786
            /// </summary>
787
            ConstrPreparationDate,
782 788
        }
783 789
        #endregion
784 790

  
......
844 850
        public enum BaseInfoBillingSplitFlg
845 851
        {
846 852
            /// <summary>
847
            /// 0:分割請求
853
            /// 0:一括請求
848 854
            /// </summary>
849
            SplitBilling = 0,
855
            AllOnBilling = 0,
850 856
            /// <summary>
851
            /// 1:一括請求
857
            /// 1:分割請求
852 858
            /// </summary>
853
            AllOnBilling,
859
            SplitBilling,
854 860
        }
855 861
        #endregion
856 862

  
......
1046 1052
        /// 工数単位日数
1047 1053
        /// </summary>
1048 1054
        public static double s_ManHourUnitDays = 3.0;
1055
        public static double s_ManHourUnitMonth = 30.0;
1049 1056
        #endregion
1050 1057

  
1051 1058
        #region 1カ月の稼働日
......
1055 1062
        public static int s_WorkingDaysOfMonth = 25;
1056 1063
        #endregion
1057 1064

  
1058
        #region 残業係数
1065
        #region 出勤補正値係数
1059 1066
        /// <summary>
1060
        /// 残業係数
1067
        /// 出勤補正値係数
1061 1068
        /// </summary>
1062 1069
        public static double s_SalaryExpenses = 1.1;
1063 1070
        #endregion
......
1275 1282
        }
1276 1283
        #endregion
1277 1284

  
1278
        #region 工事詳細台帳データ作成工事種別
1279
        /// <summary>
1280
        /// 工事詳細台帳データ作成工事種別
1281
        /// </summary>
1282
        public static int[] s_CreateLedgerData = new int[] { 6 };
1283
        #endregion
1284

  
1285 1285
        #region 工事基本情報:紐付データフラグ
1286 1286
        public enum BaseInfoTyingFlg
1287 1287
        {
......
1299 1299
            Tying,
1300 1300
        }
1301 1301
        #endregion
1302

  
1303
        #region 工事詳細台帳:担当中フラグ
1304
        /// <summary>
1305
        /// 担当中フラグ
1306
        /// </summary>
1307
        public enum SalaryOperateKind
1308
        {
1309
            /// <summary>
1310
            /// 担当終了
1311
            /// </summary>
1312
            Complate = 0,
1313
            /// <summary>
1314
            /// 担当中
1315
            /// </summary>
1316
            Oparateing,
1317
        }
1318
        #endregion
1319

  
1320
        #region 台帳入力完了フラグ
1321
        /// <summary>
1322
        /// 台帳入力完了フラグ
1323
        /// </summary>
1324
        public enum ComplateTitleNo
1325
        {
1326
            /// <summary>
1327
            /// 台 帳 入 力 中
1328
            /// </summary>
1329
            Operateing = 0,
1330
            /// <summary>
1331
            /// 完 了 済 台 帳
1332
            /// </summary>
1333
            Complated,
1334
        }
1335
        #endregion
1302 1336
    }
1303 1337
}
trunk/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs
323 323
            IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
324 324
            try
325 325
            {
326
                int StatusCode = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("非 受 注")).Key;
327

  
328
                string strSQL = "SELECT A.CONSTRUCTIONPERIOD FROM CONSTRUCTIONBASEINFO A";
329
                strSQL += string.Format(" WHERE A.CONSTRUCTIONSTATUSFLG <> {0}", StatusCode);
330
                strSQL += " GROUP BY A.CONSTRUCTIONPERIOD";
331

  
326
                string strSQL = "SELECT MIN(CONSTRUCTIONPERIOD), MAX(CONSTRUCTIONPERIOD) FROM CONSTRUCTIONBASEINFO";
332 327
                ArrayList arList = new ArrayList();
333 328
                if (!cbiDB.ExecuteReader(strSQL, ref arList)) return;
329
                object[] wrkobj = (object[])arList[0];
330
                min = cnvInt(wrkobj[0]);
331
                max = cnvInt(wrkobj[1]);
334 332

  
335
                int[] iNumber = new int[arList.Count];
336
                int i = 0;
337
                foreach (object[] wrkobj in arList)
338
                {
339
                    iNumber[i++] = CommonMotions.cnvInt(wrkobj[0].ToString());
340
                }
341
                min = iNumber.Min();
342
                max = iNumber.Max();
343 333
            }
344 334
            catch (Exception ex)
345 335
            {
......
1949 1939
        public static double DiffMounthTimes(DateTime StartDate, DateTime CompDate)
1950 1940
        {
1951 1941
            // 差分計算
1952
            TimeSpan DiffDate = CompDate.Subtract(StartDate);
1942
            TimeSpan DiffDate = CompDate - StartDate;
1953 1943
            // 当日までなので+1日する
1954 1944
            TimeSpan wrkts = new TimeSpan(1, 0, 0, 0);
1955 1945
            DiffDate = DiffDate + wrkts;
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsCalendar.cs
38 38
        /// <summary>
39 39
        /// 指定期間内の稼働日数を返す
40 40
        /// </summary>
41
        /// <param name="startdate"></param>
41
        /// <param name="Startdate"></param>
42 42
        /// <param name="Complatedate"></param>
43 43
        /// <returns></returns>
44
        public static int CalcWorkingDaysCount(DateTime startdate, DateTime Complatedate)
44
        public static int CalcOperatingDaysCount(DateTime Startdate, DateTime Complatedate)
45 45
        {
46 46
            try
47 47
            {
48 48
                // 休日数を求める
49
                int Holidays = CalcHoliDaysCount(startdate, Complatedate);
49
                int Holidays = CalcHoliDaysCount(Startdate, Complatedate);
50 50
                // 経過日数を求める
51
                TimeSpan Elapsedays = Complatedate - startdate;
52
                // 計算では当日の時間まで出るので+1する
51
                TimeSpan Elapsedays = Complatedate.Date - Startdate.Date;
52
                // 計算では当日の時間引くので+1する
53 53
                int workdays = (int)(Elapsedays.TotalDays + 1.0);
54 54

  
55
                return workdays - Holidays;
55
                return (workdays - Holidays);
56 56
            }
57 57
            catch (Exception ex)
58 58
            {
......
66 66
        /// <summary>
67 67
        /// 指定期間内の休日日数を返す
68 68
        /// </summary>
69
        /// <param name="startdate"></param>
70
        /// <param name="Complatedate"></param>
69
        /// <param name="Startdate">開始日</param>
70
        /// <param name="Complatedate">終了日</param>
71 71
        /// <returns></returns>
72
        public static int CalcHoliDaysCount(DateTime startdate, DateTime Complatedate)
72
        public static int CalcHoliDaysCount(DateTime Startdate, DateTime Complatedate)
73 73
        {
74 74
            IOMHolidayCalender calDB = new IOMHolidayCalender();
75 75
            try
......
77 77
                int Holidays = 0;
78 78

  
79 79
                string strSQL = "SELECT COUNT(*) FROM HOLIDAYCALENDERMASTER";
80
                strSQL += string.Format(" WHERE TO_DATE('{0}','YYYY/MM/DD') <= HOLIDAY", startdate.ToShortDateString());
80
                strSQL += string.Format(" WHERE TO_DATE('{0}','YYYY/MM/DD') <= HOLIDAY", Startdate.ToShortDateString());
81 81
                strSQL += string.Format(" AND HOLIDAY <= TO_DATE('{0}','YYYY/MM/DD')", Complatedate.ToShortDateString());
82 82

  
83 83
                ArrayList datalist = new ArrayList();
......
101 101
            }
102 102
        }
103 103
        #endregion
104

  
105
        #region 指定期間内の経過日数を返す
106
        /// <summary>
107
        /// 指定期間内の経過日数を返す
108
        /// </summary>
109
        /// <param name="startdate">開始日</param>
110
        /// <param name="Complatedate">終了日</param>
111
        /// <returns></returns>
112
        public static int CalcPassedDaysCount(DateTime Startdate, DateTime Complatedate)
113
        {
114
            try
115
            {
116
                DateTime sdate = Startdate.Date;
117
                DateTime cdate = Complatedate.Date;
118

  
119
                TimeSpan ts = cdate - sdate;
120

  
121
                return (ts.Days + 1);
122
            }
123
            catch (Exception ex)
124
            {
125
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
126
                return 0;
127
            }
128
        }
129
        #endregion
130

  
131
        //#region 指定期間内の経過日数を1人月を上限に返す
132
        ///// <summary>
133
        ///// 指定期間内の経過日数を1人月を上限に返す
134
        ///// </summary>
135
        ///// <param name="startdate">開始日</param>
136
        ///// <param name="Complatedate">終了日</param>
137
        ///// <returns></returns>
138
        //public static int CalcPassedDaysCountToUnit(DateTime Startdate, DateTime Complatedate)
139
        //{
140
        //    try
141
        //    {
142
        //        int passDay = CalcPassedDaysCount(Startdate, Complatedate);
143

  
144
        //        int OneMonth = (int)(CommonDefine.s_ManHourUnitDays * 10.0);
145

  
146
        //        //if (passDay > OneMonth) passDay = OneMonth;
147

  
148
        //        return passDay;
149
        //    }
150
        //    catch (Exception ex)
151
        //    {
152
        //        logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
153
        //        return 0;
154
        //    }
155
        //}
156
        //#endregion
104 157
    }
105 158
}
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs
88 88
                // 見積有効期限切れを非受注へ移行する
89 89
                ChangeNonOrdersData();
90 90

  
91
                // 工事詳細台帳の給与を加算する
92
                CalculateDaysSalary();
93

  
91 94
                // 日付の更新
92 95
                UpDateTargetDate();
93 96
            }
......
243 246
            {
244 247
                // 工事基本情報を期限テーブルに設定している状態分取得する
245 248
                string strSQL = " WHERE CONSTRUCTIONSTATUSFLG IN (SELECT DISTINCT CONSTRUCTIONSTATUSFLG FROM TERMMASTER)";
246
                strSQL = " ORDER BY CONSTRUCTIONSTATUSFLG ASC";
249
                strSQL = " ORDER BY CONSTRUCTIONSTATUSFLG ASC, CONSTRUCTIONCODE ASC";
247 250
                List<ConstructionBaseInfo> cbiList = new List<ConstructionBaseInfo>();
248 251
                if (!cbiDB.SelectAction(strSQL, ref cbiList)) return;
249 252

  
250 253
                // 経過日数を取得する
251 254
                TimeSpan ts = DateTime.Now - StartDate;
252 255
                int diffDays = ts.Days;
253
                // 10日を超えたら当日だけチェックする
256
                // チェック範囲が10日を超えたら当日だけチェックする
254 257
                if (diffDays > 10)
255 258
                {
256 259
                    diffDays = 1;
......
266 269
                        string sErrorMessage = string.Empty;
267 270
                        string sBackColor = string.Empty;
268 271
                        string sForeColor = string.Empty;
272
                        // 増減工事の子は処理しない
273
                        if (wrkRec.TyingFlg == (int)CommonDefine.BaseInfoTyingFlg.Tying) continue;
269 274
                        // チェック
270 275
                        ConstructionStatusCheck(wrkRec, CriteriaDate, ref sErrorMessage, ref sBackColor, ref sForeColor);
271 276
                    }
......
305 310
                // 戻り値
306 311
                bool bCheckPass = true;
307 312

  
308
                // 初期化に失敗したら処理しない
313
                // 初期化に失敗していたら処理しない
309 314
                if (!m_bExecuteFlg) return false;
310 315

  
311 316
                TermMaster TermRec = new TermMaster();
312 317

  
313
                // 状態の存在チェック
318
                // 取得データの進捗状態がチェック判定テーブルにあるかの存在チェック
314 319
                bool exestFlg = false;
315 320
                int itblCnt = 0;
316 321
                for (int i = 0; i < m_arrayList.Count; i++)
......
322 327
                        break;
323 328
                    }
324 329
                }
325

  
330
                // 取得データがチェック判定以外は処理しない
326 331
                if (!exestFlg) return bCheckPass;
327 332

  
328 333
                List<TermMaster> Termtbl = m_arrayList[itblCnt].TermMstTBL;
......
353 358
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.OrderCompletionDate:         // 完了予定日
354 359
                            Target = checkRec.OrderCompletionDate;
355 360
                            break;
361
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.ConstrPreparationDate:       // 施工開始準備日
362
                            Target = checkRec.PreparationStartDate;
363
                            break;
356 364
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.ConstructionStartingDate:    // 施工開始日
357 365
                            Target = checkRec.ConstructionStartingDate;
358 366
                            break;
......
370 378
                            break;
371 379
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.ConstructionPeriodEnd:       // 契約工期完了
372 380
                            Target = checkRec.ConstructionPeriodEnd;
381
                            // 延長工期があれば延長工期を入れる
382
                            if (checkRec.ConstructionPeriodEnd2 != DateTime.MinValue) Target = checkRec.ConstructionPeriodEnd2;
373 383
                            break;
374 384
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.BillingStartDate:            // 請求準備開始日
375 385
                            Target = checkRec.BillingStartDate;
376 386
                            break;
377 387
                        case (int)CommonDefine.ConstructionBaseInfo_DateNo.BillingDate:                 // 請求日
378 388
                            Target = checkRec.BillingDate;
389
                            // 2016/10/06 台帳入力完了日があればチェックをしない 
390
                            if (checkRec.LedgerComplateDate != DateTime.MinValue) Target = DateTime.MinValue.Date;
379 391
                            break;
380 392
                    }
381 393
                    // 未定の日付はチェックしない
......
596 608
            }
597 609
        }
598 610
        #endregion
611

  
612
        #region 工事詳細台帳の給与を加算する
613
        /// <summary>
614
        /// 工事詳細台帳の給与を加算する
615
        /// </summary>
616
        private void CalculateDaysSalary()
617
        {
618
            IOConstructionLedger LedgerDB = new IOConstructionLedger();
619
            try
620
            {
621
                // 入力完了以外を対象にする
622
                string strSQL = " WHERE ComplateFlg <> 1 ORDER BY ConstructionStart ASC";
623
                List<ConstructionLedger> LedgerList = new List<ConstructionLedger>();
624
                // エラーもしくはデータが無い場合は処理しない
625
                if (!LedgerDB.SelectAction(strSQL, ref LedgerList) || LedgerList.Count == 0) return;
626

  
627
                foreach (ConstructionLedger CurRec in LedgerList)
628
                {
629
                    // 当日が範囲外ならば処理しない
630
                    if (DateTime.Now < CurRec.ConstructionStart.Date || CurRec.ConstructionEnd.Date < DateTime.Now) continue;
631
                    
632
                    // 給与を加算する
633
                    if (!ClsChangeLedgerData.CalculatePayment(CurRec.ConstructionCode, DateTime.Now, false)) break;
634
                }
635
            }
636
            catch (Exception ex)
637
            {
638
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
639
            }
640
            finally
641
            {
642
                LedgerDB.close(); LedgerDB = null;
643
            }
644
        }
645
        #endregion
599 646
    }
600 647
}
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs
78 78
            BILLINGDATE,
79 79
            BILLINGSPLITFLG,
80 80
            BILLINGSENDDATE,
81
            LEDGERCOMPLATEDATE,
81 82
            ENTRY_DATE,
82 83
            UPDATE_DATE,
83 84
        }
......
148 149
            strcmd += ", TO_CHAR(BillingDate, 'YYYY/MM/DD')";
149 150
            strcmd += ", BillingSplitFlg";
150 151
            strcmd += ", TO_CHAR(BillingSendDate, 'YYYY/MM/DD HH24:MI:ss')";
152
            strcmd += ", TO_CHAR(LedgerComplateDate, 'YYYY/MM/DD HH24:MI:ss')";
151 153
            strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
152 154
            strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
153 155
            strcmd += " FROM ConstructionBaseInfo";
......
222 224
        }
223 225
        #endregion
224 226

  
225
        #region データ追加処理
227
        #region データ追加処理(1件)
226 228
        /// <summary>
227 229
        /// 工事基本情報追加
228 230
        /// </summary>
......
234 236
            try
235 237
            {
236 238
                    strcmd = "INSERT INTO ConstructionBaseInfo";
239
                    strcmd += " (ConstructionCode";
240
                    strcmd += ", TyingFlg";
241
                    strcmd += ", ConstructionYear";
242
                    strcmd += ", ConstructionPeriod";
243
                    strcmd += ", RequestedDate";
244
                    strcmd += ", EstimatesSubmitDeadline";
245
                    strcmd += ", EstimatesSubmittedDate";
246
                    strcmd += ", ProvisionalOrderDate";
247
                    strcmd += ", OrderDate";
248
                    strcmd += ", OrderStartingDate";
249
                    strcmd += ", OrderCompletionDate";
250
                    strcmd += ", PreparationStartDate";
251
                    strcmd += ", ConstructionStartingDate";
252
                    strcmd += ", ConstructionCompletionDate";
253
                    strcmd += ", NonOrderDate";
254
                    strcmd += ", OrdersDecisionPrice";
255
                    strcmd += ", OrdersDecisionPriceInTax";
256
                    strcmd += ", SalesPersonCode";
257
                    strcmd += ", ConstructionPersonCode";
258
                    strcmd += ", ConstrSubPersonCode";
259
                    strcmd += ", ConstructionInstructor";
260
                    strcmd += ", TransferConstruction";
261
                    strcmd += ", TransferConstructionDate";
262
                    strcmd += ", OrderersDivision";
263
                    strcmd += ", OrderersCode";
264
                    strcmd += ", EstimatesExpirationDate";
265
                    strcmd += ", ConstructionPeriodStart";
266
                    strcmd += ", ConstructionPeriodEnd";
267
                    strcmd += ", ConstructionPeriodStart2";
268
                    strcmd += ", ConstructionPeriodEnd2";
269
                    strcmd += ", StartDate";
270
                    strcmd += ", EndDate";
271
                    strcmd += ", PurchaseOrderMailingDate";
272
                    strcmd += ", PurchaseOrderReturnDate";
273
                    strcmd += ", PurchaseOrderReturnCheckDate";
274
                    strcmd += ", ConsumptionTaxFlg";
275
                    strcmd += ", PrimeContractorFlg";
276
                    strcmd += ", SalesCostFlg";
277
                    strcmd += ", ConstructionStatusFlg";
278
                    strcmd += ", ConstructionType";
279
                    strcmd += ", EstimateType";
280
                    strcmd += ", BillingStartDate";
281
                    strcmd += ", BillingDate";
282
                    strcmd += ", BillingSplitFlg";
283
                    strcmd += ", BillingSendDate";
284
                    strcmd += ", LedgerComplateDate";
285
                    strcmd += ", EntryDate";
286
                    strcmd += ", UpdateDate";
237 287

  
238
                    strcmd += " VALUES (";
288
                    strcmd += ") VALUES (";
239 289

  
240 290
                    strcmd += string.Format("  {0}", data.ConstructionCode);
241 291
                    strcmd += string.Format(", {0}", data.TyingFlg);
......
291 341
                    strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.BillingDate.ToShortDateString());
292 342
                    strcmd += string.Format(", {0}", data.BillingSplitFlg);
293 343
                    strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.BillingSendDate.ToShortDateString());
344
                    strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.LedgerComplateDate.ToShortDateString());
294 345

  
295 346
                    strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
296 347
                    strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
......
306 357
                return false;
307 358
            }
308 359
        }
360
        #endregion
361

  
362
        #region データ追加処置(複数件)
309 363
        /// <summary>
310 364
        /// 工事基本情報追加
311 365
        /// </summary>
......
401 455
                strcmd += string.Format(", BillingDate = TO_DATE('{0}','YYYY/MM/DD')", data.BillingDate.ToShortDateString());
402 456
                strcmd += string.Format(", BillingSplitFlg = {0}", data.BillingSplitFlg);
403 457
                strcmd += string.Format(", BillingSendDate = TO_DATE('{0}','YYYY/MM/DD')", data.BillingSendDate.ToShortDateString());
458
                strcmd += string.Format(", LedgerComplateDate = TO_DATE('{0}','YYYY/MM/DD')", data.LedgerComplateDate.ToShortDateString());
404 459

  
405 460
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
406 461
                strcmd += AddSQLString;
......
511 566
                wrk.BillingDate = DateTime.Parse(objwrk[(int)TableColumn.BILLINGDATE].ToString());
512 567
                wrk.BillingSplitFlg = int.Parse(objwrk[(int)TableColumn.BILLINGSPLITFLG].ToString());
513 568
                wrk.BillingSendDate = DateTime.Parse(objwrk[(int)TableColumn.BILLINGSENDDATE].ToString());
569
                wrk.LedgerComplateDate = DateTime.Parse(objwrk[(int)TableColumn.LEDGERCOMPLATEDATE].ToString());
514 570

  
515 571
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.ENTRY_DATE].ToString());
516 572
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UPDATE_DATE].ToString());
......
568 624
                    case (int)TableColumn.ESTIMATESSUBMITTED_DATE:
569 625
                        strcmd += string.Format(" EstimatesSubmittedDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
570 626
                        break;
627
                    case (int)TableColumn.PROVISIONALORDERDATE:
628
                        strcmd += string.Format(" ProvisionalOrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
629
                        break;
571 630
                    case (int)TableColumn.ORDER_DATE:
572 631
                        strcmd += string.Format(" OrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
573 632
                        break;
......
577 636
                    case (int)TableColumn.ORDERCOMPLETIONDATE:
578 637
                        strcmd += string.Format(" OrderCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
579 638
                        break;
639
                    case (int)TableColumn.PREPARATIONSTARTDATE:
640
                        strcmd += string.Format(" PreparationStartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
641
                        break;
580 642
                    case (int)TableColumn.CONSTRUCTIONSTARTINGDATE:
581 643
                        strcmd += string.Format(" ConstructionStartingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
582 644
                        break;
583 645
                    case (int)TableColumn.CONSTRUCTIONCOMPLETION_DATE:
584 646
                        strcmd += string.Format(" ConstructionCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
585 647
                        break;
648
                    case (int)TableColumn.NONORDERDATE:
649
                        strcmd += string.Format(" NonOrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
650
                        break;
586 651
                    case (int)TableColumn.ORDERS_DECISION_PRICE:
587 652
                        strcmd += string.Format(" OrdersDecisionPrice = {0}", ((int)value).ToString());
588 653
                        break;
......
622 687
                    case (int)TableColumn.CONSTRUCTIONPERIODEND:
623 688
                        strcmd += string.Format(" ConstructionPeriodEnd = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
624 689
                        break;
690
                    case (int)TableColumn.CONSTRUCTIONPERIODSTART2:
691
                        strcmd += string.Format(" ConstructionPeriodStart2 = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
692
                        break;
693
                    case (int)TableColumn.CONSTRUCTIONPERIODEND2:
694
                        strcmd += string.Format(" ConstructionPeriodEnd2 = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
695
                        break;
625 696
                    case (int)TableColumn.START_DATE:
626 697
                        strcmd += string.Format(" StartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
627 698
                        break;
628 699
                    case (int)TableColumn.END_DATE:
629 700
                        strcmd += string.Format(" EndDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
630 701
                        break;
702
                    case (int)TableColumn.PURCHASEORDERMAILINGDATE:
703
                        strcmd += string.Format(" PurchaseOrderMailingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
704
                        break;
705
                    case (int)TableColumn.PURCHASEORDERRETURNDATE:
706
                        strcmd += string.Format(" PurchaseOrderReturnDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
707
                        break;
708
                    case (int)TableColumn.PURCHASEORDERRETURNCHECKDATE:
709
                        strcmd += string.Format(" PurchaseOrderReturnCheckDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
710
                        break;
631 711
                    case (int)TableColumn.CONSUMPTIONTAX_FLG:
632 712
                        strcmd += string.Format(" ConsumptionTaxFlg = {0}", ((int)value).ToString());
633 713
                        break;
......
647 727
                        strcmd += string.Format(" EstimateType = {0}", ((int)value).ToString());
648 728
                        break;
649 729
                    case (int)TableColumn.BILLINGSTARTDATE:
650
                        strcmd += string.Format(", BillingStartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
730
                        strcmd += string.Format(" BillingStartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
651 731
                        break;
652 732
                    case (int)TableColumn.BILLINGDATE:
653 733
                        strcmd += string.Format(" BillingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
......
655 735
                    case (int)TableColumn.BILLINGSPLITFLG:
656 736
                        strcmd += string.Format(" BillingSplitFlg = {0}", ((int)value).ToString());
657 737
                        break;
738
                    case (int)TableColumn.BILLINGSENDDATE:
739
                        strcmd += string.Format(" BillingSendDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
740
                        break;
741
                    case (int)TableColumn.LEDGERCOMPLATEDATE:
742
                        strcmd += string.Format(" LedgerComplateDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
743
                        break;
658 744
                }
659 745

  
660 746
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs
16 16
namespace ProcessManagement.DB.IOAccess
17 17
{
18 18
    /// <summary>
19
    /// 積算予算ページデータDBアクセス
19
    /// 工事予算書データDBアクセス
20 20
    /// </summary>
21 21
    public class IOConstructionBudget : OracleProcess
22 22
    {
......
29 29

  
30 30
        #region 定数
31 31
        /// <summary>
32
        /// 積算予算ページデータフィールド並び
32
        /// 工事予算書データフィールド並び
33 33
        /// </summary>
34 34
        public enum ConstructionBudgetColumn
35 35
        {
......
78 78

  
79 79
        #endregion
80 80

  
81
        #region パブリックメソッド
81
        #region 工事予算書データ検索SQL作成
82 82
        /// <summary>
83
        /// 積算予算ページデータ検索
83
        /// 工事予算書データ検索SQL作成
84 84
        /// </summary>
85 85
        /// <param name="AddSQLString">検索条件SQL文字列</param>
86
        /// <param name="data">積算予算ページデータデータ</param>
86
        /// <param name="data">工事予算書データ</param>
87 87
        /// <returns>true:成功 false:失敗</returns>
88 88
        private string CreateSelectSQL()
89 89
        {
......
118 118

  
119 119
            return strcmd;
120 120
        }
121
        #endregion
122

  
123
        #region 工事予算書データ複数件検索
124
        /// <summary>
125
        /// 工事予算書データ複数件検索
126
        /// </summary>
127
        /// <param name="AddSQLString"></param>
128
        /// <param name="data"></param>
129
        /// <param name="bConnect"></param>
130
        /// <returns></returns>
121 131
        public bool SelectAction(string AddSQLString, ref List<ConstructionBudget> data, bool bConnect = true)
122 132
        {
123 133
            //Oracle インターフェース
......
148 158
                return false;
149 159
            }
150 160
        }
161
        #endregion
151 162

  
163
        #region 工事予算書データ1件検索
164
        /// <summary>
165
        /// 工事予算書データ1件検索
166
        /// </summary>
167
        /// <param name="AddSQLString"></param>
168
        /// <param name="data"></param>
169
        /// <param name="bConnect"></param>
170
        /// <returns></returns>
152 171
        public bool SelectAction(string AddSQLString, ref ConstructionBudget data, bool bConnect = true)
153 172
        {
154 173
            //Oracle インターフェース
......
179 198
                return false;
180 199
            }
181 200
        }
201
        #endregion
182 202

  
203
        #region 工事予算書データ1件追加
183 204
        /// <summary>
184
        /// 積算予算ページデータ追加
205
        /// 工事予算書データ1件追加
185 206
        /// </summary>
186
        /// <param name="data">積算予算ページデータデータ</param>
207
        /// <param name="data">工事予算書データ</param>
187 208
        /// <returns>true:成功 false:失敗</returns>
188 209
        public bool InsertAction(ConstructionBudget work, bool bConnect = true)
189 210
        {
......
192 213
            {
193 214

  
194 215
                strcmd = "INSERT INTO ConstructionBudget";
216
                strcmd += "(ConstructionCode";                          // 工事番号
217
                strcmd += " ,CreatorCode";                              // 作成者コード
218
                strcmd += " ,CreatorName";    	                        // 作成者名
219
                strcmd += " ,CreatorCosts";	                            // 作成者給与
220
                strcmd += " ,AssistantCode";                            // 副担当者コード
221
                strcmd += " ,AssistantName";                            // 副担当者名
222
                strcmd += " ,AssistantCosts";                           // 副担当者給与
223
                strcmd += " ,InstructorCode";	                        // 工事指導員コード
224
                strcmd += " ,InstructorName";	                        // 工事指導員名
225
                strcmd += " ,InstructorCosts";                          // 工事指導員給与
226
                strcmd += " ,CreateDate";	                            // 作成日
227
                strcmd += " ,ConstructionTimes";	                    // 工期(単位・月)
228
                strcmd += " ,ConstructionStart";                        // 契約工期開始
229
                strcmd += " ,ConstructionEnd";                          // 契約工期完了
230
                strcmd += " ,InstructorTimes";                          // 指導員稼働月数
231
                strcmd += " ,SalaryFlg";                                // 給与振分区分
232
                strcmd += " ,SalaryDays";                               // 振分日数
233
                strcmd += " ,A_SalaryFlg";                              // 副担当者給与振分区分
234
                strcmd += " ,A_SalaryDays";                             // 副担当者振分日数
235
                strcmd += " ,I_SalaryFlg";                              // 指導員給与振分区分
236
                strcmd += " ,I_SalaryDays";                             // 指導員振分日数
237
                strcmd += " ,EntryDate";
238
                strcmd += " ,UpdateDate)";
195 239

  
196 240
                strcmd += " VALUES (";
197 241

  
......
239 283
                return false;
240 284
            }
241 285
        }
286
        #endregion
242 287

  
288
        #region 工事予算書データ複数件追加
243 289
        /// <summary>
244
        /// 積算予算ページデータ追加
290
        /// 工事予算書データ複数件追加
245 291
        /// </summary>
246
        /// <param name="data">積算予算ページデータデータ</param>
292
        /// <param name="data">工事予算書データ</param>
247 293
        /// <returns>true:成功 false:失敗</returns>
248 294
        public bool InsertAction(List<ConstructionBudget> data, bool bConnect = true)
249 295
        {
......
263 309
                return false;
264 310
            }
265 311
        }
312
        #endregion
266 313

  
314
        #region 工事予算書データ更新
267 315
        /// <summary>
268
        /// 積算予算ページデータ更新
316
        /// 工事予算書データ更新
269 317
        /// </summary>
270 318
        /// <param name="AddSQLString">更新条件SQL文字列</param>
271
        /// <param name="data">積算予算ページデータデータ</param>
319
        /// <param name="data">工事予算書データ</param>
272 320
        /// <returns>true:成功 false:失敗</returns>
273 321
        public bool UpdateAction(string AddSQLString, ConstructionBudget data, bool bConnect = true)
274 322
        {
......
323 371
                return false;
324 372
            }
325 373
        }
374
        #endregion
326 375

  
327

  
376
        #region 工事予算書データ削除
328 377
        /// <summary>
329
        /// 積算予算ページデータ削除
378
        /// 工事予算書データ削除
330 379
        /// </summary>
331 380
        /// <param name="AddSQLString">削除条件SQL文字列</param>
332
        /// <param name="data">積算予算ページデータデータ</param>
381
        /// <param name="data">工事予算書データ</param>
333 382
        /// <returns>true:成功 false:失敗</returns>
334 383
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
335 384
        {
......
349 398
                return false;
350 399
            }
351 400
        }
401
        #endregion
352 402

  
403
        #region OracleDataReaderより構造体へセットする
353 404
        /// <summary>
354 405
        /// OracleDataReaderより構造体へセットする
355 406
        /// </summary>
......
398 449
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
399 450
            }
400 451
        }
401

  
402

  
403 452
        #endregion
404 453

  
405
        #region パブリックメソッド(特殊処理)
406

  
454
        #region 主キー検索の文字列を返す
407 455
        /// <summary>
408 456
        /// 主キー検索の文字列を返す
409 457
        /// </summary>
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs
16 16
namespace ProcessManagement.DB.IOAccess
17 17
{
18 18
    /// <summary>
19
    /// 積算予算ページデータDBアクセス
19
    /// 工事詳細台帳データDBアクセス
20 20
    /// </summary>
21 21
    public class IOConstructionLedger : OracleProcess
22 22
    {
......
29 29

  
30 30
        #region 定数
31 31
        /// <summary>
32
        /// 積算予算ページデータフィールド並び
32
        /// 工事詳細台帳データフィールド並び
33 33
        /// </summary>
34 34
        public enum ConstructionLedgerColumn
35 35
        {
......
70 70

  
71 71
        #endregion
72 72

  
73
        #region 積算予算ページデータ検索SQL作成
73
        #region 工事詳細台帳データ検索SQL作成
74 74
        /// <summary>
75
        /// 積算予算ページデータ検索SQL作成
75
        /// 工事詳細台帳データ検索SQL作成
76 76
        /// </summary>
77 77
        /// <returns></returns>
78 78
        private string CreateSelectSQL()
......
107 107
        }
108 108
        #endregion
109 109

  
110
        #region 積算予算ページデータ複数検索
110
        #region 工事詳細台帳データ複数検索
111 111
        /// <summary>
112
        /// 積算予算ページデータ複数検索
112
        /// 工事詳細台帳データ複数検索
113 113
        /// </summary>
114 114
        /// <param name="AddSQLString"></param>
115 115
        /// <param name="data"></param>
......
147 147
        }
148 148
        #endregion
149 149

  
150
        #region 積算予算ページデータ複数検索
150
        #region 工事詳細台帳データ1件検索
151 151
        /// <summary>
152
        /// 積算予算ページデータ1件検索
152
        /// 工事詳細台帳データ1件検索
153 153
        /// </summary>
154 154
        /// <param name="AddSQLString"></param>
155 155
        /// <param name="data"></param>
......
187 187
        }
188 188
        #endregion
189 189

  
190
        #region 積算予算ページデータ1件追加
190
        #region 工事詳細台帳データ1件追加
191 191
        /// <summary>
192
        /// 積算予算ページデータ1件追加
192
        /// 工事詳細台帳データ1件追加
193 193
        /// </summary>
194
        /// <param name="data">積算予算ページデータデータ</param>
194
        /// <param name="data">工事詳細台帳データデータ</param>
195 195
        /// <returns>true:成功 false:失敗</returns>
196 196
        public bool InsertAction(ConstructionLedger work, bool bConnect = true)
197 197
        {
......
200 200
            {
201 201

  
202 202
                strcmd = "INSERT INTO ConstructionLedger";
203
                strcmd += " (ConstructionCode";         // 工事番号
204
                strcmd += " ,ConstructionPeriod";       // 事業期
205
                strcmd += " ,CreatorCode";              // 作成者コード
206
                strcmd += " ,CreatorName";              // 作成者名
207
                strcmd += " ,CreateDate";               // 作成日
208
                strcmd += " ,ConstructionTimes";        // 工期(単位・月)
209
                strcmd += " ,ConstructionStart";        // 契約工期開始
210
                strcmd += " ,ConstructionEnd";          // 契約工期完了
211
                strcmd += " ,OrdersDecisionPrice";      // 税抜受注決定金額
212
                strcmd += " ,CompanyExpenses";          // 会社経費合計
213
                strcmd += " ,DepartmentExpenses";       // 部署経費合計
214
                strcmd += " ,SalesExpenses";            // 営業経費合計
215
                strcmd += " ,TotalPayment";             // 総支払額
216
                strcmd += " ,GrossProfit";              // 粗利
217
                strcmd += " ,Allowance";                // 給与
218
                strcmd += " ,NetProfit";                // 純利益
219
                strcmd += " ,ComplateFlg";              // 入力完了フラグ
220
                strcmd += " ,IntegrationFlg";           // 受注金額積算フラグ
221
                strcmd += " ,EntryDate";
222
                strcmd += " ,UpdateDate)";
203 223

  
204 224
                strcmd += " VALUES (";
205 225

  
......
244 264
        }
245 265
        #endregion
246 266

  
247
        #region 積算予算ページデータ複数追加
267
        #region 工事詳細台帳データ複数追加
248 268
        /// <summary>
249
        /// 積算予算ページデータ複数追加
269
        /// 工事詳細台帳データ複数追加
250 270
        /// </summary>
251
        /// <param name="data">積算予算ページデータデータ</param>
271
        /// <param name="data">工事詳細台帳データデータ</param>
252 272
        /// <returns>true:成功 false:失敗</returns>
253 273
        public bool InsertAction(List<ConstructionLedger> data, bool bConnect = true)
254 274
        {
......
270 290
        }
271 291
        #endregion
272 292

  
273
        #region 積算予算ページデータ更新
293
        #region 工事詳細台帳データ更新
274 294
        /// <summary>
275
        /// 積算予算ページデータ更新
295
        /// 工事詳細台帳データ更新
276 296
        /// </summary>
277 297
        /// <param name="AddSQLString">更新条件SQL文字列</param>
278
        /// <param name="data">積算予算ページデータデータ</param>
298
        /// <param name="data">工事詳細台帳データデータ</param>
279 299
        /// <returns>true:成功 false:失敗</returns>
280 300
        public bool UpdateAction(string AddSQLString, ConstructionLedger data, bool bConnect = true)
281 301
        {
......
326 346
        }
327 347
        #endregion
328 348

  
329
        #region 積算予算ページデータ削除
349
        #region 工事詳細台帳データ削除
330 350
        /// <summary>
331
        /// 積算予算ページデータ削除
351
        /// 工事詳細台帳データ削除
332 352
        /// </summary>
333 353
        /// <param name="AddSQLString">削除条件SQL文字列</param>
334
        /// <param name="data">積算予算ページデータデータ</param>
354
        /// <param name="data">工事詳細台帳データデータ</param>
335 355
        /// <returns>true:成功 false:失敗</returns>
336 356
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
337 357
        {
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs
31 31
        /// <summary>
32 32
        /// 工事詳細台帳データ明細フィールド並び
33 33
        /// </summary>
34
        private enum DataColumn
34
        public enum DataColumn
35 35
        {
36 36
            ConstructionCode = 0,	// 工事番号
37 37

  
......
51 51
            FixDataFlg,             // 固定データフラグ
52 52
            IndependentFlg,         // 独立データフラグ
53 53
            FluctuationFlg,         // 増減データフラグ
54
            SalaryFlg,              // 給与振分区分
55
            SalaryDays,             // 給与振分日数
56
            OperatingFlg,           // 担当中フラグ
54 57

  
55 58
            EntryDate,
56 59
            UpdateDate,
......
94 97
            strcmd += ", FixDataFlg";               // 固定データフラグ
95 98
            strcmd += ", IndependentFlg";           // 独立データフラグ
96 99
            strcmd += ", FluctuationFlg";           // 増減データフラグ
100
            strcmd += ", SalaryFlg";                // 給与振分区分
101
            strcmd += ", SalaryDays";               // 給与振分日数
102
            strcmd += ", OperatingFlg";             // 担当中フラグ
97 103

  
98 104
            strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
99 105
            strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
......
189 195

  
190 196
                strcmd = "INSERT INTO ConstructionLedgerDetail";
191 197

  
198
                strcmd += " (ConstructionCode";	        // 工事コード
199
                strcmd += ", GroupCount";               // グループ番号
200
                strcmd += ", LineCount";                // 行番号
201
                strcmd += ", ComponentCode";            // 構成キー
202
                strcmd += ", ItemCode";		            // 工種キー
203
                strcmd += ", FirstString";              // 項目名称
204
                strcmd += ", SecondString";             // 工事内容
205
                strcmd += ", CompanyType";              // 協力会社コードタイプ
206
                strcmd += ", CompanyCode";              // 協力会社コード
207
                strcmd += ", CompanyName";              // 協力会社名称
208
                strcmd += ", EstimatePrice";            // 予算(見積)金額
209
                strcmd += ", ExecutionAmount";          // 実行金額
210
                strcmd += ", AmountConfigRate";         // 金額構成率
211
                strcmd += ", PaymentBurden";            // 支払補填額
212
                strcmd += ", FixDataFlg";               // 固定データフラグ
213
                strcmd += ", IndependentFlg";           // 独立データフラグ
214
                strcmd += ", FluctuationFlg";           // 増減データフラグ
215
                strcmd += ", SalaryFlg";                // 給与振分区分
216
                strcmd += ", SalaryDays";               // 給与振分日数
217
                strcmd += ", OperatingFlg";             // 担当中フラグ
218

  
219
                strcmd += ", EntryDate";
220
                strcmd += ", UpdateDate)";
221

  
192 222
                strcmd += " VALUES (";
193 223

  
194 224
                strcmd += string.Format("  {0}", work.ConstructionCode);        // 工事番号
......
211 241
                strcmd += string.Format(", {0}", work.IndependentFlg);          // 独立データフラグ
212 242
                strcmd += string.Format(", {0}", work.FluctuationFlg);          // 増減データフラグ
213 243

  
244
                strcmd += string.Format(", {0}", work.SalaryFlg);               // 給与振分区分
245
                strcmd += string.Format(", {0}", work.SalaryDays);              // 給与振分日数
246
                strcmd += string.Format(", {0}", work.OperatingFlg);            // 担当中フラグ
247

  
214 248
                strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
215 249
                strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
216 250
                strcmd = strcmd + ")";
......
289 323
                strcmd += string.Format(", IndependentFlg = {0}", data.IndependentFlg);             // 独立データフラグ
290 324
                strcmd += string.Format(", FluctuationFlg = {0}", data.FluctuationFlg);             // 増減データフラグ
291 325

  
326
                strcmd += string.Format(", SalaryFlg = {0}", data.SalaryFlg);                       // 給与振分区分
327
                strcmd += string.Format(", SalaryDays = {0}", data.SalaryDays);                     // 給与振分日数
328
                strcmd += string.Format(", OperatingFlg = {0}", data.OperatingFlg);                 // 担当中フラグ
329

  
292 330
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
293 331
                strcmd += AddSQLString;
294 332

  
......
362 400
                wrk.IndependentFlg = int.Parse(objwrk[(int)DataColumn.IndependentFlg].ToString());              // 独立データフラグ
363 401
                wrk.FluctuationFlg = int.Parse(objwrk[(int)DataColumn.FluctuationFlg].ToString());              // 増減データフラグ
364 402

  
403
                wrk.SalaryFlg = int.Parse(objwrk[(int)DataColumn.SalaryFlg].ToString());                        // 給与振分区分
404
                wrk.SalaryDays = int.Parse(objwrk[(int)DataColumn.SalaryDays].ToString());                      // 給与振分日数
405
                wrk.OperatingFlg = int.Parse(objwrk[(int)DataColumn.OperatingFlg].ToString());                  // 担当中フラグ
406

  
365 407
                wrk.EntryDate = DateTime.Parse(objwrk[(int)DataColumn.EntryDate].ToString());
366 408
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)DataColumn.UpdateDate].ToString());
367 409
            }
......
376 418
        }
377 419
        #endregion
378 420

  
421
        #region 1項目の更新を行う
422
        /// <summary>
423
        /// 1項目の更新を行う
424
        /// </summary>
425
        /// <param name="ConstructionCode"></param>
426
        /// <param name="FeildNo"></param>
427
        /// <param name="value"></param>
428
        /// <param name="GroupCount"></param>
429
        /// <param name="LineCount"></param>
430
        /// <param name="bConnect"></param>
431
        /// <returns></returns>
432
        public bool UpdateFeild(int ConstructionCode, int FeildNo, object value, int GroupCount = 0, int LineCount = 0, bool bConnect = true)
433
        {
434
            string strcmd = "";
435
            try
436
            {
437
                strcmd = "UPDATE ConstructionLedgerDetail";
438

  
439
                strcmd += " SET";
440
                switch (FeildNo)
441
                {
442
                    case (int)DataColumn.ConstructionCode:	    // 工事番号
443
                        strcmd += string.Format(" ConstructionCode = {0}", ((int)value).ToString());
444
                        break;
445
                    case (int)DataColumn.GroupCount:            // グループ番号
446
                        strcmd += string.Format(" GroupCount = {0}", ((int)value).ToString());
447
                        break;
448
                    case (int)DataColumn.LineCount:             // 行番号
449
                        strcmd += string.Format(" LineCount = {0}", ((int)value).ToString());
450
                        break;
451
                    case (int)DataColumn.ComponentCode:         // 構成キー
452
                        strcmd += string.Format(" ComponentCode = {0}", ((int)value).ToString());
453
                        break;
454
                    case (int)DataColumn.ItemCode:		        // 工種キー
455
                        strcmd += string.Format(" ItemCode = {0}", ((int)value).ToString());
456
                        break;
457
                    case (int)DataColumn.FirstString:           // 項目名称
458
                        strcmd += string.Format(" FirstString = '{0}'", value.ToString());
459
                        break;
460
                    case (int)DataColumn.SecondString:          // 工事内容
461
                        strcmd += string.Format(" SecondString = '{0}'", value.ToString());
462
                        break;
463
                    case (int)DataColumn.CompanyType:           // 協力会社コードタイプ
464
                        strcmd += string.Format(" CompanyType = {0}", ((int)value).ToString());
465
                        break;
466
                    case (int)DataColumn.CompanyCode:           // 協力会社コード
467
                        strcmd += string.Format(" CompanyCode = {0}", ((int)value).ToString());
468
                        break;
469
                    case (int)DataColumn.CompanyName:           // 協力会社名称
470
                        strcmd += string.Format(" CompanyName = '{0}'", value.ToString());
471
                        break;
472
                    case (int)DataColumn.EstimatePrice:         // 予算(見積)金額
473
                        strcmd += string.Format(" EstimatePrice = {0}", ((int)value).ToString());
474
                        break;
475
                    case (int)DataColumn.ExecutionAmount:       // 実行金額
476
                        strcmd += string.Format(" ExecutionAmount = {0}", ((int)value).ToString());
477
                        break;
478
                    case (int)DataColumn.AmountConfigRate:      // 金額構成率
479
                        strcmd += string.Format(" AmountConfigRate = {0}", ((double)value).ToString());
480
                        break;
481
                    case (int)DataColumn.PaymentBurden:         // 支払補填額
482
                        strcmd += string.Format(" PaymentBurden = {0}", ((int)value).ToString());
483
                        break;
484
                    case (int)DataColumn.FixDataFlg:            // 固定データフラグ
485
                        strcmd += string.Format(" FixDataFlg = {0}", ((int)value).ToString());
486
                        break;
487
                    case (int)DataColumn.IndependentFlg:        // 独立データフラグ
488
                        strcmd += string.Format(" IndependentFlg = {0}", ((int)value).ToString());
489
                        break;
490
                    case (int)DataColumn.FluctuationFlg:        // 増減データフラグ
491
                        strcmd += string.Format(" FluctuationFlg = {0}", ((int)value).ToString());
492
                        break;
493
                    case (int)DataColumn.SalaryFlg:             // 給与振分区分
494
                        strcmd += string.Format(" SalaryFlg = {0}", ((int)value).ToString());
495
                        break;
496
                    case (int)DataColumn.SalaryDays:            // 給与振分日数
497
                        strcmd += string.Format(" SalaryDays = {0}", ((int)value).ToString());
498
                        break;
499
                    case (int)DataColumn.OperatingFlg:          // 担当中フラグ
500
                        strcmd += string.Format(" OperatingFlg = {0}", ((int)value).ToString());
501
                        break;
502
                    default:
503
                        break;
504
                }
505
                
506
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
507
                strcmd += CreatePrimarykeyString(ConstructionCode, GroupCount, LineCount);
508

  
509
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
510

  
511
                return true;
512
            }
513
            catch (OracleException oraex)
514
            {
515
                logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
516
                return false;
517
            }
518
        }
519
        #endregion
520

  
379 521
        #region パブリックメソッド(特殊処理)
380 522
        /// <summary>
381 523
        /// 主キー検索の文字列を返す
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs
31 31
        /// <summary>
32 32
        /// 工事詳細台帳実行データフィールド並び
33 33
        /// </summary>
34
        public enum ConstructionLedgerExcuteColumn
34
        public enum TableColumn
35 35
        {
36 36
            ConstructionCode = 0,	// 工事番号
37 37

  
......
58 58

  
59 59
        #endregion
60 60

  
61
        #region パブリックメソッド
61
        #region SELECT SQL作成
62 62
        /// <summary>
63
        /// SQL作成
64
        /// </summary>
65
        private string CreateSelectSQL()
66
        {
67
            // SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく)
68
            string strcmd = "SELECT";
69

  
70
            strcmd += "  ConstructionCode";	        // 工事コード
71
            strcmd += ", GroupCount";               // グループ番号
72
            strcmd += ", LineCount";                // 行番号
73
            strcmd += ", ColumnCount";              // 列番号
74

  
75
            strcmd += ", PaymentAmount";            // 支払金額
76
            strcmd += ", TO_CHAR(TargetMonth, 'YYYY/MM/DD HH24:MI:ss')";    // 対象年月
77

  
78
            strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
79
            strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
80
            strcmd += " FROM ConstructionLedgerExcute";
81

  
82
            return strcmd;
83
        }
84
        #endregion
85

  
86
        #region 工事詳細台帳実行データ検索
87
        /// <summary>
63 88
        /// 工事詳細台帳実行データ検索
64 89
        /// </summary>
65 90
        /// <param name="AddSQLString">検索条件SQL文字列</param>
......
73 98

  
74 99
            try
75 100
            {
76
                // SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく)
77
                strcmd = "SELECT";
78
                
79
                strcmd += "  ConstructionCode";	        // 工事コード
80
                strcmd += ", GroupCount";               // グループ番号
81
                strcmd += ", LineCount";                // 行番号
82
                strcmd += ", ColumnCount";              // 列番号
101
                // SQL作成
102
                strcmd = CreateSelectSQL() + AddSQLString;
83 103

  
84
                strcmd += ", PaymentAmount";            // 支払金額
85
                strcmd += ", TO_CHAR(TargetMonth, 'YYYY/MM/DD HH24:MI:ss')";    // 対象年月
86

  
87
                strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
88
                strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
89
                strcmd += " FROM ConstructionLedgerExcute";
90
                strcmd += AddSQLString;
91

  
92 104
                // SQL実行
93 105
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
94 106

  
......
108 120
                return false;
109 121
            }
110 122
        }
123
        #endregion
111 124

  
125
        #region 工事詳細台帳実行データ検索
112 126
        /// <summary>
127
        /// 工事詳細台帳実行データ検索
128
        /// </summary>
129
        /// <param name="AddSQLString">検索条件SQL文字列</param>
130
        /// <param name="data">工事詳細台帳実行データデータ</param>
131
        /// <returns>true:成功 false:失敗</returns>
132
        public bool SelectAction(string AddSQLString, ref ConstructionLedgerExcute data, bool bConnect = true)
133
        {
134
            //Oracle インターフェース
135
            string strcmd = "";
136
            ArrayList arData = new ArrayList();
137

  
138
            try
139
            {
140
                // SQL作成
141
                strcmd = CreateSelectSQL() + AddSQLString;
142

  
143
                // SQL実行
144
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
145

  
146
                // データセット
147
                foreach (object[] objwrk in arData)
148
                {
149
                    Reader2Struct(objwrk, ref data);
150
                    break;
151
                }
152

  
153
                return true;
154
            }
155
            catch (Exception ex)
156
            {
157
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
158
                return false;
159
            }
160
        }
161
        #endregion
162

  
163
        #region 工事詳細台帳実行データ追加
164
        /// <summary>
113 165
        /// 工事詳細台帳実行データ追加
114 166
        /// </summary>
115 167
        /// <param name="data">工事詳細台帳実行データデータ</param>
......
121 173
            {
122 174

  
123 175
                strcmd = "INSERT INTO ConstructionLedgerExcute";
176
                strcmd += "(ConstructionCode";	        // 工事コード
177
                strcmd += ", GroupCount";               // グループ番号
178
                strcmd += ", LineCount";                // 行番号
179
                strcmd += ", ColumnCount";              // 列番号
180
                strcmd += ", PaymentAmount";            // 支払金額
181
                strcmd += ", TargetMonth";              // 対象年月
182
                strcmd += ", EntryDate";
183
                strcmd += ", UpdateDate)";
124 184

  
125 185
                strcmd += " VALUES (";
126 186

  
......
147 207
                return false;
148 208
            }
149 209
        }
210
        #endregion
150 211

  
212
        #region 工事詳細台帳実行データ追加
151 213
        /// <summary>
152 214
        /// 工事詳細台帳実行データ追加
153 215
        /// </summary>
......
170 232
                return false;
171 233
            }
172 234
        }
235
        #endregion
173 236

  
237
        #region 工事詳細台帳実行データ更新
174 238
        /// <summary>
175 239
        /// 工事詳細台帳実行データ更新
176 240
        /// </summary>
......
207 271
                return false;
208 272
            }
209 273
        }
274
        #endregion
210 275

  
211

  
276
        #region 工事詳細台帳実行データ削除
212 277
        /// <summary>
213 278
        /// 工事詳細台帳実行データ削除
214 279
        /// </summary>
......
233 298
                return false;
234 299
            }
235 300
        }
301
        #endregion
236 302

  
303
        #region OracleDataReaderより構造体へセットする
237 304
        /// <summary>
238 305
        /// OracleDataReaderより構造体へセットする
239 306
        /// </summary>
......
244 311
            try
245 312
            {
246 313
                // データ取得
247
                wrk.ConstructionCode = int.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.ConstructionCode].ToString());          // 工事番号
314
                wrk.ConstructionCode = int.Parse(objwrk[(int)TableColumn.ConstructionCode].ToString());          // 工事番号
248 315

  
249
                wrk.GroupCount = int.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.GroupCount].ToString());	                    // グループ番号
250
                wrk.LineCount = int.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.LineCount].ToString());	                    // 行番号
251
                wrk.ColumnCount = int.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.ColumnCount].ToString());                    // 列番号
252
                wrk.PaymentAmount = double.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.PaymentAmount].ToString());             // 支払金額
253
                wrk.TargetMonth = DateTime.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.TargetMonth].ToString());               // 対象年月
316
                wrk.GroupCount = int.Parse(objwrk[(int)TableColumn.GroupCount].ToString());	                    // グループ番号
317
                wrk.LineCount = int.Parse(objwrk[(int)TableColumn.LineCount].ToString());	                    // 行番号
318
                wrk.ColumnCount = int.Parse(objwrk[(int)TableColumn.ColumnCount].ToString());                    // 列番号
319
                wrk.PaymentAmount = double.Parse(objwrk[(int)TableColumn.PaymentAmount].ToString());             // 支払金額
320
                wrk.TargetMonth = DateTime.Parse(objwrk[(int)TableColumn.TargetMonth].ToString());               // 対象年月
254 321

  
255
                wrk.EntryDate = DateTime.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.EntryDate].ToString());
256
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)ConstructionLedgerExcuteColumn.UpdateDate].ToString());
322
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
323
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
257 324
            }
258 325
            catch (OracleException oraex)
259 326
            {
......
264 331
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
265 332
            }
266 333
        }
334
        #endregion
267 335

  
336
        #region 1項目更新処理
337
        /// <summary>
338
        /// 1項目の更新を行う
339
        /// </summary>
340
        /// <param name="ConstructionCode"></param>
341
        /// <param name="GroupCount"></param>
342
        /// <param name="LineCount"></param>
343
        /// <param name="ColumnCount"></param>
344
        /// <param name="FeildNo"></param>
345
        /// <param name="value"></param>
346
        /// <param name="bConnect"></param>
347
        /// <returns></returns>
348
        public bool UpdateFeild(int ConstructionCode, int GroupCount, int LineCount, int ColumnCount
349
                                    , int FeildNo, object value, bool bConnect = true)
350
        {
351
            string strcmd = "";
352
            try
353
            {
354
                strcmd = "UPDATE ConstructionLedgerExcute";
268 355

  
356
                strcmd += " SET";
357

  
358
                switch (FeildNo)
359
                {
360
                    // 工事番号
361
                    case (int)TableColumn.ConstructionCode:
362
                        strcmd += string.Format(" ConstructionCode = {0}", (int)value);
363
                        break;
364
                    // グループ番号
365
                    case (int)TableColumn.GroupCount:
366
                        strcmd += string.Format(" GroupCount = {0}", (int)value);
367
                        break;
368
                    // 行番号
369
                    case (int)TableColumn.LineCount:
370
                        strcmd += string.Format(" LineCount = {0}", (int)value);
371
                        break;
372
                    // 列番号
373
                    case (int)TableColumn.ColumnCount:
374
                        strcmd += string.Format(" ColumnCount = {0}", (int)value);
375
                        break;
376
                    // 支払金額
377
                    case (int)TableColumn.PaymentAmount:
378
                        strcmd += string.Format(" PaymentAmount = {0}", (int)value);
379
                        break;
380
                    // 対象年月
381
                    case (int)TableColumn.TargetMonth:
382
                        strcmd += string.Format(" TargetMonth = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
383
                        break;
384
                    default:
385
                        break;
386
                }
387

  
388
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
389
                strcmd += CreatePrimarykeyString(ConstructionCode, GroupCount, LineCount, ColumnCount);
390

  
391
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
392

  
393
                return true;
394
            }
395
            catch (Exception ex)
396
            {
397
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
398
                return false;
399
            }
400
        }
269 401
        #endregion
270 402

  
271
        #region パブリックメソッド(特殊処理)
403
        #region 主キー検索の文字列を返す
272 404
        /// <summary>
273 405
        /// 主キー検索の文字列を返す
274 406
        /// </summary>
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMDepartmentExpenses.cs
33 33
        /// </summary>
34 34
        public enum NameColumn
35 35
        {
36
            /// <summary>
37
            /// 部署コード
38
            /// </summary>
36 39
            DepartmentCode = 0,
40
            /// <summary>
41
            /// 事業期
42
            /// </summary>
43
            ExpensesPeriod,
44
            /// <summary>
45
            /// 経費名称コード
46
            /// </summary>
37 47
            NameCode,
48
            /// <summary>
49
            /// 表示順
50
            /// </summary>
38 51
            DisplayOrder,
52
            /// <summary>
53
            /// 経費率
54
            /// </summary>
39 55
            ExpensesRaito,
56
            /// <summary>
57
            /// 削除フラグ
58
            /// </summary>
40 59
            DeleteFlg,
60
            /// <summary>
61
            /// 登録年月日
62
            /// </summary>
41 63
            EntryDate,
64
            /// <summary>
65
            /// 更新年月日
66
            /// </summary>
42 67
            UpdateDate,
43 68
        }
44 69
        #endregion
......
55 80

  
56 81
        #endregion
57 82

  
58
        #region パブリックメソッド
83
        #region 経費率マスタ検索SQL作成
59 84
        /// <summary>
60
        /// 経費率マスタ検索
85
        /// 経費率マスタ検索SQL作成
61 86
        /// </summary>
62 87
        /// <param name="AddSQLString">検索条件SQL文字列</param>
63 88
        /// <param name="data">経費率マスタデータ</param>
......
67 92
            string strcmd = "SELECT";
68 93

  
69 94
            strcmd += " DepartmentCode";
95
            strcmd += " ,ExpensesPeriod";
70 96
            strcmd += " ,NameCode";
71 97
            strcmd += " ,DisplayOrder";
72 98
            strcmd += " ,ExpensesRatio";
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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