プロジェクト

全般

プロフィール

リビジョン 296

堀内約7年前に追加

結合・増減親工事検索修正・追加
注文書エクセル修正
秘書からの連絡、最高責任者・管理者メッセージ削除追加
工事一覧動作速度改善のため修正
請求まとめ修正中

差分を表示:

branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
14 14
        /// <summary>
15 15
        /// 本体バージョン
16 16
        /// </summary>
17
        public static int s_SystemVersion = 105;
17
        public static int s_SystemVersion = 107;
18 18

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsProcessExist.cs
119 119
        /// </summary>
120 120
        /// <param name="InputCode"></param>
121 121
        /// <returns></returns>
122
        public static int GetParentConstrCode(int InputCode, int InputJoinFlg, int InputTyingFlg)
123
        {
124
            IOConstructionLink LinkDB = new IOConstructionLink();
125
            try
126
            {
127
                if (InputJoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.Standard
128
                    && InputTyingFlg == (int)ConstructionBaseInfo.TyingFlgDef.Standard)
129
                {
130
                    return InputCode;
131
                }
132

  
133
                if (InputJoinFlg != (int)ConstructionBaseInfo.JoinFlgDef.Standard)
134
                {   // ----- 結合工事のチェック
135
                    // 結合工事は結合親工事番号を返す
136
                    int FuncCnt = 0;
137
                    ArrayList ParList = new ArrayList();
138
                    ClsChangeBaseInfoData.GetParentData(InputCode, ref ParList, ref FuncCnt);
139
                    // データ無はエラー
140
                    if (ParList.Count == 0) return InputCode;
141

  
142
                    object[] objRec = (object[])ParList[0];
143
                    return CommonMotions.cnvInt(objRec[0]);
144
                }
145
                else
146
                {
147
                    // 増減工事でない場合はそのまま工事コードを返す
148
                    if (InputTyingFlg != (int)ConstructionBaseInfo.TyingFlgDef.Tying) return InputCode;
149
                }
150
                // 増減工事の場合は親コードを検索する
151
                string strLink = string.Format(" WHERE FluctuationCode = {0}", InputCode);
152
                ConstructionLink LinkRec = new ConstructionLink();
153
                if (!LinkDB.SelectAction(strLink, ref LinkRec)) return InputCode;
154

  
155
                return LinkRec.ConstructionCode;
156
            }
157
            catch (Exception ex)
158
            {
159
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
160
                return InputCode;
161
            }
162
            finally
163
            {
164
                LinkDB.close(); LinkDB = null;
165
            }
166
        }
167
        #endregion
168

  
169
        #region 増減工事・結合工事の場合は親コードを返す
170
        /// <summary>
171
        /// 増減工事・結合工事の場合は親コードを返す
172
        /// </summary>
173
        /// <param name="InputCode"></param>
174
        /// <returns></returns>
122 175
        public static int GetParentConstrCode(int InputCode)
123 176
        {
124 177
            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
......
130 183
                ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
131 184
                if (!BaseDB.SelectAction(strBase, ref BaseRec)) return InputCode;
132 185

  
133
                // 結合工事のチェック
134
                if (BaseRec.JoinFlg != (int)ConstructionBaseInfo.JoinFlgDef.Standard)
186
                if (BaseRec.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.Standard
187
                    && BaseRec.TyingFlg == (int)ConstructionBaseInfo.TyingFlgDef.Standard)
135 188
                {
189
                    return InputCode;
190
                }
191
                else if (BaseRec.JoinFlg != (int)ConstructionBaseInfo.JoinFlgDef.Standard)
192
                {   // ----- 結合工事のチェック
136 193
                    // 結合工事は結合親工事番号を返す
137 194
                    int FuncCnt = 0;
138 195
                    ArrayList ParList = new ArrayList();
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs
39 39
                                                            " C.PERSONCODE, C.PERSONNAME, C.DEPARTMENTCODE, C.DEPARTMENTNAME, C.MANDISPORDER, C.DEPDISPORDER,",
40 40
                                                            " D.PERSONCODE, D.PERSONNAME, D.DEPARTMENTCODE, D.DEPARTMENTNAME, D.MANDISPORDER, D.DEPDISPORDER"};
41 41

  
42
        private static string[] s_SQLPart1_1 = new string[] { " FROM CONSTRUCTIONBASEINFO A", 
42
        private static string[] s_SQLPart1_1 = new string[] { ", -1, 0, A.JoinFlg, A.TyingFlg" };
43

  
44
        private static string[] s_SQLPart1_2 = new string[] { ", ifnull(App.ApprovalStatus, -1), ifnull(App.OrderNo, 0), A.JoinFlg, A.TyingFlg" };
45

  
46
        private static string[] s_SQLPart2 = new string[] { " FROM CONSTRUCTIONBASEINFO A", 
43 47
                                                            " LEFT JOIN CONSTRUCTIONBASEINFODETAIL B",
44 48
                                                            " ON A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE",
45 49
                                                            string.Format(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName)};
46 50

  
47
        private static string[] s_SQLPart2 = new string[] { " LEFT JOIN (SELECT CA.CONSTRUCTIONCODE, CA.SALESPERSONCODE PERSONCODE, CB.PERSONNAME PERSONNAME,",
51
        private static string[] s_SQLPart3 = new string[] { " LEFT JOIN (SELECT CA.CONSTRUCTIONCODE, CA.SALESPERSONCODE PERSONCODE, CB.PERSONNAME PERSONNAME,",
48 52
                                                            " CB.DEPARTMENTCODE DEPARTMENTCODE, CC.DEPARTMENTSTRING DEPARTMENTNAME,",
49 53
                                                            " CB.DISPLAYORDER MANDISPORDER, CC.DISPLAYORDER DEPDISPORDER",
50 54
                                                            " FROM CONSTRUCTIONBASEINFO CA",
......
52 56
                                                            " LEFT JOIN DEPARTMENTMASTER CC ON CB.DEPARTMENTCODE = CC.DEPARTMENTCODE",
53 57
                                                            " WHERE CA.CONSTRUCTIONPERIOD = {0}) C ON A.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE" };
54 58

  
55
        private static string[] s_SQLPart3 = new string[] { " LEFT JOIN (SELECT DA.CONSTRUCTIONCODE, DA.CONSTRUCTIONPERSONCODE PERSONCODE, DB.PERSONNAME PERSONNAME,",
59
        private static string[] s_SQLPart3_1 = new string[] { " LEFT JOIN (SELECT DA.CONSTRUCTIONCODE, DA.CONSTRUCTIONPERSONCODE PERSONCODE, DB.PERSONNAME PERSONNAME,",
56 60
                                                            " DB.DEPARTMENTCODE DEPARTMENTCODE, DC.DEPARTMENTSTRING DEPARTMENTNAME,",
57 61
                                                            " DB.DISPLAYORDER MANDISPORDER, DC.DISPLAYORDER DEPDISPORDER",
58 62
                                                            " FROM CONSTRUCTIONBASEINFO DA",
......
60 64
                                                            " LEFT JOIN DEPARTMENTMASTER DC ON DB.DEPARTMENTCODE = DC.DEPARTMENTCODE",
61 65
                                                            " WHERE DA.CONSTRUCTIONPERIOD = {0}) D ON A.CONSTRUCTIONCODE = D.CONSTRUCTIONCODE" };
62 66

  
63
        private static string[] s_SQLPart4 = new string[] { " WHERE A.CONSTRUCTIONPERIOD = {0}" };
67
        private static string[] s_SQLPart3_2 = new string[] { " LEFT JOIN processapproval AS App ON",
68
                                                            "     App.ConstructionCode = A.ConstructionCode",
69
                                                            " AND App.ApprovalCode = {0}",
70
                                                            " And App.OrderNo = {0}",
71
                                                            " And App.SeqNo = 1"};
64 72

  
65
        private static string[] s_SQLPart4Tying = new string[] { " WHERE A.CONSTRUCTIONPERIOD = {0}",
73
        private static string[] s_SQLPart5 = new string[] { " WHERE A.CONSTRUCTIONPERIOD = {0}" };
74

  
75
        private static string[] s_SQLPart5Tying = new string[] { " WHERE A.CONSTRUCTIONPERIOD = {0}",
66 76
                                                                string.Format(" AND A.TYINGFLG != {0}", (int)ConstructionBaseInfo.TyingFlgDef.Tying) };
67 77

  
68
        private static string[] s_SQLPart5 = new string[] { " ORDER BY A.CONSTRUCTIONSTATUSFLG ASC, C.DEPDISPORDER ASC, C.MANDISPORDER ASC,",
78
        private static string[] s_SQLPart6 = new string[] { " ORDER BY A.CONSTRUCTIONSTATUSFLG ASC, C.DEPDISPORDER ASC, C.MANDISPORDER ASC,",
69 79
                                                            " D.DEPDISPORDER ASC, D.MANDISPORDER ASC, A.CONSTRUCTIONCODE DESC" };
70 80
        #endregion
71 81

  
......
93 103
            CONSTDEPDISPORDER,
94 104
            AppStatus,
95 105
            ORDERNO,
106
            JOINFLG,
107
            TYINGFLG,
96 108
        }
97 109
        #endregion
98 110

  
......
329 341
            {
330 342
                StringBuilder wrkFormat = new StringBuilder();
331 343
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
344
                wrkFormat.Append(s_SQLPart1_1[0]);
332 345
                
333 346
                // ???t?B?[???h???????????
334
                wrkFormat.Append(", 0, 0");
335 347
                wrkFormat.Append(", A.EstimateType, A.RequestedDate, A.EstimatesSubmittedDate");
336 348
                
337
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
349
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
338 350
                
339
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
340 351
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
341
                for (int i = 0; i < s_SQLPart4Tying.Length; i++) wrkFormat.Append(s_SQLPart4Tying[i]);
352
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
353
                for (int i = 0; i < s_SQLPart5Tying.Length; i++) wrkFormat.Append(s_SQLPart5Tying[i]);
342 354

  
343 355
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
344 356

  
......
354 366
                strSQL.Append(wrkBuff);
355 367

  
356 368
                // ORDER BY ???
357
                for (int i = 0; i < s_SQLPart5.Length; i++) strSQL.Append(s_SQLPart5[i]);
369
                for (int i = 0; i < s_SQLPart6.Length; i++) strSQL.Append(s_SQLPart6[i]);
358 370
            }
359 371
            catch (Exception ex)
360 372
            {
......
381 393

  
382 394
                StringBuilder wrkFormat = new StringBuilder();
383 395
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
384
                wrkFormat.Append(", -1, 0");    // ???t?B?[???h???????????
385
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
396
                wrkFormat.Append(s_SQLPart1_1[0]);
397
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
386 398
                
387
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
388 399
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
389
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
400
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
401
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
390 402

  
391 403
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
392 404
                strSQL.AppendFormat(" AND A.ConstructionStatusFlg < {0}", ProgressComplete);
......
405 417
                strSQL.Append(" UNION ");
406 418
                wrkFormat.Clear();
407 419
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
408
                wrkFormat.Append(", ifnull(App.ApprovalStatus, -1), ifnull(App.OrderNo, 0)");
409
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
420
                wrkFormat.Append(s_SQLPart1_2[0]);
421

  
422
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
410 423
                
411
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
412 424
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
425
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
413 426

  
414
                wrkFormat.Append(" LEFT JOIN processapproval AS App ON App.ConstructionCode = A.ConstructionCode");
415
                wrkFormat.AppendFormat(" AND App.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.EstimateApproval);
416
                wrkFormat.AppendFormat(" And App.OrderNo = {0}", CommonDefine.s_Default_OrderNo);
417
                wrkFormat.Append(" And App.SeqNo = 1");
427
                wrkFormat.Append(s_SQLPart3_2[0]);
428
                wrkFormat.Append(s_SQLPart3_2[1]);
429
                wrkFormat.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.EstimateApproval);
430
                wrkFormat.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
431
                wrkFormat.Append(s_SQLPart3_2[4]);
418 432
                
419
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
433
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
420 434
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
421 435

  
422 436
                strSQL.Append(" AND EXISTS (SELECT * FROM ESTIMATEDATA C WHERE C.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
......
460 474

  
461 475
                StringBuilder wrkFormat = new StringBuilder();
462 476
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
477
                wrkFormat.Append(s_SQLPart1_1[0]);
463 478
                wrkFormat.Append(", DATE_FORMAT(A.EstimatesSubmittedDate, '%Y/%m/%d'), 0");    // ???t?B?[???h???????????
464
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
479
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
465 480
                
466
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
467 481
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
468
                wrkFormat.Append(", PROCESSAPPROVAL A1");
469
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
482
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
483
                wrkFormat.Append(", PROCESSAPPROVAL App");
484
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
470 485

  
471 486
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
472
                strSQL.AppendFormat(" AND (A.CONSTRUCTIONCODE = A1.CONSTRUCTIONCODE And A1.ApprovalCode = {0} And A1.SeqNo = 1", ApprovalCode);
473
                strSQL.AppendFormat(" And A1.ApprovalStatus = {0})", (int)CommonDefine.ApprovalStatus.Approval);
487
                
488
                // Left Join???????????????
489
                strSQL.Append(" And (");
490
                strSQL.Append(s_SQLPart3_2[1]);
491
                strSQL.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.EstimateApproval);
492
                strSQL.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
493
                strSQL.Append(s_SQLPart3_2[4]);
494
                strSQL.AppendFormat(" And App.ApprovalStatus = {0})", (int)CommonDefine.ApprovalStatus.Approval);
495
                strSQL.Append(") ");
474 496

  
475 497
                // ???????I???????????
476 498
                strSQL.Append(GetDepartmentString());
......
484 506
                strSQL.Append(wrkBuff.ToString());
485 507

  
486 508
                // ORDER BY ???
487
                for (int i = 0; i < s_SQLPart5.Length; i++) strSQL.Append(s_SQLPart5[i]);
509
                for (int i = 0; i < s_SQLPart6.Length; i++) strSQL.Append(s_SQLPart6[i]);
488 510
            }
489 511
            catch (Exception ex)
490 512
            {
......
511 533

  
512 534
                StringBuilder wrkFormat = new StringBuilder();
513 535
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
514
                wrkFormat.Append(", -1, 0");    // ???t?B?[???h???????????
515
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
536
                wrkFormat.Append(s_SQLPart1_1[0]);
537
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
516 538

  
517
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
518 539
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
519
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
540
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
541
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
520 542

  
521 543
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
522 544
                strSQL.Append(" AND EXISTS (SELECT * FROM ESTIMATEDATA C WHERE C.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
......
537 559
                strSQL.Append(" UNION ");
538 560
                wrkFormat.Clear();
539 561
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
540
                wrkFormat.Append(", ifnull(App.ApprovalStatus, -1), ifnull(App.OrderNo, 0)");
541
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
562
                wrkFormat.Append(s_SQLPart1_2[0]);
563
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
542 564

  
543
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
544 565
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
566
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
545 567

  
546
                wrkFormat.Append(" LEFT JOIN processapproval AS App ON App.ConstructionCode = A.ConstructionCode");
547
                wrkFormat.AppendFormat(" AND App.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.EstimateBudgetApproval);
548
                wrkFormat.AppendFormat(" And App.OrderNo = {0}", CommonDefine.s_Default_OrderNo);
549
                wrkFormat.Append(" And App.SeqNo = 1");
568
                wrkFormat.Append(s_SQLPart3_2[0]);
569
                wrkFormat.Append(s_SQLPart3_2[1]);
570
                wrkFormat.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.EstimateBudgetApproval);
571
                wrkFormat.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
572
                wrkFormat.Append(s_SQLPart3_2[4]);
550 573

  
551
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
574
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
552 575

  
553 576
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
554 577
                strSQL.Append(" AND EXISTS (SELECT * FROM ESTIMATEBUDGET A1 WHERE A1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
......
598 621

  
599 622
                StringBuilder wrkFormat = new StringBuilder();
600 623
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
601
                wrkFormat.Append(", -1, 0");    // ???t?B?[???h???????????
602
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
624
                wrkFormat.Append(s_SQLPart1_1[0]);
625
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
603 626

  
604
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
605 627
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
606
                wrkFormat.Append(", PROCESSAPPROVAL A1");
607
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
628
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
629
                wrkFormat.Append(", PROCESSAPPROVAL App");
630
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
608 631
                wrkFormat.Append(" AND A.CONSTRUCTIONPERSONCODE != 0");
609 632
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
610 633

  
......
612 635
                strSQL.AppendFormat(" And {0} <= A.ConstructionStatusFlg", ProgressStart);
613 636
                strSQL.AppendFormat(" And A.ConstructionStatusFlg < {0}", ProgressComplete);
614 637
                strSQL.Append(" And A.ConstructionPersonCode != 0");
615
                strSQL.AppendFormat(" AND (A.CONSTRUCTIONCODE = A1.CONSTRUCTIONCODE AND A1.APPROVALCODE = {0}", (int)ClsExcute.ApprovalListNo.EstimateApproval);
616
                strSQL.AppendFormat(" AND SEQNO = 1 AND ApprovalStatus = {0})", (int)CommonDefine.ApprovalStatus.Approval);
638

  
639
                // Left Join???????????????
640
                strSQL.Append(" And (");
641
                strSQL.Append(s_SQLPart3_2[1]);
642
                strSQL.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.EstimateApproval);
643
                strSQL.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
644
                strSQL.Append(s_SQLPart3_2[4]);
645
                strSQL.AppendFormat(" And App.ApprovalStatus = {0}", (int)CommonDefine.ApprovalStatus.Approval);
646
                strSQL.Append(") ");
647

  
617 648
                strSQL.Append(" AND NOT EXISTS (SELECT * FROM CONSTRUCTIONBUDGET C WHERE C.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
618 649

  
619 650
                // ???????I???????????
......
628 659
                strSQL.Append(" UNION ");
629 660
                wrkFormat.Clear();
630 661
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
631
                wrkFormat.Append(", ifnull(App.ApprovalStatus, -1), ifnull(App.OrderNo, 0)");
632
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
662
                wrkFormat.Append(s_SQLPart1_2[0]);
663
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
633 664

  
634
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
635 665
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
666
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
636 667

  
637
                wrkFormat.Append(" LEFT JOIN processapproval AS App ON App.ConstructionCode = A.ConstructionCode");
638
                wrkFormat.AppendFormat(" AND App.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval);
639
                wrkFormat.AppendFormat(" And App.OrderNo = {0}", CommonDefine.s_Default_OrderNo);
640
                wrkFormat.Append(" And App.SeqNo = 1");
668
                wrkFormat.Append(s_SQLPart3_2[0]);
669
                wrkFormat.Append(s_SQLPart3_2[1]);
670
                wrkFormat.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval);
671
                wrkFormat.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
672
                wrkFormat.Append(s_SQLPart3_2[4]);
641 673

  
642 674
                wrkFormat.Append(", constructionbudget E");
643
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
675
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
644 676
                wrkFormat.Append(" AND A.CONSTRUCTIONPERSONCODE != 0");
645 677

  
646 678
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
......
693 725

  
694 726
                StringBuilder wrkFormat = new StringBuilder();
695 727
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
696
                wrkFormat.Append(", -1, 0");   // ???t?B?[???h???????????
697
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
728
                wrkFormat.Append(s_SQLPart1_1[0]);
729
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
698 730

  
699
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
700 731
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
732
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
701 733

  
702
                wrkFormat.Append(", PROCESSAPPROVAL A1");
703
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
734
                wrkFormat.Append(", PROCESSAPPROVAL App");
735
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
704 736

  
705 737
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
706 738

  
......
725 757
                strSQL.Append(" GROUP BY AA1.CONSTRUCTIONCODE, AA1.COMPANYCODE");
726 758

  
727 759
                strSQL.AppendFormat(" HAVING SUM(AA1.EXECUTIONAMOUNT) >= {0}))", CommonDefine.s_PrintOutPrice);
728
                strSQL.Append(" AND (A1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
729
                strSQL.AppendFormat(" AND A1.APPROVALCODE = {0}", (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval);
730
                strSQL.Append(" AND A1.SEQNO = 1");
731
                strSQL.AppendFormat(" AND A1.APPROVALSTATUS = {0})", (int)CommonDefine.ApprovalStatus.Approval);
760

  
761
                // Left Join???????????????
762
                strSQL.Append(" And (");
763
                strSQL.Append(s_SQLPart3_2[1]);
764
                strSQL.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval);
765
                strSQL.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
766
                strSQL.Append(s_SQLPart3_2[4]);
767
                strSQL.AppendFormat(" And App.ApprovalStatus = {0}", (int)CommonDefine.ApprovalStatus.Approval);
768
                strSQL.Append(") ");
769
                
732 770
                strSQL.Append(" OR A.JOINFLG = 1)");
733 771

  
734 772
                // ???????I???????????
......
742 780

  
743 781
                wrkFormat.Clear();
744 782
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
745
                wrkFormat.Append(", ifnull(App.ApprovalStatus, -1)");
746
                wrkFormat.Append(", ifnull(App.OrderNo, 0)");
747
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
783
                wrkFormat.Append(s_SQLPart1_2[0]);
784
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
748 785

  
749
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
750 786
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
787
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
751 788

  
752
                wrkFormat.Append(" LEFT JOIN processapproval AS App");
753
                wrkFormat.Append(" ON App.ConstructionCode = A.ConstructionCode");
754
                wrkFormat.AppendFormat(" AND App.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval);
755
                wrkFormat.AppendFormat(" And App.OrderNo = {0}", CommonDefine.s_Default_OrderNo);
756
                wrkFormat.Append(" And App.SeqNo = 1");
789
                wrkFormat.Append(s_SQLPart3_2[0]);
790
                wrkFormat.Append(s_SQLPart3_2[1]);
791
                wrkFormat.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval);
792
                wrkFormat.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
793
                wrkFormat.Append(s_SQLPart3_2[4]);
757 794

  
758 795
                wrkFormat.Append(", PURCHASEORDER A1");
759
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
796
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
760 797

  
761 798
                strSQL.Append(" UNION (");
762 799
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
......
804 841
        {
805 842
            try
806 843
            {
807
                // ???????????F???????????
808
                int ApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals("?????????F")).Key;
809

  
810 844
                // ?Z?L?????e?B???????
811 845
                StringBuilder wrkBuff = new StringBuilder();
812 846
                CreateSecuritySQL(ref wrkBuff);
813 847

  
814 848
                StringBuilder wrkFormat = new StringBuilder();
815 849
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
816
                wrkFormat.Append(", DATE_FORMAT(A2.PRINTOUTDATE, '%Y/%m/%d'), A1.ORDERNO");     // ???t?B?[???h???????????
817
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
850
                wrkFormat.Append(s_SQLPart1_2[0]);
851
                wrkFormat.Append(", DATE_FORMAT(A2.PRINTOUTDATE, '%Y/%m/%d')");                 // ???t?B?[???h???????????
852
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
818 853

  
819
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
820 854
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
821
                wrkFormat.Append(", PROCESSAPPROVAL A1, PURCHASEORDER A2");
822
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
855
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
856
                wrkFormat.Append(", PROCESSAPPROVAL App, PURCHASEORDER A2");
857
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
823 858

  
824 859
                strSQL.AppendFormat(wrkFormat.ToString(), numUDConstPro.Value);
825 860
                strSQL.Append(" AND EXISTS (SELECT * FROM PURCHASEORDER B1 WHERE B1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
826
                strSQL.AppendFormat(" And (A.ConstructionCode = A1.ConstructionCode And A1.ApprovalCode = {0} And A1.SeqNo = 1 And A1.APPROVALSTATUS = {1})",
827
                                                                                                ApprovalCode, (int)CommonDefine.ApprovalStatus.Approval);
861

  
862
                // Left Join???????????????
863
                strSQL.Append(" And (");
864
                strSQL.Append(s_SQLPart3_2[1]);
865
                strSQL.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval);
866
                //strSQL.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
867
                strSQL.Append(s_SQLPart3_2[4]);
868
                strSQL.AppendFormat(" And App.ApprovalStatus = {0}", (int)CommonDefine.ApprovalStatus.Approval);
869
                strSQL.Append(") ");
870

  
828 871
                strSQL.Append(" AND (A.CONSTRUCTIONCODE = A2.CONSTRUCTIONCODE AND A2.SEQNO = 1)");
829 872

  
830 873
                // ???????I???????????
......
869 912

  
870 913
                StringBuilder wrkFormat = new StringBuilder();
871 914
                for (int i = 0; i < s_SQLPart1.Length; i++) wrkFormat.Append(s_SQLPart1[i]);
872
                wrkFormat.Append(", ifnull(App.ApprovalStatus, -1), ifnull(App.OrderNo, 0)");
873
                for (int i = 0; i < s_SQLPart1_1.Length; i++) wrkFormat.Append(s_SQLPart1_1[i]);
915
                wrkFormat.Append(s_SQLPart1_2[0]);
916
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
874 917

  
875
                for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat.Append(s_SQLPart2[i]);
876 918
                for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat.Append(s_SQLPart3[i]);
919
                for (int i = 0; i < s_SQLPart3_1.Length; i++) wrkFormat.Append(s_SQLPart3_1[i]);
877 920

  
878
                wrkFormat.Append(" LEFT JOIN processapproval AS App ON App.ConstructionCode = A.ConstructionCode");
879
                wrkFormat.AppendFormat(" AND App.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.EstimateBudgetApproval);
880
                wrkFormat.AppendFormat(" And App.OrderNo = {0}", CommonDefine.s_Default_OrderNo);
881
                wrkFormat.Append(" And App.SeqNo = 1");
921
                wrkFormat.Append(s_SQLPart3_2[0]);
922
                wrkFormat.Append(s_SQLPart3_2[1]);
923
                wrkFormat.AppendFormat(s_SQLPart3_2[2], (int)ClsExcute.ApprovalListNo.EstimateBudgetApproval);
924
                wrkFormat.AppendFormat(s_SQLPart3_2[3], CommonDefine.s_Default_OrderNo);
925
                wrkFormat.Append(s_SQLPart3_2[4]);
882 926

  
883 927
                wrkFormat.Append(", constructionledger AS Ledger");
884 928

  
885
                for (int i = 0; i < s_SQLPart4.Length; i++) wrkFormat.Append(s_SQLPart4[i]);
929
                for (int i = 0; i < s_SQLPart5.Length; i++) wrkFormat.Append(s_SQLPart5[i]);
886 930

  
887 931
                wrkFormat.AppendFormat(" AND ({0} <= A.CONSTRUCTIONSTATUSFLG AND A.CONSTRUCTIONSTATUSFLG <= {1})", nStat1, nStat2);
888 932
                wrkFormat.Append(" AND Ledger.ConstructionCode = A.ConstructionCode");
......
901 945
                strSQL.Append(wrkBuff);
902 946

  
903 947
                // ORDER BY ???
904
                for (int i = 0; i < s_SQLPart5.Length; i++) strSQL.Append(s_SQLPart5[i]);
948
                for (int i = 0; i < s_SQLPart6.Length; i++) strSQL.Append(s_SQLPart6[i]);
905 949
            }
906 950
            catch (Exception ex)
907 951
            {
......
1281 1325
            {
1282 1326
                int nConstrCode = CommonMotions.cnvInt(objwrk[(int)GetData.CONSTRUCTIONCODE]);
1283 1327
                int nOrderNo = CommonMotions.cnvInt(objwrk[(int)GetData.ORDERNO]);
1328
                int nJoinFlg = CommonMotions.cnvInt(objwrk[(int)GetData.JOINFLG]);
1329
                int nTyingFlg = CommonMotions.cnvInt(objwrk[(int)GetData.TYINGFLG]);
1284 1330
                int nAppStatus = 0;
1285 1331
                string strAppStatus = string.Empty;
1286 1332
                DateTime dtAppStatus = DateTime.MinValue;
1287 1333

  
1288 1334
                // ----- ?N?????????????
1289
                int ParentCode = ClsProcessExist.GetParentConstrCode(nConstrCode);
1335
                int ParentCode = ClsProcessExist.GetParentConstrCode(nConstrCode, nJoinFlg, nTyingFlg);
1290 1336
                switch (m_ExecuteFlg)
1291 1337
                {
1292 1338
                    case (int)ClsExcute.ProcessExecuteNo.EstimateInput:                     // ??Z?????????
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs
4169 4169
                sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
4170 4170
                sql.AppendFormat("  , DATE('{0}') as ApprovalDate ", DateTime.MinValue.ToShortDateString());
4171 4171
                sql.Append("  , 0 as ApprovalEndFlg ");
4172
                sql.Append("  , Picm.DepartmentCode As AppDepCode");
4172 4173
                sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
4173 4174
                sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
4174 4175
                sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
4175 4176
                sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
4176
                sql.Append("  , Picm.DepartmentCode ");
4177
                
4177
                sql.Append("  , 0 As ConstrDepCode ");
4178
                sql.Append("  , 0 As SalesDepCode ");
4179
                sql.Append("  , 0 As AssistDepCode ");
4180
                sql.Append("  , 0 As InstrDepCode ");
4181

  
4178 4182
                sql.Append("  , case ifnull(DATE(Pod.SendDate), '') ");
4179 4183
                sql.Append("    when '' then '?~' ");
4180 4184
                sql.AppendFormat("    when '{0}' then '?~' ", DateTime.MinValue.ToShortDateString());
branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmMessageBoardReader.cs
379 379
                if (data.MessageFlag == (int)MessageBoardData.MessageFlgDef.Secretary)
380 380
                {
381 381
                    btnDataEntry.Visible = false;
382
                    btnDelete.Visible = false;
382

  
383
                    // ログイン者が管理者・最高責任者ならばメッセージを削除できる
384
                    int SecRank = CommonDefine.SecurityRankList[(int)CommonDefine.SecurityRankPos.SpecialAuthority].Key;
385
                    if (CommonMotions.LoginUserData.PersonCode == CommonDefine.AdminCode || CommonMotions.LoginUserData.SecurityManagement == SecRank)
386
                    {
387
                        btnDelete.Visible = true;
388
                    }
389
                    else
390
                    {
391
                        btnDelete.Visible = false;
392
                    }
383 393
                }
384 394

  
385 395
                // 閲覧履歴表示
......
406 416
        {
407 417
            IOMessageBoardData mbdDB = new IOMessageBoardData();
408 418
            IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
419
            IOMessageBrowsingHistory mbhDB = new IOMessageBrowsingHistory();
409 420
            try
410 421
            {
411
                mbdDB.connect();
412
                mbdDB.beginTran();
422
                mbdDB.connect(); mbdDB.beginTran();
423
                mbtDB.connect(); mbtDB.beginTran();
424
                mbhDB.connect(); mbhDB.beginTran();
413 425

  
414
                mbtDB.connect();
415
                mbtDB.beginTran();
416

  
417 426
                List<MessageBoardData> data = new List<MessageBoardData>();
418 427
                string strWhere = mbdDB.CreatePrimarykeyString(m_RecordNumber, m_BranchNumber);
419 428
                if (!mbdDB.SelectAction(strWhere, ref data, false))
......
427 436
                {
428 437
                    MessageBox.Show("メッセージ削除に失敗しました。", "削除エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
429 438
                    mbdDB.rollback();
430
                    mbtDB.rollback();
431 439
                    return false;
432 440
                }
433 441

  
......
439 447
                    return false;
440 448
                }
441 449

  
450
                mbhDB.DeleteAction(strWhere, false);
451

  
442 452
                mbdDB.commit();
443 453
                mbtDB.commit();
454
                mbhDB.commit();
444 455

  
445 456
                return true;
446 457
            }
......
454 465
            {
455 466
                mbdDB.close(); mbdDB = null;
456 467
                mbtDB.close(); mbtDB = null;
468
                mbhDB.close(); mbhDB = null;
457 469
            }
458 470
        }
459 471
        #endregion
branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs
32 32
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 
33 33
// 既定値にすることができます:
34 34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.1.5")]
36
[assembly: AssemblyFileVersion("1.0.1.5")]
35
[assembly: AssemblyVersion("1.0.1.7")]
36
[assembly: AssemblyFileVersion("1.0.1.7")]
37 37
// Log4netを使用する
38 38
[assembly: log4net.Config.XmlConfigurator(ConfigFile = @"log4net.config", Watch = true)]

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