プロジェクト

全般

プロフィール

リビジョン 20

堀内約8年前に追加

工事詳細台帳給与計算修正
工事情報担当者変更修正

差分を表示:

trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs
298 298
        /// </summary>
299 299
        public enum DivisionMasterCodeDefine
300 300
        {
301
            OrderDivision = 1,          // 発注者区分登録
302
            ConstructionClass = 2,      // 工事種別登録
303
            ConstructionExpenses = 3,   // 工事経費名称登録
301
            /// <summary>
302
            /// 発注者区分登録
303
            /// </summary>
304
            OrderDivision = 1,
305
            /// <summary>
306
            /// 工事種別登録
307
            /// </summary>
308
            ConstructionClass = 2,
309
            /// <summary>
310
            /// 工事経費名称登録
311
            /// </summary>
312
            ConstructionExpenses = 3,
304 313
        }
305 314
        /// <summary>
306 315
        /// 区分マスタ区分キー
......
446 455
        #endregion
447 456

  
448 457
        #region 工事基本情報:施工案件状態定義
458
        #region 施工案件状態キー定義配列
449 459
        /// <summary>
450 460
        /// 施工案件状態キー定義配列
451 461
        /// </summary>
......
524 534
            /// </summary>
525 535
            Status17,
526 536
        };
537
        #endregion
538

  
539
        #region 施工案件状態Dictionary
527 540
        /// <summary>
528 541
        /// 施工案件状態Dictionary
529 542
        /// </summary>
......
625 638
                                                                                {17, "Hit'sV工事"},         // 工事基本情報ラジオボタン:17
626 639
                                                                                };
627 640
        #endregion
641
        #endregion
628 642

  
629 643
        #region 工事基本情報:日付項目テーブル
630 644
        #region 旧データ
......
1026 1040
        public static readonly string[] CostDataNoString = new string[] { "", "交 通 費", "購入品費", "車両リース代", "駐車場・資材置き場代", "宿泊費" };
1027 1041
        #endregion
1028 1042

  
1029
        #region 入力履歴:データ種別
1043
        #region 入力履歴:データ種別
1030 1044
        /// <summary>
1031
        /// 入力履歴:データ種別
1045
        /// 入力履歴:データ種別
1032 1046
        /// </summary>
1033 1047
        public enum SearchLogDataType
1034 1048
        {
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs
515 515
                    if (CurRec.CompanyCode == 0) continue;
516 516
                    // 施工管理中担当者ではない場合は処理しない
517 517
                    if (CurRec.OperatingFlg == (int)CommonDefine.SalaryOperateKind.Complate) continue;
518
                    // 実行金額が無い場合は処理しない
519
                    if (CurRec.ExecutionAmount == 0) continue;
518 520

  
519 521
                    // 1日分の給与を取得する
520 522
                    //double dSaraly = Get1DaysSalaryForOperating(PersonDB, CurRec.CompanyCode);
521 523
                    double dSaraly = Get1DaysSalaryForFixed(PersonDB, CurRec.CompanyCode, CurRec.GroupCount);
522 524

  
523
                        switch (CurRec.SalaryFlg)
524
                        {
525
                            case (int)CommonDefine.SalaryDevision.All:          // 全日振分
526
                                // 指定日までの稼働日数を掛けた値をセットする
527
                                dSaraly *= WorkingDay;
528
                                break;
529
                            case (int)CommonDefine.SalaryDevision.Noting:       // 振分無
530
                                // 給与振分無
525
                    switch (CurRec.SalaryFlg)
526
                    {
527
                        case (int)CommonDefine.SalaryDevision.All:          // 全日振分
528
                            // 指定日までの稼働日数を掛けた値をセットする
529
                            dSaraly *= WorkingDay;
530
                            break;
531
                        case (int)CommonDefine.SalaryDevision.Noting:       // 振分無
532
                            // 給与振分無
533
                            dSaraly = 0;
534
                            LoopBreak = true;
535
                            break;
536
                        case (int)CommonDefine.SalaryDevision.DaysInput:    // 日数入力
537
                            // 日当加算判定を行う
538
                            if (CheckPaymentValue(CurRec))
539
                            {
540
                                // 日数分掛ける
541
                                dSaraly *= CurRec.SalaryDays;
542
                            }
543
                            else
544
                            {
531 545
                                dSaraly = 0;
532
                                LoopBreak = true;
533
                                break;
534
                            case (int)CommonDefine.SalaryDevision.DaysInput:    // 日数入力
535
                                // 日当加算判定を行う
536
                                if (CheckPaymentValue(CurRec))
537
                                {
538
                                    // 日数分掛ける
539
                                    dSaraly *= CurRec.SalaryDays;
540
                                }
541
                                else
542
                                {
543
                                    dSaraly = 0;
544
                                }
545
                                LoopBreak = true;
546
                                break;
547
                            default:
548
                                break;
549
                        }
546
                            }
547
                            LoopBreak = true;
548
                            break;
549
                        default:
550
                            break;
551
                    }
552
                    // 計算値が実行金額より大きい場合は処理しない
553
                    if (CurRec.ExecutionAmount < dSaraly) continue;
550 554

  
551 555
                    DateTime ParaDate = new DateTime(TargetDate.Year, TargetDate.Month, 1);
552 556
                    // 支払いデータ書込み
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
534 534
        {
535 535
            try
536 536
            {
537
                if (m_ProcControlPara.Count <= cnt) return;
537 538
                // 数値パラメータ
538 539
                m_ProcControlPara[cnt].IntExecParameter.Clear();
539 540
                // 文字列パラメータ
......
556 557
        {
557 558
            try
558 559
            {
560
                if (m_ProcControlPara.Count <= cnt) return;
559 561
                // 数値パラメータ
560 562
                m_ProcControlPara[cnt].IntSaveParameter.Clear();
561 563
                // 文字列パラメータ
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs
31 31
        /// <summary>
32 32
        /// 工事詳細台帳データフィールド並び
33 33
        /// </summary>
34
        public enum ConstructionLedgerColumn
34
        public enum DataColumn
35 35
        {
36 36
            ConstructionCode = 0,	    // 工事番号
37 37

  
......
373 373
        }
374 374
        #endregion
375 375

  
376
        #region 1項目の更新を行う
377
        /// <summary>
378
        /// 1項目の更新を行う
379
        /// </summary>
380
        /// <param name="ConstructionCode"></param>
381
        /// <param name="FeildNo"></param>
382
        /// <param name="value"></param>
383
        /// <param name="GroupCount"></param>
384
        /// <param name="LineCount"></param>
385
        /// <param name="bConnect"></param>
386
        /// <returns></returns>
387
        public bool UpdateFeild(int ConstructionCode, int FeildNo, object value, bool bConnect = true)
388
        {
389
            string strcmd = "";
390
            try
391
            {
392
                strcmd = "UPDATE ConstructionLedger";
393

  
394
                strcmd += " SET";
395
                switch (FeildNo)
396
                {
397
                    case (int)DataColumn.ConstructionCode:          // 工事番号
398
                        strcmd += string.Format(" ConstructionCode = {0}", ((int)value).ToString());
399
                        break;
400
                    case (int)DataColumn.ConstructionPeriod:        // 事業期
401
                        strcmd += string.Format(" ConstructionPeriod = {0}", ((int)value).ToString());
402
                        break;
403
                    case (int)DataColumn.CreatorCode:               // 作成者コード
404
                        strcmd += string.Format(" CreatorCode = {0}", ((int)value).ToString());
405
                        break;
406
                    case (int)DataColumn.CreatorName:    	        // 作成者名
407
                        strcmd += string.Format(" CreatorName = '{0}'", value.ToString());
408
                        break;
409
                    case (int)DataColumn.CreateDate:	            // 作成日
410
                        strcmd += string.Format(" CreateDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
411
                        break;
412
                    case (int)DataColumn.ConstructionTimes:         // 工期(単位・月)
413
                        strcmd += string.Format(" ConstructionTimes = {0}", ((int)value).ToString());
414
                        break;
415
                    case (int)DataColumn.ConstructionStart:         // 契約工期開始
416
                        strcmd += string.Format(" ConstructionStart = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
417
                        break;
418
                    case (int)DataColumn.ConstructionEnd:           // 契約工期完了
419
                        strcmd += string.Format(" ConstructionEnd = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
420
                        break;
421
                    case (int)DataColumn.OrdersDecisionPrice:       // 税抜受注決定金額
422
                        strcmd += string.Format(" OrdersDecisionPrice = {0}", ((int)value).ToString());
423
                        break;
424
                    case (int)DataColumn.CompanyExpenses:           // 会社経費合計
425
                        strcmd += string.Format(" CompanyExpenses = {0}", ((int)value).ToString());
426
                        break;
427
                    case (int)DataColumn.DepartmentExpenses:        // 部署経費合計
428
                        strcmd += string.Format(" DepartmentExpenses = {0}", ((int)value).ToString());
429
                        break;
430
                    case (int)DataColumn.SalesExpenses:             // 営業経費合計
431
                        strcmd += string.Format(" SalesExpenses = {0}", ((int)value).ToString());
432
                        break;
433
                    case (int)DataColumn.TotalPayment:              // 総支払額
434
                        strcmd += string.Format(" TotalPayment = {0}", ((int)value).ToString());
435
                        break;
436
                    case (int)DataColumn.GrossProfit:               // 粗利
437
                        strcmd += string.Format(" GrossProfit = {0}", ((int)value).ToString());
438
                        break;
439
                    case (int)DataColumn.Allowance:                 // 給与
440
                        strcmd += string.Format(" Allowance = {0}", ((int)value).ToString());
441
                        break;
442
                    case (int)DataColumn.NetProfit:                 // 純利益
443
                        strcmd += string.Format(" NetProfit = {0}", ((int)value).ToString());
444
                        break;
445
                    case (int)DataColumn.ComplateFlg:               // 入力完了フラグ
446
                        strcmd += string.Format(" ComplateFlg = {0}", ((int)value).ToString());
447
                        break;
448
                    case (int)DataColumn.IntegrationFlg:            // 受注金額積算フラグ
449
                        strcmd += string.Format(" IntegrationFlg = {0}", ((int)value).ToString());
450
                        break;
451
                    default:
452
                        break;
453
                }
454

  
455
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
456
                strcmd += CreatePrimarykeyString(ConstructionCode);
457

  
458
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
459

  
460
                return true;
461
            }
462
            catch (OracleException oraex)
463
            {
464
                logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
465
                return false;
466
            }
467
        }
468
        #endregion
469

  
376 470
        #region OracleDataReaderより構造体へセットする
377 471
        /// <summary>
378 472
        /// OracleDataReaderより構造体へセットする
......
385 479
            {
386 480
                // データ取得
387 481

  
388
                wrk.ConstructionCode = int.Parse(objwrk[(int)ConstructionLedgerColumn.ConstructionCode].ToString());	        // 工事番号
482
                wrk.ConstructionCode = int.Parse(objwrk[(int)DataColumn.ConstructionCode].ToString());	        // 工事番号
389 483

  
390
                wrk.ConstructionPeriod = int.Parse(objwrk[(int)ConstructionLedgerColumn.ConstructionPeriod].ToString());        // 事業期
391
                wrk.CreatorCode = int.Parse(objwrk[(int)ConstructionLedgerColumn.CreatorCode].ToString());                      // 作成者コード
392
                wrk.CreatorName = objwrk[(int)ConstructionLedgerColumn.CreatorName].ToString();                                 // 作成者名
393
                wrk.CreateDate = DateTime.Parse(objwrk[(int)ConstructionLedgerColumn.CreateDate].ToString());                   // 作成日
394
                wrk.ConstructionTimes = double.Parse(objwrk[(int)ConstructionLedgerColumn.ConstructionTimes].ToString());       // 工期(単位・月)
395
                wrk.ConstructionStart = DateTime.Parse(objwrk[(int)ConstructionLedgerColumn.ConstructionStart].ToString());     // 契約工期開始
396
                wrk.ConstructionEnd = DateTime.Parse(objwrk[(int)ConstructionLedgerColumn.ConstructionEnd].ToString());         // 契約工期完了
484
                wrk.ConstructionPeriod = int.Parse(objwrk[(int)DataColumn.ConstructionPeriod].ToString());        // 事業期
485
                wrk.CreatorCode = int.Parse(objwrk[(int)DataColumn.CreatorCode].ToString());                      // 作成者コード
486
                wrk.CreatorName = objwrk[(int)DataColumn.CreatorName].ToString();                                 // 作成者名
487
                wrk.CreateDate = DateTime.Parse(objwrk[(int)DataColumn.CreateDate].ToString());                   // 作成日
488
                wrk.ConstructionTimes = double.Parse(objwrk[(int)DataColumn.ConstructionTimes].ToString());       // 工期(単位・月)
489
                wrk.ConstructionStart = DateTime.Parse(objwrk[(int)DataColumn.ConstructionStart].ToString());     // 契約工期開始
490
                wrk.ConstructionEnd = DateTime.Parse(objwrk[(int)DataColumn.ConstructionEnd].ToString());         // 契約工期完了
397 491

  
398
                wrk.OrdersDecisionPrice = double.Parse(objwrk[(int)ConstructionLedgerColumn.OrdersDecisionPrice].ToString());   // 税抜受注決定金額
399
                wrk.CompanyExpenses = double.Parse(objwrk[(int)ConstructionLedgerColumn.CompanyExpenses].ToString());           // 会社経費合計
400
                wrk.DepartmentExpenses = double.Parse(objwrk[(int)ConstructionLedgerColumn.DepartmentExpenses].ToString());     // 部署経費合計
401
                wrk.SalesExpenses = double.Parse(objwrk[(int)ConstructionLedgerColumn.SalesExpenses].ToString());               // 営業経費合計
402
                wrk.TotalPayment = double.Parse(objwrk[(int)ConstructionLedgerColumn.TotalPayment].ToString());                 // 総支払額
403
                wrk.GrossProfit = double.Parse(objwrk[(int)ConstructionLedgerColumn.GrossProfit].ToString());                   // 粗利
404
                wrk.Allowance = double.Parse(objwrk[(int)ConstructionLedgerColumn.Allowance].ToString());                       // 給与
405
                wrk.NetProfit = double.Parse(objwrk[(int)ConstructionLedgerColumn.NetProfit].ToString());                       // 純利益
406
                wrk.ComplateFlg = double.Parse(objwrk[(int)ConstructionLedgerColumn.ComplateFlg].ToString());                   // 入力完了フラグ
407
                wrk.IntegrationFlg = int.Parse(objwrk[(int)ConstructionLedgerColumn.IntegrationFlg].ToString());                // 受注金額積算フラグ
492
                wrk.OrdersDecisionPrice = double.Parse(objwrk[(int)DataColumn.OrdersDecisionPrice].ToString());   // 税抜受注決定金額
493
                wrk.CompanyExpenses = double.Parse(objwrk[(int)DataColumn.CompanyExpenses].ToString());           // 会社経費合計
494
                wrk.DepartmentExpenses = double.Parse(objwrk[(int)DataColumn.DepartmentExpenses].ToString());     // 部署経費合計
495
                wrk.SalesExpenses = double.Parse(objwrk[(int)DataColumn.SalesExpenses].ToString());               // 営業経費合計
496
                wrk.TotalPayment = double.Parse(objwrk[(int)DataColumn.TotalPayment].ToString());                 // 総支払額
497
                wrk.GrossProfit = double.Parse(objwrk[(int)DataColumn.GrossProfit].ToString());                   // 粗利
498
                wrk.Allowance = double.Parse(objwrk[(int)DataColumn.Allowance].ToString());                       // 給与
499
                wrk.NetProfit = double.Parse(objwrk[(int)DataColumn.NetProfit].ToString());                       // 純利益
500
                wrk.ComplateFlg = double.Parse(objwrk[(int)DataColumn.ComplateFlg].ToString());                   // 入力完了フラグ
501
                wrk.IntegrationFlg = int.Parse(objwrk[(int)DataColumn.IntegrationFlg].ToString());                // 受注金額積算フラグ
408 502

  
409
                wrk.EntryDate = DateTime.Parse(objwrk[(int)ConstructionLedgerColumn.EntryDate].ToString());
410
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)ConstructionLedgerColumn.UpdateDate].ToString());
503
                wrk.EntryDate = DateTime.Parse(objwrk[(int)DataColumn.EntryDate].ToString());
504
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)DataColumn.UpdateDate].ToString());
411 505
            }
412 506
            catch (OracleException oraex)
413 507
            {
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs
124 124
                ClsExcute.ProcControlPara[NowPoint].StringSaveParameter.Add(numUDConstPro.Value.ToString());
125 125
                // ?S????I???????
126 126
                if (radioButton2.Checked) ClsExcute.ProcControlPara[NowPoint].BoolSaveParameter.Add(true);
127
                // ????????
128
                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(CommonMotions.cnvInt(cmbDepartment.SelectedValue));
127 129
                // ?????S????
128
                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(cmbDepartment.SelectedIndex);
129
                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(cmbConstructionPerson.SelectedIndex);
130
                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue));
130 131

  
131 132
                // ?\?????s
132 133
                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(dgv.FirstDisplayedScrollingRowIndex);
......
881 882
                if (ClsExcute.ProcControlPara[NowPoint].BoolSaveParameter.Count > 0)
882 883
                    if (ClsExcute.ProcControlPara[NowPoint].BoolSaveParameter[0]) radioButton2.Checked = true;
883 884

  
884
                // ?S????
885
                // ?????E?S????
885 886
                if (ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Count > 0)
886 887
                {
887
                    cmbDepartment.SelectedIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[0];
888
                    cmbConstructionPerson.SelectedIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[1];
888
                    cmbDepartment.SelectedValue = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[0];
889
                    SetcmbPersons();
890
                    cmbConstructionPerson.SelectedValue = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[1];
889 891
                }
890 892

  
891 893
                // ????????\??
......
898 900
                DataDisplay();
899 901

  
900 902
                // ?\?????s
901
                dgv.FirstDisplayedScrollingRowIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[2];
903
                if (ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Count > 3)
904
                {
905
                    dgv.FirstDisplayedScrollingRowIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[2];
902 906

  
903
                // ??????s
904
                dgv.Rows[ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[3]].Selected = true;
905

  
907
                    // ??????s
908
                    dgv.Rows[ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[3]].Selected = true;
909
                }
906 910
                // ?\?[?g???
907 911
                if (ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Count > 4)
908 912
                {
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs
462 462
        }
463 463
        #endregion
464 464

  
465
        #region ?e?f?[?^????
466
        /// <summary>
467
        /// ?e?f?[?^????
468
        /// </summary>
469
        private enum ReadParentOrder
470
        {
471
            ConstructionCode = 0,
472
            StartDate,
473
            CompDate,
474
            ConstrPersonCode,
475
            ConstrPersonName,
476
            ConstrPersonSalary,
477
            AssistPersonCode,
478
            AssistPersonName,
479
            AssistPersonSalary,
480
            InstrPersonCode,
481
            InstrPersonName,
482
            InstrPersonSalary,
483
            ExpensesName1,
484
            ExpensesRatio1,
485
            ExpensesCode1,
486
            ExpensesName2,
487
            ExpensesRatio2,
488
            ExpensesCode2,
489
            ExpensesName3,
490
            ExpensesRatio3,
491
            ExpensesCode3,
492
        }
493
        #endregion
494
        #region ??r?p??e?f?[?^????????SQL????????
495
        /// <summary>
496
        /// ??r?p??e?f?[?^????????SQL????????
497
        /// </summary>
498
        /// <param name="strSQL"></param>
499
        private void CreateParentSQL(int ConstrCode, ref string strSQL)
500
        {
501
            try
502
            {
503
                int ConstrPeriod = CommonMotions.cnvInt(m_DspCtrl[(int)DspCnt.ConstructionPeriod].Text);
504

  
505
                strSQL = "SELECT A.CONSTRUCTIONCODE,";
506
                strSQL += " CASE A.ConstructionPeriodStart2 WHEN TO_DATE('0001/01/01') THEN A.ConstructionPeriodStart ELSE A.ConstructionPeriodStart2 END StDate,";
507
                strSQL += " CASE A.ConstructionPeriodEnd2 WHEN TO_DATE('0001/01/01') THEN A.ConstructionPeriodEnd ELSE A.ConstructionPeriodEnd2 END EdDate,";
508
                strSQL += " B.PERSONCODE B1, B.PERSONNAME B2, B.MONTHLYSALARY B3,";
509
                strSQL += " C.PERSONCODE C1, C.PERSONNAME C2, C.MONTHLYSALARY C3,";
510
                strSQL += " D.PERSONCODE D1, D.PERSONNAME D2, D.MONTHLYSALARY D3,";
511
                strSQL += " E1.NAMESTRING E1, E.EXPENSESRATIO E2, E.NAMECODE E3,";
512
                strSQL += " F1.NAMESTRING F1, F.EXPENSESRATIO F2, F.NAMECODE F3,";
513
                strSQL += " G1.NAMESTRING G1, G.EXPENSESRATIO G2, G.NAMECODE G3";
514
                strSQL += " FROM CONSTRUCTIONBASEINFO A";
515
                strSQL += " LEFT JOIN PERSONINCHARGEMASTER C ON C.PERSONCODE = A.CONSTRSUBPERSONCODE";
516
                strSQL += " LEFT JOIN PERSONINCHARGEMASTER D ON D.PERSONCODE = A.CONSTRUCTIONINSTRUCTOR";
517
                strSQL += " , PERSONINCHARGEMASTER B";
518
                strSQL += string.Format(" LEFT JOIN DEPARTMENTEXPENSESMASTER E ON E.DEPARTMENTCODE = B.DEPARTMENTCODE AND E.EXPENSESPERIOD = {0} AND E.NAMECODE = 3", ConstrPeriod);
519
                strSQL += string.Format(" LEFT JOIN DIVISIONMASTER E1 ON E1.DIVISIONCODE = {0} AND E1.NAMECODE = E.NAMECODE", (int)CommonDefine.DivisionMasterCodeDefine.ConstructionExpenses);
520
                strSQL += string.Format(" LEFT JOIN DEPARTMENTEXPENSESMASTER F ON F.DEPARTMENTCODE = B.DEPARTMENTCODE AND F.EXPENSESPERIOD = {0} AND F.NAMECODE = 2", ConstrPeriod);
521
                strSQL += string.Format(" LEFT JOIN DIVISIONMASTER F1 ON F1.DIVISIONCODE = {0} AND F1.NAMECODE = F.NAMECODE", (int)CommonDefine.DivisionMasterCodeDefine.ConstructionExpenses);
522
                strSQL += string.Format(" LEFT JOIN DEPARTMENTEXPENSESMASTER G ON G.DEPARTMENTCODE = B.DEPARTMENTCODE AND G.EXPENSESPERIOD = {0} AND G.NAMECODE = 1", ConstrPeriod);
523
                strSQL += string.Format(" LEFT JOIN DIVISIONMASTER G1 ON G1.DIVISIONCODE = {0} AND G1.NAMECODE = G.NAMECODE", (int)CommonDefine.DivisionMasterCodeDefine.ConstructionExpenses);
524
                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", ConstrCode);
525
                strSQL += " AND B.PERSONCODE = A.CONSTRUCTIONPERSONCODE";
526
            }
527
            catch (Exception ex)
528
            {
529
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
530
            }
531
        }
532
        #endregion
533

  
534
        #region ?????H????e?f?[?^??
535
        /// <summary>
536
        /// ?????H????e?f?[?^??
537
        /// </summary>
538
        /// <returns></returns>
539
        private bool GetFluctuationParent(IOConstructionBaseInfo cbiDB, IOConstructionLink cbLinkDB,
540
                                            bool TyingDataFlag, ref ArrayList ParentData, ref int ProcConstrCode)
541
        {
542
            try
543
            {
544
                // ----- ?H???????f?[?^??
545
                if (TyingDataFlag)
546
                {
547
                    string strLink = cbLinkDB.CreatePrimarykeyString(m_ConstructionCode);
548
                    ConstructionLink LinkRec = new ConstructionLink();
549
                    if (cbLinkDB.SelectAction(strLink, ref LinkRec, false))
550
                    {
551
                        ProcConstrCode = m_ConstructionCode;
552
                    }
553
                    else
554
                    {
555
                        strLink = string.Format(" WHERE FLUCTUATIONCODE = {0}", m_ConstructionCode);
556
                        if (!cbLinkDB.SelectAction(strLink, ref LinkRec, false)) return false;
557
                        ProcConstrCode = LinkRec.ConstructionCode;
558
                    }
559
                }
560
                else
561
                {
562
                    ProcConstrCode = m_ConstructionCode;
563
                }
564

  
565
                // ?e????f?[?^??
566
                string strParentSQL = string.Empty;
567
                CreateParentSQL(ProcConstrCode, ref strParentSQL);
568
                if (!cbiDB.ExecuteReader(strParentSQL, ref ParentData, false)) return false;
569

  
570
                return true;
571
            }
572
            catch (Exception ex)
573
            {
574
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
575
                return false;
576
            }
577
        }
578
        #endregion
579

  
465 580
        // ---------- ?H???\?Z???f?[?^??X????
466 581
        #region ?H???\?Z???F?f?[?^??X
467 582
        /// <summary>
......
472 587
                                        IOConstructionBudget BudgetDB,
473 588
                                        IOConstructionBudgetDetail BudgetDDB,
474 589
                                        IOMPersonInCharge PersonDB,
475
                                        int TotalOrdersPrice)
590
                                        int TotalOrdersPrice,
591
                                        ArrayList ParentData,
592
                                        int ProcConstrCode)
476 593
        {
477 594
            FrmConstructionBudget frm = new FrmConstructionBudget();
478 595
            try
......
492 609
                // ?f?[?^??????????????????
493 610
                if (!BudgetDB.SelectAction(strBudget, ref BudgetRec, false)) return true;
494 611

  
495
                // ?H???S????R?[?h??
496
                ComboBox ConstructorCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstructionPersonCode];
497
                int ConstrPersonCode = CommonMotions.cnvInt(ConstructorCombBox.SelectedValue);
498
                string ConstrPersonName = ConstructorCombBox.SelectedText;
612
                /// ?f?[?^?Z?b?g?E??X????
613
                object[] objRec = (object[])ParentData[0];
499 614

  
500
                // ?H?????S????R?[?h??
501
                ComboBox AssistantCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstrSubPersonCode];
502
                int AssistantCode = CommonMotions.cnvInt(AssistantCombBox.SelectedValue);
503
                string AssistantName = AssistantCombBox.SelectedText;
504

  
505
                // ?H???w?????R?[?h??
506
                ComboBox InstCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstructionInstructor];
507
                int InstructorCode = CommonMotions.cnvInt(InstCombBox.SelectedValue);
508
                string InstructorName = InstCombBox.SelectedText;
509

  
510
                // ?S?????}?X?^?f?[?^??
511
                string strPerson = PersonDB.CreatePrimarykeyString(ConstrPersonCode);
512
                PersonInChargeMaster personRec = new PersonInChargeMaster();
513
                PersonDB.SelectAction(strPerson, ref personRec, false);
514

  
515
                // ?S????????o???
516
                ArrayList ExpensesList = new ArrayList();
517
                GetExpensesList(personRec.DepartmentCode, ref ExpensesList);
518

  
519
                // ----- ?H???\?Z???f?[?^????
520
                /// ?f?[?^?Z?b?g?E??X????
521
                bool bChangeCode = BudgetDataSetCheck(ConstrPersonCode, ConstrPersonName, personRec.MonthlySalary,
522
                                                AssistantCode, AssistantName, InstructorCode, InstructorName, ref BudgetRec);
523
                // ?????????X?V
524
                if (bChangeCode)
525
                {
526
                    if (!BudgetDB.UpdateAction(strBudget, BudgetRec, false)) return false;
527
                }
528 615
                // ----- ?H???\?Z??????f?[?^????
529 616
                // ?H???S????
530
                if (!BudgetDetailDataSalarySet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
531
                                                    , (int)FrmConstructionBudget.DataGroup.PayrollExpenses, ConstrPersonCode, ConstrPersonName
532
                                                    , personRec.MonthlySalary, ExpensesList)) return false;
617
                if (!BudgetDetailDataSet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
618
                                                    , (int)FrmConstructionBudget.DataGroup.PayrollExpenses, objRec)) return false;
533 619

  
534 620
                // ?H?????S????
535
                if (!BudgetDetailDataSalarySet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
536
                                                    , (int)FrmConstructionBudget.DataGroup.AssistantCosts, AssistantCode, AssistantName
537
                                                    , CommonDefine.AssistantMonthryCost, ExpensesList)) return false;
621
                if (!BudgetDetailDataSet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
622
                                                    , (int)FrmConstructionBudget.DataGroup.AssistantCosts, objRec)) return false;
538 623

  
539 624
                // ?H???w????
540
                if (!BudgetDetailDataSalarySet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
541
                                                    , (int)FrmConstructionBudget.DataGroup.InstructorCosts, InstructorCode, InstructorName
542
                                                    , CommonDefine.InstructorMonthryCost, ExpensesList)) return false;
625
                if (!BudgetDetailDataSet(frm, BudgetDDB, BudgetRec, TotalOrdersPrice
626
                                                    , (int)FrmConstructionBudget.DataGroup.InstructorCosts, objRec)) return false;
543 627

  
628
                // ----- ?H???\?Z???f?[?^????
629
                if (!BudgetDataSet(BudgetDB, BudgetRec, objRec, TotalOrdersPrice)) return false;
630

  
544 631
                return true;
545 632
            }
546 633
            catch (Exception ex)
......
611 698
        }
612 699
        #endregion
613 700

  
614
        #region ?H???\?Z???F?f?[?^?Z?b?g?E??X????
701
        #region ?H???\?Z???F?f?[?^??X
615 702
        /// <summary>
616
        /// ?H???\?Z???F?f?[?^?Z?b?g?E??X????
703
        /// ?H???\?Z???F?f?[?^??X
617 704
        /// </summary>
618
        /// <param name="ApprovalNo"></param>
619 705
        /// <returns></returns>
620
        private bool BudgetDataSetCheck(int ConstrPersonCode, string ConstrPersonName, double MonthlySalary,
621
                                    int AssistantCode, string AssistantName,
622
                                    int InstructorCode, string InstructorName,
623
                                    ref ConstructionBudget BudgetRec)
706
        private bool BudgetDataSet(IOConstructionBudget BudgetDB, ConstructionBudget BudgetRec, object[] objRec, int TotalOrdersPrice)
624 707
        {
625
            bool bChangeCode = false;
626 708
            try
627 709
            {
628
                // ?S???????
629
                if (BudgetRec.CreatorCode == ConstrPersonCode) goto SecondProc;
710
                bool UpDateFlg = false;
630 711

  
631
                // ?o????l?W?????|??????????????
632
                MonthlySalary = CommonMotions.cnvRound(MonthlySalary * (double)CommonDefine.s_SalaryCorrection);
712
                // ?H???S????
713
                int ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ConstrPersonCode]);
714
                double C_MonthryCost = CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ConstrPersonSalary]);
715
                string C_ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.ConstrPersonName]);
633 716

  
634
                if (ConstrPersonCode == 0)
717
                // ?H?????S????
718
                int AssistantCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.AssistPersonCode]);
719
                double A_MonthryCost = CommonDefine.AssistantMonthryCost;
720
                string A_ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.AssistPersonName]);
721

  
722
                // ?H???w????
723
                int InstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.InstrPersonCode]);
724
                double I_MonthryCost = CommonDefine.InstructorMonthryCost;
725
                string I_ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.InstrPersonName]);
726

  
727
                // ????H????
728
                DateTime StartDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.StartDate]);
729
                DateTime CompDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.CompDate]);
730

  
731
                // ?H??????
732
                if (StartDT == BudgetRec.ConstructionStart && CompDT == BudgetRec.ConstructionEnd)
635 733
                {
636
                    BudgetRec.CreatorCode = 0;
637
                    BudgetRec.CreatorName = string.Empty;
638
                    BudgetRec.CreatorCosts = 0;
639
                    BudgetRec.SalaryFlg = 0;
640
                    BudgetRec.SalaryDays = 0;
641 734
                }
642 735
                else
643 736
                {
644
                    // ?S??????^
645
                    BudgetRec.CreatorCosts = MonthlySalary * BudgetRec.ConstructionTimes;
646
                    // ?S??????^?U????
647
                    BudgetRec.SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
648
                    // ?S??????^?U??????
649
                    BudgetRec.SalaryDays = 0;
650

  
651
                    // ?S????R?[?h
652
                    BudgetRec.CreatorCode = ConstrPersonCode;
653
                    // ?S?????
654
                    BudgetRec.CreatorName = ConstrPersonName;
737
                    BudgetRec.ConstructionStart = StartDT;
738
                    BudgetRec.ConstructionEnd = CompDT;
739
                    UpDateFlg = true;
655 740
                }
656
                bChangeCode = true;
657 741

  
658
            SecondProc:
742
                // ???^???z??
743
                double ExecutionAmount = 0;
744
                double AmountConfigRate = 0;
659 745

  
660
                // ???S???????
661
                if (BudgetRec.AssistantCode == AssistantCode) goto ThirdProc;
662

  
663
                if (AssistantCode == 0)
746
                // ----- ?S???????
747
                if (BudgetRec.CreatorCode != ConstructorCode)
664 748
                {
665
                    BudgetRec.AssistantCode = 0;
666
                    BudgetRec.AssistantName = string.Empty;
667
                    BudgetRec.AssistantCosts = 0;
668
                    BudgetRec.A_SalaryFlg = 0;
669
                    BudgetRec.A_SalaryDays = 0;
749
                    if (ConstructorCode == 0)
750
                    {
751
                        BudgetRec.CreatorCode = 0;
752
                        BudgetRec.CreatorName = string.Empty;
753
                        BudgetRec.CreatorCosts = 0;
754
                        BudgetRec.SalaryFlg = 0;
755
                        BudgetRec.SalaryDays = 0;
756
                    }
757
                    else
758
                    {
759
                        CalcPayValueData(C_MonthryCost, TotalOrdersPrice, StartDT, CompDT, ref ExecutionAmount, ref AmountConfigRate);
760
                        // ?S??????^
761
                        BudgetRec.CreatorCosts = ExecutionAmount;
762
                        // ?S??????^?U????
763
                        BudgetRec.SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
764
                        // ?S??????^?U??????
765
                        BudgetRec.SalaryDays = 0;
766
                        // ?S????R?[?h
767
                        BudgetRec.CreatorCode = ConstructorCode;
768
                        // ?S?????
769
                        BudgetRec.CreatorName = C_ConstructorName;
770
                    }
771
                    UpDateFlg = true;
670 772
                }
671
                else
773

  
774
                // ???S???????
775
                if (BudgetRec.AssistantCode != AssistantCode)
672 776
                {
673
                    // ???S??????^
674
                    BudgetRec.AssistantCosts = CommonDefine.AssistantMonthryCost * BudgetRec.ConstructionTimes;
675
                    // ???S??????^?U????
676
                    BudgetRec.A_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
677
                    // ???S??????^?U??????
678
                    BudgetRec.A_SalaryDays = 0;
679 777

  
680
                    // ???S????R?[?h
681
                    BudgetRec.AssistantCode = AssistantCode;
682
                    // ???S?????
683
                    BudgetRec.AssistantName = AssistantName;
778
                    if (AssistantCode == 0)
779
                    {
780
                        BudgetRec.AssistantCode = 0;
781
                        BudgetRec.AssistantName = string.Empty;
782
                        BudgetRec.AssistantCosts = 0;
783
                        BudgetRec.A_SalaryFlg = 0;
784
                        BudgetRec.A_SalaryDays = 0;
785
                    }
786
                    else
787
                    {
788
                        ExecutionAmount = 0;
789
                        AmountConfigRate = 0;
790
                        CalcPayValueData(A_MonthryCost, TotalOrdersPrice, StartDT, CompDT, ref ExecutionAmount, ref AmountConfigRate);
791
                        // ???S??????^
792
                        BudgetRec.AssistantCosts = ExecutionAmount;
793
                        // ???S??????^?U????
794
                        BudgetRec.A_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
795
                        // ???S??????^?U??????
796
                        BudgetRec.A_SalaryDays = 0;
797

  
798
                        // ???S????R?[?h
799
                        BudgetRec.AssistantCode = AssistantCode;
800
                        // ???S?????
801
                        BudgetRec.AssistantName = A_ConstructorName;
802
                    }
803
                    UpDateFlg = true;
684 804
                }
685
                bChangeCode = true;
686 805

  
687
            ThirdProc:
688

  
689 806
                // ?w????????
690
                if (BudgetRec.InstructorCode == InstructorCode) goto FourthProc;
807
                if (BudgetRec.InstructorCode != InstructorCode)
808
                {
691 809

  
692
                if (InstructorCode == 0)
693
                {
694
                    BudgetRec.InstructorCode = 0;
695
                    BudgetRec.InstructorName = string.Empty;
696
                    BudgetRec.InstructorCosts = 0;
697
                    BudgetRec.I_SalaryFlg = 0;
698
                    BudgetRec.I_SalaryDays = 0;
810
                    if (InstructorCode == 0)
811
                    {
812
                        BudgetRec.InstructorCode = 0;
813
                        BudgetRec.InstructorName = string.Empty;
814
                        BudgetRec.InstructorCosts = 0;
815
                        BudgetRec.I_SalaryFlg = 0;
816
                        BudgetRec.I_SalaryDays = 0;
817
                    }
818
                    else
819
                    {
820
                        ExecutionAmount = 0;
821
                        AmountConfigRate = 0;
822
                        CalcPayValueData(I_MonthryCost, TotalOrdersPrice, StartDT, CompDT, ref ExecutionAmount, ref AmountConfigRate);
823
                        // ?w????????^
824
                        BudgetRec.InstructorCosts = ExecutionAmount;
825
                        // ?w????????^?U????
826
                        BudgetRec.I_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
827
                        // ?w????????^?U??????
828
                        BudgetRec.I_SalaryDays = 0;
829

  
830
                        // ?w??????R?[?h
831
                        BudgetRec.InstructorCode = InstructorCode;
832
                        // ?w???????
833
                        BudgetRec.InstructorName = I_ConstructorName;
834
                    }
835
                    UpDateFlg = true;
699 836
                }
700
                else
837
                if (UpDateFlg)
701 838
                {
702
                    // ?w????????^
703
                    BudgetRec.InstructorCosts = CommonDefine.InstructorMonthryCost * BudgetRec.ConstructionTimes;
704
                    // ?w????????^?U????
705
                    BudgetRec.I_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // ?S??
706
                    // ?w????????^?U??????
707
                    BudgetRec.I_SalaryDays = 0;
839
                    string strSQL = BudgetDB.CreatePrimarykeyString(BudgetRec.ConstructionCode);
840
                    if (!BudgetDB.UpdateAction(strSQL, BudgetRec, false)) return false;
841

  
708 842
                }
709

  
710
                // ?w??????R?[?h
711
                BudgetRec.InstructorCode = InstructorCode;
712
                // ?w???????
713
                BudgetRec.InstructorName = InstructorName;
714

  
715
                bChangeCode = true;
716

  
717
            FourthProc:
718

  
719
                return bChangeCode;
843
                return true;
720 844
            }
721 845
            catch (Exception ex)
722 846
            {
723 847
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
724
                return bChangeCode;
848
                return false;
725 849
            }
726 850
        }
727 851
        #endregion
......
804 928
        /// <summary>
805 929
        /// ?H???\?Z???F?S????E???S????E?w?????Z?b?g
806 930
        /// </summary>
807
        /// <param name="frm"></param>
808
        /// <param name="BudgetDDB"></param>
809
        /// <param name="BudgetRec"></param>
810
        /// <param name="TotalOrdersPrice"></param>
811
        /// <param name="GroupNo"></param>
812
        /// <param name="ConstructorCode"></param>
813
        /// <param name="ConstructorName"></param>
814
        /// <param name="MonthryCost"></param>
815
        /// <param name="ExpensesList"></param>
816 931
        /// <returns></returns>
817
        private bool BudgetDetailDataSalarySet(FrmConstructionBudget frm, IOConstructionBudgetDetail BudgetDDB, ConstructionBudget BudgetRec, int TotalOrdersPrice
818
                                                    , int GroupNo, int ConstructorCode, string ConstructorName
819
                                                    , double MonthryCost, ArrayList ExpensesList)
932
        private bool BudgetDetailDataSet(FrmConstructionBudget frm, IOConstructionBudgetDetail BudgetDDB, ConstructionBudget BudgetRec,
933
                                    int TotalOrdersPrice, int GroupCode, object[] objRec)
820 934
        {
821 935
            try
822 936
            {
823
                string strSQL = BudgetDDB.CreatePrimarykeyString(m_ConstructionCode, GroupNo);
937
                string strSQL = BudgetDDB.CreatePrimarykeyString(m_ConstructionCode, GroupCode);
824 938
                ConstructionBudgetDetail DetailRec = new ConstructionBudgetDetail();
825 939
                // ?H???\?Z??????f?[?^?????????????O?????????s
826
                bool UpdateFlg = BudgetDDB.SelectAction(strSQL, ref DetailRec, false);
940
                bool ExistsFlg = BudgetDDB.SelectAction(strSQL, ref DetailRec, false);
827 941

  
828
                // ?S?????????????????????
829
                if (DetailRec.CompanyCode == ConstructorCode) return true;
942
                int ConstructorCode = 0;
943
                double MonthryCost = 0;
944
                string ConstructorName = string.Empty;
945
                int TargetParson = 0;
946
                switch (GroupCode)
947
                {
948
                    // ?H???S????
949
                    case (int)FrmConstructionBudget.DataGroup.PayrollExpenses:
950
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ConstrPersonCode]);
951
                        MonthryCost = CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ConstrPersonSalary]);
952
                        ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.ConstrPersonName]);
953
                        TargetParson = BudgetRec.CreatorCode;
954
                        break;
830 955

  
831
                // ???^???z?Z?b?g
956
                    // ?H?????S????
957
                    case (int)FrmConstructionBudget.DataGroup.AssistantCosts:
958
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.AssistPersonCode]);
959
                        MonthryCost = CommonDefine.AssistantMonthryCost;
960
                        ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.AssistPersonName]);
961
                        TargetParson = BudgetRec.AssistantCode;
962
                        break;
963

  
964
                    // ?H???w????
965
                    case (int)FrmConstructionBudget.DataGroup.InstructorCosts:
966
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.InstrPersonCode]);
967
                        MonthryCost = CommonDefine.InstructorMonthryCost;
968
                        ConstructorName = CommonMotions.cnvString(objRec[(int)ReadParentOrder.InstrPersonName]);
969
                        TargetParson = BudgetRec.InstructorCode;
970
                        break;
971
                }
972

  
973
                // ????H????
974
                DateTime StartDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.StartDate]);
975
                DateTime CompDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.CompDate]);
976

  
977
                // ?S????E?H????????????????????
978
                if (TargetParson == ConstructorCode && StartDT == BudgetRec.ConstructionStart && CompDT == BudgetRec.ConstructionEnd) return true;
979

  
980
                // ???^???z??
832 981
                double ExecutionAmount = 0;
833 982
                double AmountConfigRate = 0;
834
                CalcPayValueData(MonthryCost, TotalOrdersPrice,
835
                                BudgetRec.ConstructionStart, BudgetRec.ConstructionEnd,
836
                                ref ExecutionAmount, ref AmountConfigRate);
983
                CalcPayValueData(MonthryCost, TotalOrdersPrice, StartDT, CompDT, ref ExecutionAmount, ref AmountConfigRate);
837 984

  
838
                // ??????N???A???????????f?[?^???Z?b?g
985
                
839 986
                if (ConstructorCode == 0)
840
                {
841
                    ClearConstructionBudgetDetailRec(ref DetailRec);
987
                {   // ??????f?[?^??
988
                    if (ExistsFlg) if (!BudgetDDB.DeleteAction(strSQL, false)) return false;
989
                    return true;
842 990
                }
843 991
                else
844 992
                {
......
851 999
                DetailRec.CompanyName = ConstructorName;
852 1000

  
853 1001
                // ----- ?H???\?Z??????f?[?^?X?V
854
                if (UpdateFlg)
1002
                if (ExistsFlg)
855 1003
                {
856 1004
                    if (!BudgetDDB.UpdateAction(strSQL, DetailRec, false)) return false;
857 1005
                }
......
859 1007
                {
860 1008
                    // ?L?[???Z?b?g
861 1009
                    DetailRec.ConstructionCode = m_ConstructionCode;
862
                    DetailRec.GroupCount = GroupNo;
1010
                    DetailRec.GroupCount = GroupCode;
863 1011
                    DetailRec.CompanyType = (int)CommonDefine.SearchLogDataType.Person;
864 1012

  
865
                    frm.GetTitileParametar = GroupNo;
1013
                    frm.GetTitileParametar = GroupCode;
866 1014
                    DetailRec.FirstString = frm.GetTitleString;
867 1015
                    if (!BudgetDDB.InsertAction(DetailRec, false)) return false;
868 1016
                }
869 1017

  
870 1018
                // ?S?????????
871
                if (GroupNo == (int)FrmConstructionBudget.DataGroup.PayrollExpenses)
1019
                if (GroupCode == (int)FrmConstructionBudget.DataGroup.PayrollExpenses)
872 1020
                {
1021
                    ArrayList ExpensesList = new ArrayList();
1022
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName1]),
1023
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio1]),
1024
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode1]) });
1025
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName2]),
1026
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio2]),
1027
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode2]) });
1028
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName3]),
1029
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio3]),
1030
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode3]) });
873 1031
                    // ?o??f?[?^?X?V?i?S????????????????????????????????v?Z?j
874 1032
                    if (!BudgetSetExpenses(BudgetDDB, TotalOrdersPrice, ExpensesList)) return false;
875 1033
                }
......
889 1047
        /// <summary>
890 1048
        /// ?H???????f?[?^??X
891 1049
        /// </summary>
892
        /// <param name="cbiDB"></param>
893
        /// <param name="LedgerDB"></param>
894
        /// <param name="LedgerDDB"></param>
895
        /// <param name="LedgerEDB"></param>
896
        /// <param name="PersonDB"></param>
897
        /// <param name="cbLinkDB"></param>
898
        /// <param name="TotalOrdersPrice"></param>
899
        /// <param name="TyingDataFlag"></param>
900 1050
        /// <returns></returns>
901 1051
        private bool LedgerDataChange(IOConstructionBaseInfo cbiDB,
902 1052
                                        IOConstructionLedger LedgerDB,
......
906 1056
                                        IOConstructionLink cbLinkDB,
907 1057
                                        int TotalOrdersPrice,
908 1058
                                        bool TyingDataFlag,
1059
                                        FrmConstructionLedger frm,
1060
                                        ArrayList ParentData,
1061
                                        int ProcConstrCode,
909 1062
                                        ref bool LedgerReCalc,
910 1063
                                        ref int ConstrCode)
911 1064
        {
912
            FrmConstructionLedger frm = new FrmConstructionLedger();                    // ?H??????????
913 1065
            try
914 1066
            {
915
                // ----- ???????????H??????i?[?G???A
916
                int ProcConstrCode = 0;
917

  
918
                // ----- ?H???????f?[?^??
919
                if (TyingDataFlag)
920
                {
921
                    string strLink = cbLinkDB.CreatePrimarykeyString(m_ConstructionCode);
922
                    ConstructionLink LinkRec = new ConstructionLink();
923
                    if (cbLinkDB.SelectAction(strLink, ref LinkRec, false))
924
                    {
925
                        ProcConstrCode = m_ConstructionCode;
926
                    }
927
                    else
928
                    {
929
                        strLink = string.Format(" WHERE FLUCTUATIONCODE = {0}", m_ConstructionCode);
930
                        if (!cbLinkDB.SelectAction(strLink, ref LinkRec, false)) return false;
931
                        ProcConstrCode = LinkRec.ConstructionCode;
932
                    }
933
                }
934
                else
935
                {
936
                    ProcConstrCode = m_ConstructionCode;
937
                }
938

  
1067
                // ?e?R?[?h???????????????
939 1068
                string strLedger = LedgerDB.CreatePrimarykeyString(ProcConstrCode);
940 1069
                ConstructionLedger LedgerRec = new ConstructionLedger();
941 1070
                // ?f?[?^??????????????????
......
944 1073
                // ?????????????????????????
945 1074
                if (LedgerRec.ComplateFlg == (int)CommonDefine.ComplateTitleNo.Complated) return true;
946 1075

  
947
                // ?H???S????R?[?h??
948
                ComboBox ConstructorCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstructionPersonCode];
949
                int ConstrPersonCode = CommonMotions.cnvInt(ConstructorCombBox.SelectedValue);
950
                string ConstrPersonName = ConstructorCombBox.SelectedText;
951

  
952
                // ?H?????S????R?[?h??
953
                ComboBox AssistantCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstrSubPersonCode];
954
                int AssistantCode = CommonMotions.cnvInt(AssistantCombBox.SelectedValue);
955
                string AssistantName = AssistantCombBox.SelectedText;
956

  
957
                // ?H???w?????R?[?h??
958
                ComboBox InstCombBox = (ComboBox)m_DspCtrl[(int)DspCnt.ConstructionInstructor];
959
                int InstructorCode = CommonMotions.cnvInt(InstCombBox.SelectedValue);
960
                string InstructorName = InstCombBox.SelectedText;
961

  
962
                // ?S?????}?X?^?f?[?^??
963
                string strPerson = PersonDB.CreatePrimarykeyString(ConstrPersonCode);
964
                PersonInChargeMaster personRec = new PersonInChargeMaster();
965
                PersonDB.SelectAction(strPerson, ref personRec, false);
966

  
967
                // ?S????????o???
968
                ArrayList ExpensesList = new ArrayList();
969
                GetExpensesList(personRec.DepartmentCode, ref ExpensesList);
970

  
971
                // ----- ?H???????f?[?^????
972 1076
                /// ?f?[?^?Z?b?g?E??X????
973 1077
                bool bChangeCode = false;
974

  
1078
                object[] objRec = (object[])ParentData[0];
975 1079
                // ----- ?H??????????f?[?^????
976 1080
                // ?H???S????
977 1081
                if (!LedgerDetailDataSalarySet(LedgerDDB, ProcConstrCode, frm, TotalOrdersPrice, (int)FrmConstructionLedger.DataGroup.Payroll,
978
                                                    ConstrPersonCode, ConstrPersonName, personRec.MonthlySalary,
979
                                                    ExpensesList, LedgerRec,
980
                                                    ref bChangeCode)) return false;
1082
                                                    objRec, LedgerRec, ref bChangeCode)) return false;
981 1083

  
982 1084
                // ?H?????S????
983 1085
                if (!LedgerDetailDataSalarySet(LedgerDDB, ProcConstrCode, frm, TotalOrdersPrice, (int)FrmConstructionLedger.DataGroup.Assistant,
984
                                                    AssistantCode, AssistantName, (double)CommonDefine.AssistantMonthryCost,
985
                                                    ExpensesList, LedgerRec,
986
                                                    ref bChangeCode)) return false;
1086
                                                    objRec, LedgerRec, ref bChangeCode)) return false;
987 1087

  
988 1088
                // ?H???w????
989 1089
                if (!LedgerDetailDataSalarySet(LedgerDDB, ProcConstrCode, frm, TotalOrdersPrice, (int)FrmConstructionLedger.DataGroup.Instructor,
990
                                                    InstructorCode, InstructorName, (double)CommonDefine.InstructorMonthryCost,
991
                                                    ExpensesList, LedgerRec,
992
                                                    ref bChangeCode)) return false;
1090
                                                    objRec, LedgerRec, ref bChangeCode)) return false;
993 1091

  
994
                // ?H????????????
995
                ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
996
                string strBase = cbiDB.CreatePrimarykeyString(ProcConstrCode);
997
                if (!cbiDB.SelectAction(strBase, ref BaseRec, false)) return false;
998
                // ?H????`?F?b?N
999
                DateTime StDate = BaseRec.ConstructionPeriodStart;
1000
                DateTime EdDate = BaseRec.ConstructionPeriodEnd;
1001
                // ??????????????????????
1002
                if (BaseRec.ConstructionPeriodEnd2 != DateTime.MinValue) EdDate = BaseRec.ConstructionPeriodEnd2;
1003
                if (StDate != LedgerRec.ConstructionStart) bChangeCode = false;
1004
                if (EdDate != LedgerRec.ConstructionEnd) bChangeCode = false;
1005

  
1006 1092
                // ????????????????
1007 1093
                if (bChangeCode) LedgerReCalc = true;
1008
                ConstrCode = ProcConstrCode;
1009 1094

  
1095
                // ----- ?H???????f?[?^????
1096
                // ?_??H???J?n?E?_??H??????
1097
                DateTime StartDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.StartDate]);
1098
                DateTime CompDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.CompDate]);
1099
                if (LedgerRec.ConstructionStart != StartDT)
1100
                {
1101
                    if (!LedgerDB.UpdateFeild(LedgerRec.ConstructionCode,
1102
                                            (int)IOConstructionLedger.DataColumn.ConstructionStart,
1103
                                            StartDT,
1104
                                            false)) return false;
1105
                    LedgerReCalc = true;
1106
                }
1107
                if (LedgerRec.ConstructionEnd != CompDT)
1108
                {
1109
                    if (!LedgerDB.UpdateFeild(LedgerRec.ConstructionCode,
1110
                                            (int)IOConstructionLedger.DataColumn.ConstructionEnd,
1111
                                            CompDT,
1112
                                            false)) return false;
1113
                    LedgerReCalc = true;
1114
                }
1115

  
1010 1116
                return true;
1011 1117
            }
1012 1118
            catch (Exception ex)
......
1014 1120
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
1015 1121
                return false;
1016 1122
            }
1017
            finally
1018
            {
1019
                frm.Dispose(); frm = null;
1020
            }
1021 1123
        }
1022 1124
        #endregion
1023 1125

  
......
1049 1151
        /// <summary>
1050 1152
        /// ?H??????????F?S????E???S????E?w?????Z?b?g
1051 1153
        /// </summary>
1052
        /// <param name="LedgerDDB"></param>
1053
        /// <param name="frm"></param>
1054
        /// <param name="TotalOrdersPrice"></param>
1055
        /// <param name="GroupCode"></param>
1056
        /// <param name="ConstructorCode"></param>
1057
        /// <param name="ConstructorName"></param>
1058
        /// <param name="MonthryCost"></param>
1059
        /// <param name="ExpensesList"></param>
1060
        /// <param name="LedgerRec"></param>
1061
        /// <param name="bChangeCode"></param>
1062 1154
        /// <returns></returns>
1063 1155
        private bool LedgerDetailDataSalarySet(IOConstructionLedgerDetail LedgerDDB, int ProcConstrCode, FrmConstructionLedger frm
1064 1156
                                                    , int TotalOrdersPrice, int GroupCode
1065
                                                    , int ConstructorCode, string ConstructorName, double MonthryCost
1066
                                                    , ArrayList ExpensesList, ConstructionLedger LedgerRec
1067
                                                    , ref bool bChangeCode)
1157
                                                    , object[] objRec, ConstructionLedger LedgerRec, ref bool bChangeCode)
1068 1158
        {
1069 1159
            try
1070 1160
            {
......
1074 1164
                // ?H??????????f?[?^?????????????O?????????s
1075 1165
                bool bExists = LedgerDDB.SelectAction(strSQL, ref DetailRec, false);
1076 1166

  
1077
                // ?S?????????????????????
1078
                if (DetailRec.CompanyCode == ConstructorCode) return true;
1167
                bool CurDataChange = false;
1079 1168

  
1080
                // ??????N???A???????????f?[?^???Z?b?g
1081
                if (ConstructorCode == 0)
1169
                int ConstructorCode = 0;
1170
                double MonthryCost = 0;
1171
                switch (GroupCode)
1082 1172
                {
1083
                    ClearConstructionLedgerDetailRec(ref DetailRec);
1084
                    if (bExists)
1085
                    {
1086
                        if (!LedgerDDB.UpdateAction(strSQL, DetailRec, false)) return false;
1087
                    }
1088
                    return true;
1173
                    // ?H???S????
1174
                    case (int)FrmConstructionLedger.DataGroup.Payroll:
1175
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ConstrPersonCode]);
1176
                        MonthryCost = CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ConstrPersonSalary]);
1177
                        break;
1178
                    // ?H?????S????
1179
                    case (int)FrmConstructionLedger.DataGroup.Assistant:
1180
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.AssistPersonCode]);
1181
                        MonthryCost = CommonDefine.AssistantMonthryCost;
1182
                        break;
1183

  
1184
                    // ?H???w????
1185
                    case (int)FrmConstructionLedger.DataGroup.Instructor:
1186
                        ConstructorCode = CommonMotions.cnvInt(objRec[(int)ReadParentOrder.InstrPersonCode]);
1187
                        MonthryCost = CommonDefine.InstructorMonthryCost;
1188
                        break;
1089 1189
                }
1090 1190

  
1091
                // ???S?????g?p?I??
1092
                if (bExists)
1191
                // ?f?[?^????????A?S?????????????S?????g?p?I??
1192
                if (bExists && DetailRec.CompanyCode != ConstructorCode)
1093 1193
                {
1094 1194
                    if (!LedgerDDB.UpdateFeild(DetailRec.ConstructionCode,
1095 1195
                                            (int)IOConstructionLedgerDetail.DataColumn.OperatingFlg,
......
1097 1197
                                            DetailRec.GroupCount,
1098 1198
                                            DetailRec.LineCount,
1099 1199
                                            false)) return false;
1200
                    // ?f?[?^??X?L
1201
                    CurDataChange = true;
1100 1202
                }
1101 1203

  
1204
                // ????H????
1205
                DateTime StartDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.StartDate]);
1206
                DateTime CompDT = CommonMotions.cnvDate(objRec[(int)ReadParentOrder.CompDate]);
1207

  
1208
                // ?V?K?f?[?^??????o?^?????
1209
                if (ConstructorCode == 0) return true;
1210

  
1211
                // ?S??????????????????????????????
1212
                if (bExists && DetailRec.CompanyCode == ConstructorCode
1213
                    && LedgerRec.ConstructionStart == StartDT && LedgerRec.ConstructionEnd == CompDT) return true;
1214

  
1102 1215
                // ???^???z?Z?b?g
1103 1216
                double ExecutionAmount = 0;
1104 1217
                double AmountConfigRate = 0;
1105
                CalcPayValueData(MonthryCost, TotalOrdersPrice,
1106
                                LedgerRec.ConstructionStart, LedgerRec.ConstructionEnd,
1107
                                ref ExecutionAmount, ref AmountConfigRate);
1218
                CalcPayValueData(MonthryCost, TotalOrdersPrice, StartDT, CompDT, ref ExecutionAmount, ref AmountConfigRate);
1108 1219

  
1109 1220
                // ----- ?V?S?????H???\?Z??????f?[?^??
1110
                DetailRec.ConstructionCode = ProcConstrCode;                                // ?H?????
1111
                DetailRec.GroupCount = GroupCode;                                           // ?O???[?v???
1112
                DetailRec.LineCount++;                                                      // ?s???
1221
                ClearConstructionLedgerDetailRec(ref DetailRec);
1113 1222
                frm.GetTitileParametar = GroupCode;
1114 1223
                DetailRec.FirstString = frm.GetTitleString;                                 // ???????
1115 1224
                DetailRec.SecondString = string.Empty;                                      // ?H?????e
1116 1225
                DetailRec.CompanyType = (int)CommonDefine.SearchLogDataType.Person;         // ??????R?[?h?^?C?v
1117 1226
                DetailRec.CompanyCode = ConstructorCode;                                    // ??????R?[?h
1118
                DetailRec.CompanyName = ConstructorName;                                    // ?????????
1119 1227
                DetailRec.ExecutionAmount = ExecutionAmount;                                // ???s???z
1120 1228
                DetailRec.AmountConfigRate = AmountConfigRate;                              // ???z?\????
1121 1229

  
......
1123 1231
                DetailRec.SalaryDays = 0;                                                   // ???^?U??????
1124 1232
                DetailRec.OperatingFlg = (int)CommonDefine.SalaryOperateKind.Oparateing;    // ?S?????t???O
1125 1233

  
1126
                // ?f?[?^???
1127
                if (!LedgerDDB.InsertAction(DetailRec, false)) return false;
1234
                if (bExists && !CurDataChange)
1235
                {
1236
                    // ?f?[?^???
1237
                    if (!LedgerDDB.UpdateAction(strSQL, DetailRec, false)) return false;
1238
                }
1239
                else
1240
                {
1241
                    DetailRec.ConstructionCode = ProcConstrCode;                                // ?H?????
1242
                    DetailRec.GroupCount = GroupCode;                                           // ?O???[?v???
1243
                    DetailRec.LineCount++;                                                      // ?s???
1244
                    // ?f?[?^???
1245
                    if (!LedgerDDB.InsertAction(DetailRec, false)) return false;
1246
                }
1128 1247

  
1248
                CurDataChange = true;
1129 1249

  
1130 1250
                // ?S?????????
1131 1251
                if (GroupCode == (int)FrmConstructionLedger.DataGroup.Payroll)
1132 1252
                {
1253
                    ArrayList ExpensesList = new ArrayList();
1254
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName1]),
1255
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio1]),
1256
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode1]) });
1257
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName2]),
1258
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio2]),
1259
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode2]) });
1260
                    ExpensesList.Add(new object[] { CommonMotions.cnvString(objRec[(int)ReadParentOrder.ExpensesName3]),
1261
                                                    CommonMotions.cnvDouble(objRec[(int)ReadParentOrder.ExpensesRatio3]),
1262
                                                    CommonMotions.cnvInt(objRec[(int)ReadParentOrder.ExpensesCode3]) });
1133 1263
                    // ?o??f?[?^?X?V?i?S????????????????????????????????v?Z?j
1134 1264
                    if (!LedgerSetExpenses(LedgerDDB, ProcConstrCode, TotalOrdersPrice, ExpensesList)) return false;
1135 1265
                }
1136 1266

  
1137 1267
                // ?f?[?^??X?L
1138
                bChangeCode = true;
1268
                if (CurDataChange) bChangeCode = true;
1139 1269
                
1140 1270
                return true;
1141 1271
            }
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
912 912
                m_DspCtrl[(int)DspCnt.PurchaseOrderReturnCheckDate].Text = CommonMotions.cnvDateToUndecidedString(worklist[0].PurchaseOrderReturnCheckDate);    // ??????????m?F??
913 913

  
914 914
                if (worklist[0].TyingFlg == (int)CommonDefine.BaseInfoTyingFlg.Pearent)
915
                {
915
                {   // ?????e?H??
916 916
                    rdbExistsFluctuation.Checked = true;                                // ?????H?????W?I?{?^??
917 917
                    btnFluctuation.Enabled = true;                                      // ?????H???{?^??
918 918
                }
919
                else if (worklist[0].TyingFlg == (int)CommonDefine.BaseInfoTyingFlg.Tying)
920
                {   // ?????q?H??
921
                    rdbExistsFluctuation.Checked = true;                                // ?????H?????W?I?{?^??
922
                    label81.Visible = false;
923
                    label82.Visible = false;
924
                    textBoxEX4.Visible = false;
925
                    textBoxEX5.Visible = false;
926
                }
919 927

  
920 928
                // ?????t???O
921 929
                //if (worklist[0].ConsumptionTaxFlg == 1)
......
2221 2229
        /// </summary>
2222 2230
        /// <param name="cbiDB"></param>
2223 2231
        /// <param name="work"></param>
2224
        private DateTime FluctuationDataPeriodEnd()
2232
        private void FluctuationDataPeriodEnd(ref DateTime StartDate, ref DateTime LastDate)
2225 2233
        {
2226 2234
            IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
2227 2235
            try
2228 2236
            {
2229
                DateTime LastDate = DateTime.MinValue;
2237
                StartDate = DateTime.Now;
2238
                LastDate = DateTime.Now;
2230 2239

  
2231
                string strSQL = "SELECT TYINGFLG, CONSTRUCTIONPERIODEND, CONSTRUCTIONPERIODEND2 FROM CONSTRUCTIONBASEINFO";
2232
                strSQL += string.Format(" WHERE (TRUNC(CONSTRUCTIONCODE / 100) = {0})", (int)(m_ConstructionCode / 100));
2233
                strSQL += string.Format(" AND (TYINGFLG = {0} OR TYINGFLG = {1}) ORDER BY 1"
2240
                string strSQL = "SELECT MIN(CONSTRUCTIONPERIODSTART), MAX(CONSTRUCTIONPERIODEND) FROM CONSTRUCTIONBASEINFO";
2241
                strSQL += string.Format(" WHERE (TRUNC(CONSTRUCTIONCODE / 100) = {0})", CommonMotions.cnvTruncate(m_ConstructionCode / 100));
2242
                strSQL += string.Format(" AND (TYINGFLG = {0} OR TYINGFLG = {1})"
2234 2243
                                        , (int)CommonDefine.BaseInfoTyingFlg.Pearent, (int)CommonDefine.BaseInfoTyingFlg.Tying);
2244
                strSQL += string.Format(" AND CONSTRUCTIONPERIODSTART != TO_DATE('{0}')", DateTime.MinValue.ToShortDateString());
2235 2245
                ArrayList Arlist = new ArrayList();
2236
                if (!cbiDB.ExecuteReader(strSQL, ref Arlist)) return LastDate;
2237
                if (Arlist.Count == 0) return LastDate;
2246
                if (!cbiDB.ExecuteReader(strSQL, ref Arlist)) return;
2247
                if (Arlist.Count == 0) return;
2248
                object[] objRec = (object[])Arlist[0];
2249
                StartDate = CommonMotions.cnvDate(objRec[0]);
2250
                LastDate = CommonMotions.cnvDate(objRec[1]);
2238 2251

  
2239
                foreach (object[] objCur in Arlist)
2240
                {
2241
                    DateTime EndDate = CommonMotions.cnvDate(objCur[1]);
2242
                    DateTime ExtDate = CommonMotions.cnvDate(objCur[2]);
2243
                    // ?_??H???I????????l???????????????
2244
                    if (EndDate > LastDate) LastDate = EndDate;
2245
                    // ?_??H???I???i?????j??????l???????????????
2246
                    if (ExtDate > LastDate) LastDate = ExtDate;
2247
                }
2248
                return LastDate;
2249 2252
            }
2250 2253
            catch (System.Exception ex)
2251 2254
            {
2252 2255
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
2253
                return DateTime.MinValue;
2254 2256
            }
2255 2257
            finally
2256 2258
            {
......
2266 2268
        /// <param name="BaseDB"></param>
2267 2269
        /// <param name="LastDate"></param>
2268 2270
        /// <returns></returns>
2269
        private bool UpdateConstrEndDate(IOConstructionBaseInfo BaseDB, DateTime LastDate)
2271
        private bool UpdateConstrEndDate(IOConstructionBaseInfo BaseDB, DateTime StartDate, DateTime LastDate)
2270 2272
        {
2271 2273
            try
2272 2274
            {
......
2276 2278
                if (BaseList.Count == 0) return false;
2277 2279

  
2278 2280
                // ?H???I???E?H???I???i?????j???????I????X?V?????????????????
2279
                if (BaseList[0].ConstructionPeriodEnd == LastDate) return true;
2280
                if (BaseList[0].ConstructionPeriodEnd2 == LastDate) return true;
2281
                if (BaseList[0].ConstructionPeriodStart2 != StartDate)
2282
                {
2283
                    // ?????H????e???R?[?h??_??H???J?n?i?????j???X?V????
2284
                    if (!BaseDB.UpdateFeild(BaseList[0].ConstructionCode,
2285
                                            (int)IOConstructionBaseInfo.TableColumn.CONSTRUCTIONPERIODSTART2,
2286
                                            StartDate,
2287
                                            false)) return false;
2288
                }
2289
                if (BaseList[0].ConstructionPeriodEnd2 != LastDate)
2290
                {
2291
                    // ?????H????e???R?[?h??_??H???I???i?????j???X?V????
2292
                    if (!BaseDB.UpdateFeild(BaseList[0].ConstructionCode,
2293
                                            (int)IOConstructionBaseInfo.TableColumn.CONSTRUCTIONPERIODEND2,
2294
                                            LastDate,
2295
                                            false)) return false;
2296
                }
2281 2297

  
2282
                // ?????H????e???R?[?h??_??H???J?n?i?????j???X?V????
2283
                if (!BaseDB.UpdateFeild(BaseList[0].ConstructionCode,
2284
                                        (int)IOConstructionBaseInfo.TableColumn.CONSTRUCTIONPERIODSTART2,
2285
                                        BaseList[0].ConstructionPeriodEnd.AddDays(1),
2286
                                        false)) return false;
2287
                // ?????H????e???R?[?h??_??H???I???i?????j???X?V????
2288
                if (!BaseDB.UpdateFeild(BaseList[0].ConstructionCode,
2289
                                        (int)IOConstructionBaseInfo.TableColumn.CONSTRUCTIONPERIODEND2,
2290
                                        LastDate,
2291
                                        false)) return false;
2292

  
2293 2298
                return true;
2294 2299
            }
2295 2300
            catch (System.Exception ex)
......
2509 2514
                }
2510 2515

  
2511 2516
                bool TyingDataFlag = false;
2517
                DateTime StConstrDate = DateTime.MinValue;
2512 2518
                DateTime LastConstrDate = DateTime.MinValue;
2513 2519

  
2514 2520
                // ?????H????e????????q?????
......
2521 2527
                //if ((pnlFluctuation.Visible == true && rdbExistsFluctuation.Checked == true) || (pnlFluctuation.Visible == false)) LastDateUpDate = true;
2522 2528

  
2523 2529
                // ?????H????e????????q??????????H???I??????????
2524
                if (TyingDataFlag) LastConstrDate = FluctuationDataPeriodEnd();
2530
                if (TyingDataFlag) FluctuationDataPeriodEnd(ref StConstrDate, ref LastConstrDate);
2525 2531

  
2526 2532
                // ???????????????s??
2527 2533
                cbiDB.connect(); cbiDB.beginTran();
......
2560 2566
                // ?????H????e????????q?????_??H???I???i?????j???X?V????
2561 2567
                if (TyingDataFlag)
2562 2568
                {
2563
                    if (!UpdateConstrEndDate(cbiDB, LastConstrDate))
2569
                    if (!UpdateConstrEndDate(cbiDB, StConstrDate, LastConstrDate))
2564 2570
                    {
2565 2571
                        MessageBox.Show("?H??????????H???o?^?G???[????B", "?o?^?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
2566 2572
                        cbiDB.rollback();
2567 2573
                        cbidDB.rollback();
2568 2574
                        cpdDB.rollback();
2575
                        cbLinkDB.rollback();
2569 2576
                        return false;
2570 2577
                    }
2571 2578
                }
......
2573 2580
                // ????H?????????z???W?v????
2574 2581
                TotalOrdersPrice = FluctuationDataOrdersPrice(cbiDB);
2575 2582

  
2583
                // ?e?f?[?^???r???????????
2584
                ArrayList ParentData = new ArrayList();
2585
                int ProcConstrCode = 0;
2586
                if (!GetFluctuationParent(cbiDB, cbLinkDB, TyingDataFlag, ref ParentData, ref ProcConstrCode))
2587
                {
2588
                    MessageBox.Show("?H???????G???[????B", "???G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
2589
                    cbiDB.rollback();
2590
                    cbidDB.rollback();
2591
                    cpdDB.rollback();
2592
                    cbLinkDB.rollback();
2593
                    return false;
2594
                }
2595

  
2576 2596
                // ?H???\?Z???f?[?^?X?V
2577
                if (!BudgetDataChange(ApprovalDB, BudgetDB, BudgetDDB, PersonDB, TotalOrdersPrice))
2597
                if (!BudgetDataChange(ApprovalDB, BudgetDB, BudgetDDB, PersonDB, TotalOrdersPrice, ParentData, ProcConstrCode))
2578 2598
                {
2579 2599
                    MessageBox.Show("?H???\?Z???f?[?^?X?V?G???[????B", "?X?V?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
2580 2600
                    cbiDB.rollback();
2581 2601
                    cbidDB.rollback();
2582 2602
                    cpdDB.rollback();
2603
                    cbLinkDB.rollback();
2583 2604

  
2584 2605
                    ApprovalDB.rollback();
2585 2606
                    BudgetDB.rollback();
......
2589 2610
                }
2590 2611

  
2591 2612
                bool bLedgerReCalc = false;
2592
                int ProcConstrCode = 0;
2593 2613
                // ?H???????f?[?^?X?V
2594
                if (!LedgerDataChange(cbiDB, LedgerDB, LedgerDDB, LedgerEDB, PersonDB, cbLinkDB, TotalOrdersPrice, TyingDataFlag, ref bLedgerReCalc, ref ProcConstrCode))
2614
                if (!LedgerDataChange(cbiDB, LedgerDB, LedgerDDB, LedgerEDB, PersonDB, cbLinkDB,
2615
                                        TotalOrdersPrice, TyingDataFlag, frm, ParentData, ProcConstrCode,
2616
                                        ref bLedgerReCalc, ref ProcConstrCode))
2595 2617
                {
2596 2618
                    MessageBox.Show("?H???????f?[?^?X?V?G???[????B", "?X?V?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
2597 2619
                    cbiDB.rollback();
2598 2620
                    cbidDB.rollback();
2599 2621
                    cpdDB.rollback();
2622
                    cbLinkDB.rollback();
2600 2623

  
2601 2624
                    ApprovalDB.rollback();
2602 2625
                    PersonDB.rollback();
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs
193 193
            /// </summary>
194 194
            FluctuationFlg,
195 195
            /// <summary>
196
            /// ???^?U????
197
            /// </summary>
198
            SalaryFlg,
199
            /// <summary>
200
            /// ???^?U??????
201
            /// </summary>
202
            SalaryDays,
203
            /// <summary>
204
            /// ?S?????t???O
205
            /// </summary>
206
            OperatingFlg,
207
            /// <summary>
196 208
            /// ?x?????z1?J????
197 209
            /// </summary>
198 210
            payment,
......
305 317
        /// </summary>
306 318
        private static Color s_CommonCalculatedValueFColor = Color.White;
307 319
        #endregion
308
        
320

  
309 321
        #region ?O???b?h????s?^?C?g??
310 322
        /// <summary>
311 323
        /// ?O???b?h????s?^?C?g??
......
450 462

  
451 463
        #endregion
452 464

  
453
        #region ?????N???X
454
        /// <summary>
455
        /// ?S????E???S????E?w????????N???X
456
        /// </summary>
457
        private class PersonSalaryData
458
        {
459
            /// <summary>
460
            ///  ?O???[?v???
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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