プロジェクト

全般

プロフィール

リビジョン 364

堀内6年以上前に追加

グリッド右クリック追加
メッセージデータ:サイクリック処理修正

差分を表示:

branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsSystemOnceExecute.cs
293 293
        /// </summary>
294 294
        private bool MakeSecretaryMassageData(IOMessageBoardData mbdDB,
295 295
                                        IOMessageBoardTerget mbtDB,
296
                                        IOMessageBrowsingHistory mbhDB,
297
                                        IORecordKey RecDB,
296 298
                                        IOConstructionBaseInfoDetail cbiDB,
297 299
                                        MaterialRecordInfo wrkRec, TermMaster CheckRec, DateTime CriteriaDate)
298 300
        {
......
360 362
                WriteData.MessageFlag = (int)MessageBoardData.MessageFlgDef.Secretary;
361 363

  
362 364
                // 掲示板へメッセージを載せる
363
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, WriteData, WriteDetail)) return false;
365
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, mbhDB, RecDB, WriteData, WriteDetail)) return false;
364 366

  
365 367
                return true;
366 368
            }
......
383 385
            IOConstructionBaseInfoDetail cbiDDB = new IOConstructionBaseInfoDetail();
384 386
            IOMessageBoardData mbdDB = new IOMessageBoardData();
385 387
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
388
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();
389
            IORecordKey RecDB = new IORecordKey();
386 390

  
387 391
            StringBuilder strSQL = new StringBuilder();
388 392

  
......
392 396
                cbiDDB.connect(); cbiDDB.beginTran();
393 397
                mbdDB.connect(); mbdDB.beginTran();
394 398
                mbtDB.connect(); mbtDB.beginTran();
399
                mbhDB.connect(); mbhDB.beginTran();
400
                RecDB.connect(); RecDB.beginTran();
395 401

  
396 402
                bool procflg = true;
397 403

  
......
414 420
                        MaterualStatusCheck(wrkRec, ref term);
415 421

  
416 422
                        // メッセージ作成 掲示板にメッセージを載せる処理
417
                        if (!MakeSecretaryMassageData(mbdDB, mbtDB, cbiDDB, wrkRec, term, StartDate))
423
                        if (!MakeSecretaryMassageData(mbdDB, mbtDB, mbhDB, RecDB, cbiDDB, wrkRec, term, StartDate))
418 424
                        {
419 425
                            procflg = false;
420 426
                            break;
......
427 433
                        cbiDDB.commit();
428 434
                        mbdDB.commit();
429 435
                        mbtDB.commit();
436
                        mbhDB.commit();
437
                        RecDB.commit();
430 438
                    }
431 439
                    else
432 440
                    {
......
434 442
                        cbiDDB.rollback();
435 443
                        mbdDB.rollback();
436 444
                        mbtDB.rollback();
445
                        mbhDB.rollback();
446
                        RecDB.rollback();
437 447
                    }
438 448

  
439 449
                    return procflg;
......
450 460
                cbiDDB.close(); cbiDDB = null;
451 461
                mbdDB.close(); mbdDB = null;
452 462
                mbtDB.close(); mbtDB = null;
463
                mbhDB.close(); mbhDB = null;
464
                RecDB.close(); RecDB = null;
453 465
            }
454 466
            return true;
455 467
        }
......
512 524
            IOConstructionBaseInfoDetail cbiDDB = new IOConstructionBaseInfoDetail();
513 525
            IOMessageBoardData mbdDB = new IOMessageBoardData();
514 526
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
527
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();
528
            IORecordKey RecDB = new IORecordKey();
515 529
            try
516 530
            {
517 531
                // チェック項目取得
......
544 558
                cbiDDB.connect(); cbiDDB.beginTran();
545 559
                mbdDB.connect(); mbdDB.beginTran();
546 560
                mbtDB.connect(); mbtDB.beginTran();
561
                mbhDB.connect(); mbhDB.beginTran();
562
                RecDB.connect(); RecDB.beginTran();
547 563

  
548 564
                bool procflg = true;
549 565
                ConstructionBaseInfo wrkBaseRec = new ConstructionBaseInfo();
......
583 599
                        foreach (TermMaster CurTerm in term)
584 600
                        {
585 601
                            // メッセージ作成
586
                            if (!MakeMassageData(mbdDB, mbtDB, cbiDDB, wrkBaseRec, CurTerm, CriteriaDate))
602
                            if (!MakeMassageData(mbdDB, mbtDB, mbhDB, RecDB, cbiDDB, wrkBaseRec, CurTerm, CriteriaDate))
587 603
                            {   // エラー時に抜ける
588 604
                                procflg = false;
589 605
                                break;
......
600 616
                    cbiDDB.rollback();
601 617
                    mbdDB.rollback();
602 618
                    mbtDB.rollback();
619
                    mbhDB.rollback();
620
                    RecDB.rollback();
603 621
                }
604 622

  
605 623
                return procflg;
......
615 633
                cbiDDB.commit();
616 634
                mbdDB.commit();
617 635
                mbtDB.commit();
636
                mbhDB.commit();
637
                RecDB.commit();
618 638

  
619 639
                cbiDB.close(); cbiDB = null;
620 640
                cbiDDB.close(); cbiDDB = null;
621 641
                mbdDB.close(); mbdDB = null;
622 642
                mbtDB.close(); mbtDB = null;
643
                mbhDB.close(); mbhDB = null;
644
                RecDB.close(); RecDB = null;
623 645
            }
624 646
        }
625 647
        #endregion
......
817 839
        /// </summary>
818 840
        private bool MakeMassageData(IOMessageBoardData mbdDB,
819 841
                                        IOMessageBoardTerget mbtDB,
842
                                        IOMessageBrowsingHistory mbhDB,
843
                                        IORecordKey RecDB,
820 844
                                        IOConstructionBaseInfoDetail cbiDB,
821 845
                                        ConstructionBaseInfo wrkRec, TermMaster CheckRec, DateTime CriteriaDate)
822 846
        {
......
893 917
                WriteData.MessageFlag = (int)MessageBoardData.MessageFlgDef.Secretary;
894 918

  
895 919
                // 掲示板へメッセージを載せる
896
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, WriteData, WriteDetail)) return false;
920
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, mbhDB, RecDB, WriteData, WriteDetail)) return false;
897 921

  
898 922
                return true;
899 923
            }
branches/src/DataCheckExcute/DataCheckExcute/DataCheckExcute.csproj
349 349
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\PurchaseOrderDetail.cs">
350 350
      <Link>DataModel\PurchaseOrderDetail.cs</Link>
351 351
    </Compile>
352
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\RecordKey.cs">
353
      <Link>DataModel\RecordKey.cs</Link>
354
    </Compile>
352 355
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DataModel\RequestData.cs">
353 356
      <Link>DataModel\RequestData.cs</Link>
354 357
    </Compile>
......
718 721
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IOPurchaseOrderDetail.cs">
719 722
      <Link>DB\IOAccess\IOPurchaseOrderDetail.cs</Link>
720 723
    </Compile>
724
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IORecordKey.cs">
725
      <Link>DB\IOAccess\IORecordKey.cs</Link>
726
    </Compile>
721 727
    <Compile Include="..\..\ProcessManagement\ProcessManagement\DB\IOAccess\IORequestData.cs">
722 728
      <Link>DB\IOAccess\IORequestData.cs</Link>
723 729
    </Compile>
branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
14 14
        /// <summary>
15 15
        /// 本体バージョン
16 16
        /// </summary>
17
        public static int s_SystemVersion = 216;
17
        public static int s_SystemVersion = 217;
18 18

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsMessageBoradAccess.cs
36 36
        /// <returns></returns>
37 37
        public static bool CreateMessage(MessageBoardData WriteData, List<MessageBoardTerget> WriteDetail)
38 38
        {
39
            IOMessageBoardData mbdDB = new IOMessageBoardData();
40
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
39
            IOMessageBoardData DataDB = new IOMessageBoardData();
40
            IOMessageBoardTerget TergetDB = new IOMessageBoardTerget();
41
            IOMessageBrowsingHistory HistoryDB = new IOMessageBrowsingHistory();
42
            IORecordKey RecordDB = new IORecordKey();
41 43
            try
42 44
            {
43
                mbdDB.connect(); mbdDB.beginTran();
44
                mbtDB.connect(); mbtDB.beginTran();
45
                DataDB.connect(); DataDB.beginTran();
46
                TergetDB.connect(); TergetDB.beginTran();
47
                HistoryDB.connect(); HistoryDB.beginTran();
48
                RecordDB.connect(); RecordDB.beginTran();
45 49

  
46 50
                // キーコードセット
47
                WriteData.RecordNumber = mbdDB.SelectMaxMessageBoardDataKeyCount("", false) + 1;
51
                WriteData.RecordNumber = IOMessageBoardData.GetNewRecordNumber(DataDB, TergetDB, HistoryDB, RecordDB
52
                                                                        , (int)RecordKey.KeyNoDef.MessageKey, false);
48 53

  
49 54
                // データ登録
50
                if (!mbdDB.OneRecInsertAction(WriteData, false))
55
                if (!DataDB.OneRecInsertAction(WriteData, false))
51 56
                {
52 57
                    logger.ErrorFormat("掲示板メッセージ:登録に失敗しました。");
53
                    mbdDB.rollback();
54
                    mbtDB.rollback();
58
                    DataDB.rollback();
59
                    TergetDB.rollback();
60
                    HistoryDB.rollback();
61
                    RecordDB.rollback();
55 62
                    return false;
56 63
                }
57 64

  
......
63 70
                    wrk.SeqNum = icnt++;
64 71
                }
65 72
                // データ登録
66
                if (!mbtDB.InsertAction(WriteDetail, false))
73
                if (!TergetDB.InsertAction(WriteDetail, false))
67 74
                {
68 75
                    logger.ErrorFormat("掲示板対象者テーブル:登録に失敗しました。");
69
                    mbdDB.rollback();
70
                    mbtDB.rollback();
76
                    DataDB.rollback();
77
                    TergetDB.rollback();
78
                    HistoryDB.rollback();
79
                    RecordDB.rollback();
71 80
                    return false;
72 81
                }
73 82

  
74
                mbdDB.commit();
75
                mbtDB.commit();
83
                DataDB.commit();
84
                TergetDB.commit();
85
                HistoryDB.commit();
86
                RecordDB.commit();
76 87

  
77 88
                return true;
78 89
            }
......
83 94
            }
84 95
            finally
85 96
            {
86
                mbdDB.close(); mbdDB = null;
87
                mbtDB.close(); mbtDB = null;
97
                DataDB.close(); DataDB = null;
98
                TergetDB.close(); TergetDB = null;
99
                HistoryDB.close(); HistoryDB = null;
100
                RecordDB.close(); RecordDB = null;
88 101
            }
89 102
        }
90 103
        #endregion
......
94 107
        /// 掲示板データ登録(一括処理用)
95 108
        /// </summary>
96 109
        /// <returns></returns>
97
        public static bool CreateMessage(IOMessageBoardData mbdDB, IOMessageBoardTerget mbtDB, MessageBoardData WriteData, List<MessageBoardTerget> WriteDetail)
110
        public static bool CreateMessage(IOMessageBoardData mbdDB,
111
                                        IOMessageBoardTerget mbtDB,
112
                                        IOMessageBrowsingHistory HistroyDB,
113
                                        IORecordKey RecordDB,
114
                                        MessageBoardData WriteData,
115
                                        List<MessageBoardTerget> WriteDetail)
98 116
        {
99
            DBCommonMotions dbCom = new DBCommonMotions();
100 117
            try
101 118
            {
102 119
                // キーコードセット
103
                WriteData.RecordNumber = mbdDB.SelectMaxMessageBoardDataKeyCount("", false) + 1;
120
                WriteData.RecordNumber = IOMessageBoardData.GetNewRecordNumber(mbdDB, mbtDB, HistroyDB, RecordDB,
121
                                                                                (int)RecordKey.KeyNoDef.MessageKey, false);
104 122

  
105
                dbCom.connect();
106
                // 最大桁数をこえたら1に戻す
107
                int DataLen = dbCom.GetTableColumnLength("MessageBoardData", "RecordNumber", false);
108
                int DataMax = CommonMotions.CreateMaxNumeric(DataLen);
109
                if (WriteData.RecordNumber >= DataMax) WriteData.RecordNumber = 1;
110

  
111 123
                // データ登録
112 124
                if (!mbdDB.OneRecInsertAction(WriteData, false))
113 125
                {
......
136 148
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
137 149
                return false;
138 150
            }
139
            finally
140
            {
141
                dbCom.close(); dbCom = null;
142
            }
143 151
        }
144 152
        #endregion
145 153

  
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs
302 302
        /// </summary>
303 303
        private bool MakeSecretaryMassageData(IOMessageBoardData mbdDB,
304 304
                                        IOMessageBoardTerget mbtDB,
305
                                        IOMessageBrowsingHistory mbhDB ,
306
                                        IORecordKey RecDB,
305 307
                                        IOConstructionBaseInfoDetail cbiDB,
306 308
                                        MaterialRecordInfo wrkRec, TermMaster CheckRec, DateTime CriteriaDate)
307 309
        {
......
369 371
                WriteData.MessageFlag = (int)MessageBoardData.MessageFlgDef.Secretary;
370 372

  
371 373
                // 掲示板へメッセージを載せる
372
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, WriteData, WriteDetail)) return false;
374
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, mbhDB, RecDB, WriteData, WriteDetail)) return false;
373 375

  
374 376
                return true;
375 377
            }
......
392 394
            IOConstructionBaseInfoDetail cbiDDB = new IOConstructionBaseInfoDetail();
393 395
            IOMessageBoardData mbdDB = new IOMessageBoardData();
394 396
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
397
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();
398
            IORecordKey RecDB = new IORecordKey();
395 399

  
396 400
            StringBuilder strSQL = new StringBuilder();
397 401

  
......
401 405
                cbiDDB.connect(); cbiDDB.beginTran();
402 406
                mbdDB.connect(); mbdDB.beginTran();
403 407
                mbtDB.connect(); mbtDB.beginTran();
408
                mbhDB.connect(); mbhDB.beginTran();
409
                RecDB.connect(); RecDB.beginTran();
404 410

  
405 411
                bool procflg = true;
406 412

  
......
423 429
                        MaterualStatusCheck(wrkRec, ref term);
424 430

  
425 431
                        // メッセージ作成 掲示板にメッセージを載せる処理
426
                        if (!MakeSecretaryMassageData(mbdDB, mbtDB, cbiDDB, wrkRec, term, StartDate))
432
                        if (!MakeSecretaryMassageData(mbdDB, mbtDB, mbhDB, RecDB, cbiDDB, wrkRec, term, StartDate))
427 433
                        {
428 434
                            procflg = false;
429 435
                            break;
......
436 442
                        cbiDDB.commit();
437 443
                        mbdDB.commit();
438 444
                        mbtDB.commit();
445
                        mbhDB.commit();
446
                        RecDB.commit();
439 447
                    }
440 448
                    else
441 449
                    {
......
443 451
                        cbiDDB.rollback();
444 452
                        mbdDB.rollback();
445 453
                        mbtDB.rollback();
454
                        mbhDB.rollback();
455
                        RecDB.rollback();
446 456
                    }
447 457

  
448 458
                    return procflg;
......
459 469
                cbiDDB.close(); cbiDDB = null;
460 470
                mbdDB.close(); mbdDB = null;
461 471
                mbtDB.close(); mbtDB = null;
472
                mbhDB.close(); mbhDB = null;
473
                RecDB.close(); RecDB = null;
462 474
            }
463 475
            return true;
464 476
        }
......
521 533
            IOConstructionBaseInfoDetail cbiDDB = new IOConstructionBaseInfoDetail();
522 534
            IOMessageBoardData mbdDB = new IOMessageBoardData();
523 535
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
536
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();
537
            IORecordKey RecDB = new IORecordKey();
524 538
            try
525 539
            {
526 540
                // マスタ取得エラーは処理しない
......
553 567
                cbiDDB.connect(); cbiDDB.beginTran();
554 568
                mbdDB.connect(); mbdDB.beginTran();
555 569
                mbtDB.connect(); mbtDB.beginTran();
570
                mbhDB.connect(); mbhDB.beginTran();
571
                RecDB.connect(); RecDB.beginTran();
556 572

  
557 573
                bool procflg = true;
558 574
                ConstructionBaseInfo wrkBaseRec = new ConstructionBaseInfo();
......
592 608
                        foreach (TermMaster CurTerm in term)
593 609
                        {
594 610
                            // メッセージ作成
595
                            if (!MakeMassageData(mbdDB, mbtDB, cbiDDB, wrkBaseRec, CurTerm, CriteriaDate))
611
                            if (!MakeMassageData(mbdDB, mbtDB, mbhDB, RecDB, cbiDDB, wrkBaseRec, CurTerm, CriteriaDate))
596 612
                            {   // エラー時に抜ける
597 613
                                procflg = false;
598 614
                                break;
......
609 625
                    cbiDDB.rollback();
610 626
                    mbdDB.rollback();
611 627
                    mbtDB.rollback();
628
                    mbhDB.rollback();
629
                    RecDB.rollback();
612 630
                }
613 631

  
614 632
                return procflg;
......
624 642
                cbiDDB.commit();
625 643
                mbdDB.commit();
626 644
                mbtDB.commit();
645
                mbhDB.commit();
646
                RecDB.commit();
627 647

  
628 648
                cbiDB.close(); cbiDB = null;
629 649
                cbiDDB.close(); cbiDDB = null;
630 650
                mbdDB.close(); mbdDB = null;
631 651
                mbtDB.close(); mbtDB = null;
652
                mbhDB.close(); mbhDB = null;
653
                RecDB.close(); RecDB = null;
632 654
            }
633 655
        }
634 656
        #endregion
......
826 848
        /// </summary>
827 849
        private bool MakeMassageData(IOMessageBoardData mbdDB,
828 850
                                        IOMessageBoardTerget mbtDB,
851
                                        IOMessageBrowsingHistory mbhDB,
852
                                        IORecordKey RecDB,
829 853
                                        IOConstructionBaseInfoDetail cbiDB,
830 854
                                        ConstructionBaseInfo wrkRec, TermMaster CheckRec, DateTime CriteriaDate)
831 855
        {
......
902 926
                WriteData.MessageFlag = (int)MessageBoardData.MessageFlgDef.Secretary;
903 927

  
904 928
                // 掲示板へメッセージを載せる
905
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, WriteData, WriteDetail)) return false;
929
                if (!ClsMessageBoradAccess.CreateMessage(mbdDB, mbtDB, mbhDB, RecDB, WriteData, WriteDetail)) return false;
906 930

  
907 931
                return true;
908 932
            }
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardData.cs
481 481
        /// <summary>
482 482
        /// レコード番号の最大値を取得する
483 483
        /// </summary>
484
        /// <param name="AddSQLString"></param>
485
        /// <param name="bConnect"></param>
486
        /// <returns></returns>
487
        public int SelectMaxMessageBoardDataKeyCount(string AddSQLString, bool bConnect = true)
484
        public static int GetNewRecordNumber(IOMessageBoardData DataDB,
485
                                            IOMessageBoardTerget TergetDB,
486
                                            IOMessageBrowsingHistory HistroyDB,
487
                                            IORecordKey RecordDB,
488
                                            int nKeyNo, bool bConnect = true)
488 489
        {
489 490
            // インターフェース
490 491
            StringBuilder strcmd = new StringBuilder();
491
            ArrayList arData = new ArrayList();
492
            int iRet = 0;
493 492
            try
494 493
            {
495
                // SQL作成
496
                strcmd.AppendFormat("SELECT IFNULL(MAX(RecordNumber), 0) FROM MessageBoardData{0}", AddSQLString);
494
                // 最大レコード番号取得
495
                strcmd.Append("Select (IFNULL(RecordNumber, 0) + 1) As RecNo");
496
                strcmd.Append(" From Recordkey");
497
                strcmd.AppendFormat(" Where KeyNo = {0}", nKeyNo);
498
                ArrayList arData = new ArrayList();
499
                if (!RecordDB.ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return 0;
497 500

  
498
                // SQL実行
499
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
501
                // レコード番号取得
502
                object[] objwrk = (object[])arData[0];
503
                int nRecNo = CommonMotions.cnvInt(objwrk[0]);
504
                // MAXを越えれば1にする
505
                if (nRecNo > RecordKey.MaxRecCountDef[nKeyNo]) nRecNo = 1;
500 506

  
501
                // データセット
502
                foreach (object[] objwrk in arData)
503
                {
504
                    if (objwrk[0].ToString().Equals(""))
505
                        iRet = 0;
506
                    else
507
                        iRet = int.Parse(objwrk[0].ToString());
508
                }
507
                // 番号更新
508
                strcmd.Clear();
509
                strcmd.Append("UPDATE Recordkey");
510
                strcmd.AppendFormat(" Set RecordNumber = {0}", nRecNo);
511
                strcmd.AppendFormat(" Where KeyNo = {0}", nKeyNo);
512
                if (!RecordDB.ExecuteNonQuery(strcmd.ToString(), bConnect)) return 0;
513

  
514
                // データ存在確認
515
                strcmd.Clear();
516
                strcmd.Append("Select * From MessageBoardData");
517
                strcmd.AppendFormat(" Where RecordNumber = {0}", nRecNo);
518
                arData.Clear();
519
                if (!DataDB.ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return 0;
520
                // 無ければそのまま
521
                if (arData.Count < 1) return nRecNo;
522

  
523
                // あれば削除する
524
                DelAllMessageData(DataDB, TergetDB, HistroyDB, nRecNo, bConnect);
525

  
526
                return nRecNo;
509 527
            }
510 528
            catch (Exception ex)
511 529
            {
512 530
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
531
                return 0;
513 532
            }
514

  
515
            return iRet;
516 533
        }
517 534
        #endregion
518 535

  
......
523 540
        /// <param name="AddSQLString"></param>
524 541
        /// <param name="bConnect"></param>
525 542
        /// <returns></returns>
526
        public int SelectMaxMessageBoardDataBranchKeyCount(int RecordNumber, bool bConnect = true)
543
        public int GetMaxBranchNumber(int RecordNumber, bool bConnect = true)
527 544
        {
528 545
            // インターフェース
529 546
            StringBuilder strcmd = new StringBuilder();
......
555 572
            return iRet;
556 573
        }
557 574
        #endregion
575

  
576
        #region メッセージデータ一括削除
577
        /// <summary>
578
        /// メッセージデータ一括削除
579
        /// </summary>
580
        /// <returns></returns>
581
        public static void DelAllMessageData(IOMessageBoardData DataDB,
582
                                            IOMessageBoardTerget TergetDB,
583
                                            IOMessageBrowsingHistory HistoryDB
584
                                            , int KeyNumber, bool bConnect)
585
        {
586
            try
587
            {
588
                StringBuilder strcmd = new StringBuilder();
589
                strcmd.AppendFormat(" Where RecordNumber = {0}", KeyNumber);
590

  
591
                DataDB.DeleteAction(strcmd.ToString(), bConnect);
592
                TergetDB.DeleteAction(strcmd.ToString(), bConnect);
593
                HistoryDB.DeleteAction(strcmd.ToString(), bConnect);
594
            }
595
            catch (Exception ex)
596
            {
597
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
598
            }
599
        }
600
        #endregion
558 601
    }
559 602
}
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBoardDataTerget.cs
419 419
        /// <param name="AddSQLString"></param>
420 420
        /// <param name="bConnect"></param>
421 421
        /// <returns></returns>
422
        public int SelectMaxMessageBoardTergetKeyCount(string AddSQLString, bool bConnect = true)
422
        public int GetMaxRecordNumber(string AddSQLString, bool bConnect = true)
423 423
        {
424 424
            // インターフェース
425 425
            StringBuilder strcmd = new StringBuilder();
......
450 450
            return iRet;
451 451
        }
452 452
        #endregion
453

  
454
        #region 最大値を取得する(BranchNumber)
455
        /// <summary>
456
        /// 最大値を取得する(BranchNumber)
457
        /// </summary>
458
        /// <param name="AddSQLString"></param>
459
        /// <param name="bConnect"></param>
460
        /// <returns></returns>
461
        public int SelectMaxMessageBoardTergetBranchKeyCount(int RecordNumber, bool bConnect = true)
462
        {
463
            // インターフェース
464
            StringBuilder strcmd = new StringBuilder();
465
            ArrayList arData = new ArrayList();
466
            int iRet = 0;
467
            try
468
            {
469
                // SQL作成
470
                strcmd.Append("SELECT IFNULL(MAX(BranchNumber), 0) FROM MessageBoardTerget");
471
                strcmd.AppendFormat(" Where RecordNumber = {0}", RecordNumber);
472

  
473
                // SQL実行
474
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
475

  
476
                // データセット
477
                foreach (object[] objwrk in arData)
478
                {
479
                    if (objwrk[0].ToString().Equals(""))
480
                        iRet = 0;
481
                    else
482
                        iRet = int.Parse(objwrk[0].ToString());
483
                }
484
            }
485
            catch (Exception ex)
486
            {
487
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
488
            }
489

  
490
            return iRet;
491
        }
492
        #endregion
493

  
494
        #region 最大値を取得する(SeqNum)
495
        /// <summary>
496
        /// 最大値を取得する(SeqNum)
497
        /// </summary>
498
        /// <param name="AddSQLString"></param>
499
        /// <param name="bConnect"></param>
500
        /// <returns></returns>
501
        public int SelectMaxMessageBoardTergetBranchKeyCount(int RecordNumber, int BranchNumber, bool bConnect = true)
502
        {
503
            // インターフェース
504
            StringBuilder strcmd = new StringBuilder();
505
            ArrayList arData = new ArrayList();
506
            int iRet = 0;
507
            try
508
            {
509
                // SQL作成
510
                strcmd.AppendFormat("SELECT IFNULL(MAX(SeqNum), 0) FROM MessageBoardTerget{0}", CreatePrimarykeyString(RecordNumber, BranchNumber));
511

  
512
                // SQL実行
513
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
514

  
515
                // データセット
516
                foreach (object[] objwrk in arData)
517
                {
518
                    if (objwrk[0].ToString().Equals(""))
519
                        iRet = 0;
520
                    else
521
                        iRet = int.Parse(objwrk[0].ToString());
522
                }
523
            }
524
            catch (Exception ex)
525
            {
526
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
527
            }
528

  
529
            return iRet;
530
        }
531
        #endregion
532 453
    }
533 454
}
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMessageBrowsingHistory.cs
16 16
namespace ProcessManagement.DB.IOAccess
17 17
{
18 18
    /// <summary>
19
    /// 掲示板データアクセスクラス
19
    /// 掲示板履歴データアクセスクラス
20 20
    /// </summary>
21 21
    public class IOMessageBrowsingHistory : MySqlProcess
22 22
    {
......
381 381
        /// <param name="AddSQLString"></param>
382 382
        /// <param name="bConnect"></param>
383 383
        /// <returns></returns>
384
        public int SelectMaxSeqNoCount(string AddSQLString, bool bConnect = true)
384
        public int GetMaxSeqNo(string AddSQLString, bool bConnect = true)
385 385
        {
386 386
            // インターフェース
387 387
            StringBuilder strcmd = new StringBuilder();
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORecordKey.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Collections;
6

  
7
using log4net;
8
using MySql.Data.MySqlClient;           // Data Provider for MySql
9

  
10
using ProcessManagement.DB.MySql;
11

  
12
using ProcessManagement.DB.Core;
13
using ProcessManagement.DataModel;
14

  
15
using ProcessManagement.Common;
16

  
17
namespace ProcessManagement.DB.IOAccess
18
{
19
    /// <summary>
20
    /// レコード番号管理データアクセスクラス
21
    /// </summary>
22
    public class IORecordKey : MySqlProcess
23
    {
24
        #region 定義部
25
        /// <summary>
26
        /// log4netログを使用する
27
        /// </summary>
28
        private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
29
        #endregion
30

  
31
        #region 定数
32
        /// <summary>
33
        /// レコード番号管理データフィールド並び
34
        /// </summary>
35
        public enum TableColumn
36
        {
37
            KeyNo = 0,
38
            RecordNumber,
39
            EntryDate,
40
            UpdateDate,
41
        }
42
        #endregion
43

  
44
        #region コンストラクタ
45
        /// <summary>
46
        /// コンストラクタ
47
        /// </summary>
48
        /// <param name="ConnectionString"></param>
49
        public IORecordKey()
50
            : base(DBCommon.Instance.DBConnectString)
51
        {
52
        }
53

  
54
        #endregion
55

  
56
        #region レコード番号管理データ検索SQL作成
57
        /// <summary>
58
        /// レコード番号管理データ検索SQL作成
59
        /// </summary>
60
        /// <param name="AddSQLString">検索条件SQL文字列</param>
61
        /// <param name="data">レコード番号管理データデータ</param>
62
        /// <returns>true:成功 false:失敗</returns>
63
        private string CreateSelectSQL()
64
        {
65
            StringBuilder strcmd = new StringBuilder();
66
            try
67
            {
68
                strcmd.Append("SELECT ");
69

  
70
                bool bColFirst = true;
71
                string strWork = string.Empty;
72
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
73
                {
74
                    strWork = gender.ToString();
75
                    if (!bColFirst) strcmd.Append(",");
76
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
77
                    {
78
                        strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
79
                    }
80
                    else
81
                    {
82
                        strcmd.AppendFormat(" {0}", strWork);
83
                    }
84
                    bColFirst = false;
85
                }
86

  
87
                strcmd.Append(" FROM RecordKey");
88

  
89
                return strcmd.ToString();
90
            }
91
            catch (Exception ex)
92
            {
93
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
94
                return string.Empty;
95
            }
96
        }
97
        #endregion
98

  
99
        #region レコード番号管理データ複数件検索
100
        /// <summary>
101
        /// レコード番号管理データ複数件検索
102
        /// </summary>
103
        /// <param name="AddSQLString"></param>
104
        /// <param name="data"></param>
105
        /// <param name="bConnect"></param>
106
        /// <returns></returns>
107
        public bool SelectAction(string AddSQLString, ref List<RecordKey> data, bool bConnect = true)
108
        {
109
            // インターフェース
110
            StringBuilder strcmd = new StringBuilder();
111
            ArrayList arData = new ArrayList();
112

  
113
            try
114
            {
115
                // SQL作成
116
                strcmd.Append(CreateSelectSQL());
117
                strcmd.Append(AddSQLString);
118

  
119
                // SQL実行
120
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
121

  
122
                // データセット
123
                foreach (object[] objwrk in arData)
124
                {
125
                    RecordKey work = new RecordKey();
126
                    Reader2Struct(objwrk, ref work);
127
                    data.Add(work);
128
                }
129

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

  
140
        #region レコード番号管理データ1件検索
141
        /// <summary>
142
        /// レコード番号管理データ1件検索
143
        /// </summary>
144
        /// <param name="AddSQLString"></param>
145
        /// <param name="data"></param>
146
        /// <param name="bConnect"></param>
147
        /// <returns></returns>
148
        public bool SelectAction(string AddSQLString, ref RecordKey data, bool bConnect = true)
149
        {
150
            // インターフェース
151
            StringBuilder strcmd = new StringBuilder();
152
            ArrayList arData = new ArrayList();
153

  
154
            try
155
            {
156
                // SQL作成
157
                strcmd.Append(CreateSelectSQL());
158
                strcmd.Append(AddSQLString);
159

  
160
                // SQL実行
161
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
162
                if (arData.Count == 0) return false;
163

  
164
                // データセット
165
                foreach (object[] objwrk in arData)
166
                {
167
                    RecordKey work = new RecordKey();
168
                    Reader2Struct(objwrk, ref data);
169
                    break;
170
                }
171

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

  
182
        #region レコード番号管理データ複数件追加
183
        /// <summary>
184
        /// レコード番号管理データ複数件追加
185
        /// </summary>
186
        /// <param name="data"></param>
187
        /// <param name="bConnect"></param>
188
        /// <returns></returns>
189
        public bool InsertAction(List<RecordKey> data, bool bConnect = true)
190
        {
191
            StringBuilder strcmd = new StringBuilder();
192
            try
193
            {
194
                bool bColFirst = true;
195
                strcmd.Append("INSERT INTO RecordKey");
196

  
197
                strcmd.Append(" (");
198

  
199
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
200
                {
201
                    if (!bColFirst) strcmd.Append(", ");
202
                    strcmd.Append(gender.ToString());
203
                    bColFirst = false;
204
                }
205
                strcmd.Append(") VALUES");
206

  
207
                bool bDataFirst = true;
208
                foreach (RecordKey work in data)
209
                {
210
                    if (bDataFirst) strcmd.Append(" (");
211
                    else strcmd.Append(", (");
212

  
213
                    strcmd.AppendFormat("{0}", work.KeyNo);
214
                    strcmd.AppendFormat(",{0}", work.RecordNumber);
215

  
216
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
217
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
218
                    strcmd.Append(")");
219

  
220
                    bDataFirst = false;
221
                }
222

  
223
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
224

  
225
                return true;
226
            }
227
            catch (Exception ex)
228
            {
229
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
230
                return false;
231
            }
232
        }
233
        #endregion
234

  
235
        #region レコード番号管理データ1件追加
236
        /// <summary>
237
        /// レコード番号管理データ1件追加
238
        /// </summary>
239
        /// <param name="data"></param>
240
        /// <param name="bConnect"></param>
241
        /// <returns></returns>
242
        public bool InsertAction(RecordKey data, bool bConnect = true)
243
        {
244
            StringBuilder strcmd = new StringBuilder();
245
            try
246
            {
247
                bool bColFirst = true;
248
                strcmd.Append("INSERT INTO RecordKey");
249
                strcmd.Append(" (");
250
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
251
                {
252
                    if (!bColFirst) strcmd.Append(", ");
253
                    strcmd.Append(gender.ToString());
254
                    bColFirst = false;
255
                }
256
                strcmd.Append(") VALUES (");
257

  
258
                strcmd.AppendFormat("{0}", data.KeyNo);
259
                strcmd.AppendFormat(",{0}", data.RecordNumber);
260

  
261
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
262
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
263
                strcmd.Append(")");
264

  
265
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
266
                return true;
267
            }
268
            catch (Exception ex)
269
            {
270
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
271
                return false;
272
            }
273
        }
274
        #endregion
275

  
276
        #region レコード番号管理データ更新
277
        /// <summary>
278
        /// レコード番号管理データ更新
279
        /// </summary>
280
        /// <param name="AddSQLString">更新条件SQL文字列</param>
281
        /// <param name="data">レコード番号管理データデータ</param>
282
        /// <returns>true:成功 false:失敗</returns>
283
        public bool UpdateAction(string AddSQLString, RecordKey data, bool bConnect = true)
284
        {
285
            StringBuilder strcmd = new StringBuilder();
286
            try
287
            {
288

  
289
                strcmd.Append("UPDATE RecordKey");
290

  
291
                strcmd.Append(" SET");
292

  
293
                strcmd.AppendFormat("KeyNo = {0}", data.KeyNo);
294
                strcmd.AppendFormat(", RecordNumber = {0}", data.RecordNumber);
295

  
296
                strcmd.Append(", UpdateDate = NOW()");
297
                strcmd.Append(AddSQLString);
298

  
299
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
300

  
301
                return true;
302
            }
303
            catch (Exception ex)
304
            {
305
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
306
                return false;
307
            }
308
        }
309
        #endregion
310

  
311
        #region レコード番号管理データ削除
312
        /// <summary>
313
        /// レコード番号管理データ削除
314
        /// </summary>
315
        /// <param name="AddSQLString">削除条件SQL文字列</param>
316
        /// <param name="data">レコード番号管理データデータ</param>
317
        /// <returns>true:成功 false:失敗</returns>
318
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
319
        {
320
            // インターフェース
321
            StringBuilder strcmd = new StringBuilder();
322
            try
323
            {
324
                strcmd.AppendFormat("{0}{1}", "DELETE FROM RecordKey", AddSQLString);
325

  
326
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
327

  
328
                return true;
329
            }
330
            catch (Exception ex)
331
            {
332
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
333
                return false;
334
            }
335
        }
336
        #endregion
337

  
338
        #region 1項目更新処理
339
        /// <summary>
340
        /// 1項目の更新を行う
341
        /// </summary>
342
        /// <param name="PrimaryCode"></param>
343
        /// <param name="FeildNo"></param>
344
        /// <param name="value"></param>
345
        /// <param name="bConnect"></param>
346
        /// <returns></returns>
347
        public bool UpdateFeild(int PrimaryCode, int FeildNo, object value, bool bConnect = true)
348
        {
349
            StringBuilder strcmd = new StringBuilder();
350
            try
351
            {
352
                strcmd.Append("UPDATE RecordKey");
353

  
354
                strcmd.Append(" SET");
355
                switch (FeildNo)
356
                {
357
                    case (int)TableColumn.KeyNo:
358
                        strcmd.AppendFormat(" KeyNo = {0}", ((int)value).ToString());
359
                        break;
360
                    case (int)TableColumn.RecordNumber:
361
                        strcmd.AppendFormat(" RecordNumber = {0}", ((int)value).ToString());
362
                        break;
363
                }
364

  
365
                strcmd.Append(", UpdateDate = NOW()");
366
                strcmd.Append(CreatePrimarykeyString(PrimaryCode));
367

  
368
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
369

  
370
                return true;
371
            }
372
            catch (Exception ex)
373
            {
374
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
375
                return false;
376
            }
377
        }
378
        #endregion
379

  
380
        #region MySQLDataReaderより構造体へセットする
381
        /// <summary>
382
        /// MySQLDataReaderより構造体へセットする
383
        /// </summary>
384
        /// <param name="reader">MySQLDataReader</param>
385
        /// <param name="wrk">構造体</param>
386
        public void Reader2Struct(object[] objwrk, ref RecordKey wrk)
387
        {
388
            try
389
            {
390
                // データ取得
391
                wrk.KeyNo = int.Parse(objwrk[(int)TableColumn.KeyNo].ToString());
392
                wrk.RecordNumber = int.Parse(objwrk[(int)TableColumn.RecordNumber].ToString());
393

  
394
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
395
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
396
            }
397
            catch (MySqlException myex)
398
            {
399
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
400
            }
401
            catch (Exception ex)
402
            {
403
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
404
            }
405
        }
406

  
407
        #endregion
408

  
409
        #region 主キー検索の文字列を返す
410
        /// <summary>
411
        /// 主キー検索の文字列を返す
412
        /// </summary>
413
        /// <param name="UnitKey"></param>
414
        /// <returns>Where文字列</returns>
415
        public string CreatePrimarykeyString(int KeyNo)
416
        {
417
            StringBuilder strWork = new StringBuilder();
418
            try
419
            {
420
                strWork.AppendFormat(" Where KeyNo = {0}", KeyNo);
421
            }
422
            catch (Exception ex)
423
            {
424
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
425
            }
426

  
427
            return strWork.ToString();
428
        }
429
        #endregion
430

  
431
        #region レコード番号の最大値を取得する
432
        /// <summary>
433
        /// レコード番号の最大値を取得する
434
        /// </summary>
435
        /// <param name="AddSQLString"></param>
436
        /// <param name="bConnect"></param>
437
        /// <returns></returns>
438
        public long SelectMaxMessageBoardDataKeyCount(int KeyNo, bool bConnect = true)
439
        {
440
            int iRet = 0;
441
            IORecordKey keyDB = new IORecordKey();
442
            try
443
            {
444
                // インターフェース
445
                StringBuilder strcmd = new StringBuilder();
446
                ArrayList arData = new ArrayList();
447
                // SQL作成
448
                strcmd.Append("SELECT IFNULL(RecordNumber, 0) FROM RecordKey");
449
                strcmd.AppendFormat("Where KeyNo = {0}", KeyNo);
450

  
451
                // SQL実行
452
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
453

  
454
                // データセット
455
                object[] objwrk = (object[])arData[0];
456
                iRet = int.Parse(objwrk[0].ToString());
457
            }
458
            catch (Exception ex)
459
            {
460
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
461
            }
462
            finally
463
            {
464
                keyDB.close(); keyDB = null;
465
            }
466

  
467
            return iRet;
468
        }
469
        #endregion
470
    }
471
}
branches/src/ProcessManagement/ProcessManagement/DataModel/RecordKey.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace ProcessManagement.DataModel
8
{
9
    public class RecordKey
10
    {
11
        #region 定数
12

  
13
        #region 工事基本情報:結合工事フラグ
14
        /// <summary>
15
        /// 工事基本情報:結合工事フラグ
16
        /// </summary>
17
        public enum KeyNoDef
18
        {
19
            /// <summary>
20
            /// 1:結合無通常データ
21
            /// </summary>
22
            MessageKey = 1,
23
        }
24
        #endregion
25

  
26
        #region 最大値定義
27
        /// <summary>
28
        /// 最大値定義
29
        /// </summary>
30
        public static long[] MaxRecCountDef = new long[] { 0, 999999 };
31
        #endregion
32

  
33
        #endregion
34

  
35
        #region メンバ変数
36

  
37
        /// <summary>
38
        /// キーコード
39
        /// </summary>
40
        private int m_KeyNo = 0;
41
        /// <summary>
42
        /// レコード番号
43
        /// </summary>
44
        private int m_RecordNumber = 0;
45
        /// <summary>
46
        /// 登録日付
47
        /// </summary>
48
        private DateTime m_EntryDate = DateTime.Now;
49
        /// <summary>
50
        /// 更新日付
51
        /// </summary>
52
        private DateTime m_UpdateDate = DateTime.Now;
53

  
54
        #endregion
55

  
56
        #region コンストラクタ
57
        #endregion
58

  
59
        #region プロパティ
60
        /// <summary>
61
        /// キーコード
62
        /// </summary>
63
        public int KeyNo
64
        {
65
            get { return m_KeyNo; }
66
            set { m_KeyNo = value; }
67
        }
68
        /// <summary>
69
        /// レコード番号
70
        /// </summary>
71
        public int RecordNumber
72
        {
73
            get { return m_RecordNumber; }
74
            set { m_RecordNumber = value; }
75
        }
76
        /// <summary>
77
        /// 登録日付
78
        /// </summary>
79
        public DateTime EntryDate
80
        {
81
            set { m_EntryDate = value; }
82
            get { return m_EntryDate; }
83
        }
84
        /// <summary>
85
        /// 更新日付
86
        /// </summary>
87
        public DateTime UpdateDate
88
        {
89
            set { m_UpdateDate = value; }
90
            get { return m_UpdateDate; }
91
        }
92
        #endregion
93
    }
94
}
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs
1438 1438
                SetcmbConstructionTypeCombBox();            // ?H?????
1439 1439
                SetcmbTransferConstructionCombBox();        // ?H?????p
1440 1440

  
1441
                // ?????\??
1442
                InitDataLoad();
1443

  
1441 1444
                // ?R???{?{?b?N?X?C?x???g?Z?b?g
1442 1445
                SetcmbConstYearEvent(true);
1443 1446
                SetCmbDepartmentEvent(true);
......
1446 1449
                SetcmbConstrTypeEvent(true);
1447 1450
                SetcmbTransConstrEvent(true);
1448 1451

  
1449
                // ?????\??
1450
                InitDataLoad();
1451

  
1452 1452
                // ???b?N????
1453 1453
                LockTheFieldOnTheRadioButton();
1454 1454

  
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
1061 1061
                // ?\???E???F?E???????t??Z?b?g
1062 1062
                SetLabelDates();
1063 1063

  
1064
                SetCmbDepartmentEvent(true);
1064 1065
                // ?c??S????????Z?b?g??????
1065
                comboBoxEX1.SelectedValue = worklist[0].SalesDepCode;
1066
                cmbSalesPerson.SelectedValue = worklist[0].SalesPersonCode;
1066
                if (worklist[0].SalesDepCode > 0) comboBoxEX1.SelectedValue = worklist[0].SalesDepCode;
1067
                if (worklist[0].SalesPersonCode > 0) cmbSalesPerson.SelectedValue = worklist[0].SalesPersonCode;
1067 1068

  
1068 1069
                // ?c????S????????Z?b?g??????
1069
                comboBoxEX5.SelectedValue = worklist[0].SalesSubDepCode;
1070
                cmbSalesSubPerson.SelectedValue = worklist[0].SalesSubPersonCode;
1070
                if (worklist[0].SalesSubDepCode > 0) comboBoxEX5.SelectedValue = worklist[0].SalesSubDepCode;
1071
                if (worklist[0].SalesSubPersonCode > 0) cmbSalesSubPerson.SelectedValue = worklist[0].SalesSubPersonCode;
1071 1072

  
1072 1073
                // ?H???S????????Z?b?g??????
1073
                comboBoxEX2.SelectedValue = worklist[0].ConstrDepCode;
1074
                cmbConstrPerson.SelectedValue = worklist[0].ConstructionPersonCode;
1074
                if (worklist[0].ConstrDepCode > 0) comboBoxEX2.SelectedValue = worklist[0].ConstrDepCode;
1075
                if (worklist[0].ConstructionPersonCode > 0) cmbConstrPerson.SelectedValue = worklist[0].ConstructionPersonCode;
1075 1076

  
1076 1077
                // ?H?????S????????Z?b?g??????
1077
                comboBoxEX3.SelectedValue = worklist[0].ConstrSubDepCode;
1078
                cmbConstrSubPerson.SelectedValue = worklist[0].ConstrSubPersonCode;
1078
                if (worklist[0].ConstrSubDepCode > 0) comboBoxEX3.SelectedValue = worklist[0].ConstrSubDepCode;
1079
                if (worklist[0].ConstrSubPersonCode > 0) cmbConstrSubPerson.SelectedValue = worklist[0].ConstrSubPersonCode;
1079 1080

  
1080 1081
                // ?w??????????Z?b?g??????
1081
                comboBoxEX4.SelectedValue = worklist[0].ConstrInstrDepCode;
1082
                cmbConstrInst.SelectedValue = worklist[0].ConstructionInstructor;
1082
                if (worklist[0].ConstrInstrDepCode > 0) comboBoxEX4.SelectedValue = worklist[0].ConstrInstrDepCode;
1083
                if (worklist[0].ConstructionInstructor > 0) cmbConstrInst.SelectedValue = worklist[0].ConstructionInstructor;
1084
                SetCmbDepartmentEvent(false);
1083 1085

  
1086

  
1084 1087
                ((ComboBox)m_DspCtrl[(int)DspCnt.OrderersDivision]).SelectedValue = worklist[0].OrderersDivision;                                           // ???????
1085 1088
                // ??????R???{?X?V
1086 1089
                SetcmbOrderers();
......
3865 3868

  
3866 3869
            IOMessageBoardData mbdDB = new IOMessageBoardData();                        // ?f????f?[?^
3867 3870
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();                    // ?f??????e?[?u??
3871
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();            // ?f???????f?[?^
3868 3872

  
3873
            IORecordKey RecDB = new IORecordKey();                                      // ???R?[?h??????
3874

  
3869 3875
            FrmConstructionLedger frm = new FrmConstructionLedger();                    // ?H??????????
3870 3876
            try
3871 3877
            {
......
3912 3918
                            ApprovalDB, PersonDB,
3913 3919
                            BudgetDB, BudgetDDB,
3914 3920
                            LedgerDB, LedgerDDB, LedgerEDB,
3915
                            mbdDB, mbtDB);
3921
                            mbdDB, mbtDB, mbhDB, RecDB);
3916 3922

  
3917 3923
                // ?f?[?^?o?^
3918 3924
                if (!ConstructionBaseInfoDataEntry(cbiDB, cpdDB))
......
3923 3929
                                        ApprovalDB, PersonDB,
3924 3930
                                        BudgetDB, BudgetDDB,
3925 3931
                                        LedgerDB, LedgerDDB, LedgerEDB,
3926
                                        mbdDB, mbtDB);
3932
                                        mbdDB, mbtDB, mbhDB, RecDB);
3927 3933

  
3928 3934
                    return false;
3929 3935
                }
......
3935 3941
                                        ApprovalDB, PersonDB,
3936 3942
                                        BudgetDB, BudgetDDB,
3937 3943
                                        LedgerDB, LedgerDDB, LedgerEDB,
3938
                                        mbdDB, mbtDB);
3944
                                        mbdDB, mbtDB, mbhDB, RecDB);
3939 3945

  
3940 3946
                    return false;
3941 3947
                }
......
3951 3957
                                        ApprovalDB, PersonDB,
3952 3958
                                        BudgetDB, BudgetDDB,
3953 3959
                                        LedgerDB, LedgerDDB, LedgerEDB,
3954
                                        mbdDB, mbtDB);
3960
                                        mbdDB, mbtDB, mbhDB, RecDB);
3955 3961

  
3956 3962
                    return false;
3957 3963
                }
......
3969 3975
                                        ApprovalDB, PersonDB,
3970 3976
                                        BudgetDB, BudgetDDB,
3971 3977
                                        LedgerDB, LedgerDDB, LedgerEDB,
3972
                                        mbdDB, mbtDB);
3978
                                        mbdDB, mbtDB, mbhDB, RecDB);
3973 3979

  
3974 3980
                    return false;
3975 3981
                }
......
3985 3991
                                            ApprovalDB, PersonDB,
3986 3992
                                            BudgetDB, BudgetDDB,
3987 3993
                                            LedgerDB, LedgerDDB, LedgerEDB,
3988
                                            mbdDB, mbtDB);
3994
                                            mbdDB, mbtDB, mbhDB, RecDB);
3989 3995

  
3990 3996
                        return false;
3991 3997
                    }
......
4001 4007
                                        ApprovalDB, PersonDB,
4002 4008
                                        BudgetDB, BudgetDDB,
4003 4009
                                        LedgerDB, LedgerDDB, LedgerEDB,
4004
                                        mbdDB, mbtDB);
4010
                                        mbdDB, mbtDB, mbhDB, RecDB);
4005 4011

  
4006 4012
                    return false;
4007 4013
                }
......
4015 4021
                                        ApprovalDB, PersonDB,
4016 4022
                                        BudgetDB, BudgetDDB,
4017 4023
                                        LedgerDB, LedgerDDB, LedgerEDB,
4018
                                        mbdDB, mbtDB);
4024
                                        mbdDB, mbtDB, mbhDB, RecDB);
4019 4025

  
4020 4026
                    return false;
4021 4027
                }
......
4023 4029
                // ?????????????????
4024 4030
                if (m_TransferMesageFlg)
4025 4031
                {
4026
                    if (!MessageBoardEntry(mbdDB, mbtDB))
4032
                    if (!MessageBoardEntry(mbdDB, mbtDB, mbhDB, RecDB))
4027 4033
                    {
4028 4034
                        MessageBox.Show("???????F?X?V?G???[????B", "?X?V?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
4029 4035
                        RollBackCommitProc(true,
......
4031 4037
                                            ApprovalDB, PersonDB,
4032 4038
                                            BudgetDB, BudgetDDB,
4033 4039
                                            LedgerDB, LedgerDDB, LedgerEDB,
4034
                                            mbdDB, mbtDB);
4040
                                            mbdDB, mbtDB, mbhDB, RecDB);
4035 4041
                        return false;
4036 4042
                    }
4037 4043
                }
......
4039 4045
                // ???p?S???????????????????
4040 4046
                if (m_Transfer2MesageFlg)
4041 4047
                {
4042
                    if (!MessageBoardEntry2(mbdDB, mbtDB))
4048
                    if (!MessageBoardEntry2(mbdDB, mbtDB, mbhDB, RecDB))
4043 4049
                    {
4044 4050
                        MessageBox.Show("?S??????p?F?X?V?G???[????B", "?X?V?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
4045 4051
                        RollBackCommitProc(true,
......
4047 4053
                                            ApprovalDB, PersonDB,
4048 4054
                                            BudgetDB, BudgetDDB,
4049 4055
                                            LedgerDB, LedgerDDB, LedgerEDB,
4050
                                            mbdDB, mbtDB);
4056
                                            mbdDB, mbtDB, mbhDB, RecDB);
4051 4057
                        return false;
4052 4058
                    }
4053 4059
                }
......
4058 4064
                                    ApprovalDB, PersonDB,
4059 4065
                                    BudgetDB, BudgetDDB,
4060 4066
                                    LedgerDB, LedgerDDB, LedgerEDB,
4061
                                    mbdDB, mbtDB);
4067
                                    mbdDB, mbtDB, mbhDB, RecDB);
4062 4068

  
4063 4069
                // ?H???R?[?h??Z?b?g
4064 4070
                frm.ConstructionCode = ProcConstrCode;
......
4101 4107

  
4102 4108
                mbdDB.close(); mbdDB = null;
4103 4109
                mbtDB.close(); mbtDB = null;
4110
                mbhDB.close(); mbhDB = null;
4111
                RecDB.close(); RecDB = null;
4104 4112

  
4113

  
4105 4114
                frm.Dispose(); frm = null;
4106 4115
            }
4107 4116
        }
......
4123 4132
                                IOConstructionLedgerDetail LedgerDDB,   // ?H??????????f?[?^
4124 4133
                                IOConstructionLedgerExcute LedgerEDB,   // ?H???????x?????f?[?^
4125 4134
                                IOMessageBoardData mbdDB,               // ?f????f?[?^
4126
                                IOMessageBoardTerget mbtDB)             // ?f??????e?[?u??
4135
                                IOMessageBoardTerget mbtDB,             // ?f??????e?[?u??
4136
                                IOMessageBrowsingHistory mbhDB,         // ?f???????f?[?^
4137
                                IORecordKey RecDB                       // ???R?[?h???????f?[?^
4138
                                )
4127 4139
        {
4128 4140
            try
4129 4141
            {
......
4144 4156

  
4145 4157
                mbdDB.connect(); mbdDB.beginTran();
4146 4158
                mbtDB.connect(); mbtDB.beginTran();
4159
                mbhDB.connect(); mbhDB.beginTran();
4160

  
4161
                RecDB.connect(); RecDB.beginTran();
4147 4162
            }
4148 4163
            catch (System.Exception ex)
4149 4164
            {
......
4169 4184
                                        IOConstructionLedgerDetail LedgerDDB,   // ?H??????????f?[?^
4170 4185
                                        IOConstructionLedgerExcute LedgerEDB,   // ?H???????x?????f?[?^
4171 4186
                                        IOMessageBoardData mbdDB,               // ?f????f?[?^
4172
                                        IOMessageBoardTerget mbtDB              // ?f??????e?[?u??
4187
                                        IOMessageBoardTerget mbtDB,             // ?f??????e?[?u??
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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