プロジェクト

全般

プロフィール

リビジョン 340

堀内ほぼ7年前に追加

工事情報:明細データへの書込みデータがクリアできないバグ修正
工事予算入力:実行金額が0の時に金額が入らないバグ修正
区分マスタ:区分enumの名前変更
データコピー:新規時に明細データのクリア追加
FrmSelectPaymentDayソース削除
未作成台帳一覧:担当者未定分表示追加・経費項目数可変に対応
カレンダーマスタ:表示ロジック変更・期首変更に対応
銀行営業日マスタ:表示ロジック変更
部署マスタ:削除ロジックをAuxiliaryソースへ移動
メニュー:受注状況一覧合計金額バグ修正・対象期変更numUpDownイベント修正

差分を表示:

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

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
3516 3516
                }
3517 3517
                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditLock = true;
3518 3518

  
3519
                frm.DivisionCode = (int)DivisionMaster.DivisionMasterCodeDefine.OrderDivision;
3519
                frm.DivisionCode = (int)DivisionMaster.DivisionMasterCodeDef.OrderDivision;
3520 3520

  
3521 3521
                frm.ShowDialog();
3522 3522
            }
......
3553 3553
                }
3554 3554
                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditLock = true;
3555 3555

  
3556
                frm.DivisionCode = (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses;
3556
                frm.DivisionCode = (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses;
3557 3557

  
3558 3558
                frm.ShowDialog();
3559 3559
            }
branches/src/ProcessManagement/ProcessManagement/DataModel/DivisionMaster.cs
14 14
        /// <summary>
15 15
        /// 区分マスタ区分
16 16
        /// </summary>
17
        public enum DivisionMasterCodeDefine
17
        public enum DivisionMasterCodeDef
18 18
        {
19 19
            /// <summary>
20 20
            /// 1:発注者区分登録
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs
414 414
                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER D ON D.PERSONCODE = A.CONSTRUCTIONINSTRUCTOR");
415 415
                strSQL.Append(" , PERSONINCHARGEMASTER B");
416 416
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER E ON E.DEPARTMENTCODE = B.DEPARTMENTCODE AND E.EXPENSESPERIOD = {0} AND E.NAMECODE = 3", ConstrPeriod);
417
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER E1 ON E1.DIVISIONCODE = {0} AND E1.NAMECODE = E.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
417
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER E1 ON E1.DIVISIONCODE = {0} AND E1.NAMECODE = E.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
418 418
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER F ON F.DEPARTMENTCODE = B.DEPARTMENTCODE AND F.EXPENSESPERIOD = {0} AND F.NAMECODE = 1", ConstrPeriod);
419
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER F1 ON F1.DIVISIONCODE = {0} AND F1.NAMECODE = F.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
419
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER F1 ON F1.DIVISIONCODE = {0} AND F1.NAMECODE = F.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
420 420
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER G ON G.DEPARTMENTCODE = B.DEPARTMENTCODE AND G.EXPENSESPERIOD = {0} AND G.NAMECODE = 2", ConstrPeriod);
421
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER G1 ON G1.DIVISIONCODE = {0} AND G1.NAMECODE = G.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
421
                strSQL.AppendFormat(" LEFT JOIN DIVISIONMASTER G1 ON G1.DIVISIONCODE = {0} AND G1.NAMECODE = G.NAMECODE", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
422 422
                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", ConstrCode);
423 423
                strSQL.Append(" AND B.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
424 424
            }
......
660 660
                strSQL.Append(" LEFT OUTER JOIN");
661 661
                strSQL.AppendFormat(" (SELECT NAMECODE, DEPARTMENTCODE, EXPENSESRAITO FROM DEPARTMENTEXPENSESMASTER WHERE DEPARTMENTCODE = {0}) B", DepartmentCode);
662 662
                strSQL.Append(" ON A.NAMECODE = B.NAMECODE");
663
                strSQL.AppendFormat(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
663
                strSQL.AppendFormat(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
664 664
                strSQL.Append(" ORDER BY A.DISPLAYORDER");
665 665
                if (!expDB.ExecuteReader(strSQL.ToString(), ref ExpensesList)) return false;
666 666
                if (ExpensesList.Count == 0) return false;
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
2649 2649
                // Value????Key??????
2650 2650
                //string DivisionName = CommonDefine.DivisionMasterCode[1];
2651 2651
                //int DivisionCode = CommonDefine.DivisionMasterCode.First(x => x.Value == DivisionName).Key;
2652
                string strSQL = dvDB.CreatePrimarykeyString((int)DivisionMaster.DivisionMasterCodeDefine.OrderDivision) + " And DeleteFlg = 0 ORDER BY DISPLAYORDER";
2652
                string strSQL = dvDB.CreatePrimarykeyString((int)DivisionMaster.DivisionMasterCodeDef.OrderDivision) + " And DeleteFlg = 0 ORDER BY DISPLAYORDER";
2653 2653
                if (!dvDB.SelectAction(strSQL, ref bvList)) return;
2654 2654
                if (bvList.Count == 0) return;
2655 2655

  
......
3433 3433
                int nComplate = (int)ConstructionBaseInfoDetail.DataNoDef.RevCompleteComment;
3434 3434
                for (int i = nStart; i <= nComplate; i++)
3435 3435
                {
3436
                    // ?f?[?^???????????????
3437 3436
                    TextBox wrkTextBox = ((TextBox)m_DspCtrl[i + iDifference]);
3438
                    if (CommonMotions.chkObjectIsNull(wrkTextBox.Text)) continue;
3439
                    if (wrkTextBox.Text.Length == 0) continue;
3437
                    //// ?f?[?^????????????????i?R?????g?N???A????????S??X?V???j
3438
                    //if (CommonMotions.chkObjectIsNull(wrkTextBox.Text)) continue;
3439
                    //if (wrkTextBox.Text.Length == 0) continue;
3440 3440

  
3441 3441
                    // ??????
3442 3442
                    work.DetailNo = i;
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs
255 255
                strSQL += string.Format(" FROM DEPARTMENTEXPENSESMASTER WHERE DEPARTMENTCODE = {0}) B", picRec.DepartmentCode);
256 256
                strSQL += " ON A.NAMECODE = B.NAMECODE";
257 257
                strSQL += string.Format(" AND B.EXPENSESPERIOD = {0}", m_ConstructionBaseInfo.ConstructionPeriod);
258
                strSQL += string.Format(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
258
                strSQL += string.Format(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
259 259
                strSQL += " ORDER BY A.DISPLAYORDER";
260 260
                if (!expDB.ExecuteReader(strSQL, ref m_ExpensesList)) return false;
261 261
                if (m_ExpensesList.Count == 0) return false;
......
4639 4639
                        // 希望金額が実行金額より小さい場合は金額セット
4640 4640
                        int nHopePrice = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.HopePrice].Value);
4641 4641
                        int nExecPrice = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.ExecPrice].Value);
4642
                        if (nHopePrice < nExecPrice)
4642
                        if (nExecPrice == 0 || nHopePrice < nExecPrice)
4643 4643
                            CurRow.Cells[(int)GridColumn.ExecPrice].Value = CurCell.Value;
4644 4644
                        break;
4645 4645
                    default:
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmJoinSelect.cs
260 260
                string strSQL = "SELECT A.NAMESTRING, B.ORDERERSNAME1, B.ORDERERSNAME2";
261 261
                strSQL += " FROM DIVISIONMASTER A, ORDERERSMASTER B";
262 262
                strSQL += string.Format(" WHERE (A.DIVISIONCODE = {0} AND A.NAMECODE = {1})"
263
                                        , (int)DivisionMaster.DivisionMasterCodeDefine.OrderDivision
263
                                        , (int)DivisionMaster.DivisionMasterCodeDef.OrderDivision
264 264
                                        , m_OrderersDivision);
265 265
                strSQL += string.Format(" AND B.ORDERCOTEGORY = A.NAMECODE AND B.ORDERERSCODE = {0}", m_OrdererCode);
266 266
                ArrayList arList = new ArrayList();
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs
129 129
                strSQL += string.Format(" FROM DEPARTMENTEXPENSESMASTER WHERE DEPARTMENTCODE = {0}) B", picRec.DepartmentCode);
130 130
                strSQL += " ON A.NAMECODE = B.NAMECODE";
131 131
                strSQL += string.Format(" AND B.EXPENSESPERIOD = {0}", m_ConstructionBaseInfo.ConstructionPeriod);
132
                strSQL += string.Format(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
132
                strSQL += string.Format(" WHERE A.DIVISIONCODE = {0}", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
133 133
                strSQL += " ORDER BY A.DISPLAYORDER";
134 134
                if (!expDB.ExecuteReader(strSQL, ref m_ExpensesList)) return false;
135 135
                if (m_ExpensesList.Count == 0) return false;
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.designer.cs
792 792
            this.label9.Name = "label9";
793 793
            this.label9.Size = new System.Drawing.Size(110, 25);
794 794
            this.label9.TabIndex = 0;
795
            this.label9.Text = "当期必要給与";
795
            this.label9.Text = "当期予測給与";
796 796
            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
797 797
            // 
798 798
            // lblPayroll
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CopyTargetList/FrmNewOrContinueCopy.cs
931 931
                        DB5.rollback();
932 932
                        return false;
933 933
                    }
934

  
935
                    // 明細データ削除処理
936
                    if (!RecordCopyDeleteDetail(iToCode, (int)ConstructionBaseInfoDetail.DataNoDef.Note2, DB2))
937
                    {
938
                        DB1.rollback();
939
                        DB2.rollback();
940
                        DB3.rollback();
941
                        DB4.rollback();
942
                        DB5.rollback();
943
                        return false;
944
                    }
934 945
                }
935 946

  
936 947
                // 案件進捗日付データ登録
......
1022 1033
                // 工事情報のみコピー・新規工事作成は工事の情報以外はクリアする
1023 1034
                if (radioButton3.Checked || radioButton4.Checked)
1024 1035
                {
1025
                    cbRec.TyingFlg = (int)ConstructionBaseInfo.TyingFlgDef.Standard;                   // 紐付データフラグ
1036
                    cbRec.TyingFlg = (int)ConstructionBaseInfo.TyingFlgDef.Standard;                // 紐付データフラグ
1026 1037
                    cbRec.OrderStartingDate = DateTime.MinValue;	                                // 開始予定日
1027 1038
                    cbRec.OrderCompletionDate = DateTime.MinValue;	                                // 完了予定日
1028 1039
                    cbRec.PreparationStartDate = DateTime.MinValue;                                 // 施工準備開始日
......
1049 1060
                    //cbRec.EstimateType = 1;                                                       // 見積種別
1050 1061
                    cbRec.BillingSplitFlg = 1;                                                      // 請求回数フラグ
1051 1062
                    cbRec.BillingSendDate = DateTime.MinValue;                                      // 請求書郵送/手渡し日
1063
                    cbRec.InspectPlanningDate = DateTime.MinValue;                                  // 検査予定日 
1064
                    cbRec.InspectExecuteDate = DateTime.MinValue;                                   // 検査実行日 
1065
                    cbRec.RevCompleteDate = DateTime.MinValue;                                      // 検査是正完了日 
1066

  
1052 1067
                }
1053 1068
                else if (radioButton1.Checked)
1054 1069
                {
......
1312 1327
            }
1313 1328
        }
1314 1329
        #endregion
1330

  
1331
        #region 明細データ削除処理
1332
        /// <summary>
1333
        /// 明細データ削除処理
1334
        /// </summary>
1335
        /// <returns></returns>
1336
        public bool RecordCopyDeleteDetail(int ConstrCode, int DelOverCode, IOConstructionBaseInfoDetail DB2)
1337
        {
1338
            try
1339
            {
1340
                StringBuilder strSQL = new StringBuilder();
1341
                strSQL.Append(DB2.CreatePrimarykeyString(ConstrCode));
1342
                strSQL.AppendFormat(" And DetailNo > {0}", DelOverCode);
1343
                if (!DB2.DeleteAction(strSQL.ToString(), false))
1344
                {
1345
                    MessageBox.Show("工事基本情報明細、作成後削除に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1346
                    return false;
1347
                }
1348

  
1349
                return true;
1350
            }
1351
            catch (Exception ex)
1352
            {
1353
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
1354
                return false;
1355
            }
1356
        }
1357
        #endregion
1315 1358
    }
1316 1359
}
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CostomerRegist/FrmCostomerRegistAuxiliary.cs
703 703

  
704 704
                List<DivisionMaster> bvList = new List<DivisionMaster>();
705 705
                // ValueからKeyを検索
706
                int DivisionCode = (int)DivisionMaster.DivisionMasterCodeDefine.OrderDivision;
706
                int DivisionCode = (int)DivisionMaster.DivisionMasterCodeDef.OrderDivision;
707 707
                string strSQL = dvDB.CreatePrimarykeyString(DivisionCode) + " And DeleteFlg = 0 ORDER BY DISPLAYORDER";
708 708
                if (!dvDB.SelectAction(strSQL, ref bvList)) return;
709 709
                if (bvList.Count == 0) return;
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRWork/FrmDRWorkAuxiliary.cs
552 552
        /// </summary>
553 553
        private void CreateNewLineData()
554 554
        {
555
            FrmSelectPaymentDay frm = new FrmSelectPaymentDay();
556 555
            try
557 556
            {
558 557
                // 対象グリッド取得
......
597 596
            {
598 597
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
599 598
            }
600
            finally
601
            {
602
                frm.Dispose(); frm = null;
603
            }
604 599
        }
605 600
        #endregion
606 601

  
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.designer.cs
716 716
            this.label6.Name = "label6";
717 717
            this.label6.Size = new System.Drawing.Size(110, 25);
718 718
            this.label6.TabIndex = 0;
719
            this.label6.Text = "当期必要給与";
719
            this.label6.Text = "当期予測給与";
720 720
            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
721 721
            // 
722 722
            // lblPayroll
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.Designer.cs
30 30
        {
31 31
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
32 32
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
33
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
33
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
34 34
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
35 35
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
36 36
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
......
39 39
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
40 40
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
41 41
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
42
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
43
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
44
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
45 42
            this.btnEnd = new System.Windows.Forms.Button();
43
            this.lblCellTotal = new System.Windows.Forms.Label();
44
            this.dgvMain = new ProcessManagement.Forms.CustomControls.DataGridViewEX();
46 45
            this.groupBox1 = new ProcessManagement.Forms.CustomControls.GroupBoxEx();
47 46
            this.cmbDepartment = new System.Windows.Forms.ComboBox();
48 47
            this.label4 = new System.Windows.Forms.Label();
......
52 51
            this.label2 = new System.Windows.Forms.Label();
53 52
            this.label3 = new System.Windows.Forms.Label();
54 53
            this.label5 = new System.Windows.Forms.Label();
55
            this.lblCellTotal = new System.Windows.Forms.Label();
56
            this.dgvMain = new ProcessManagement.Forms.CustomControls.DataGridViewEX();
57 54
            this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
58 55
            this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
59 56
            this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
......
62 59
            this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
63 60
            this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
64 61
            this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
65
            this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
66
            this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
67
            this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
62
            ((System.ComponentModel.ISupportInitialize)(this.dgvMain)).BeginInit();
68 63
            this.groupBox1.SuspendLayout();
69 64
            ((System.ComponentModel.ISupportInitialize)(this.numUDConstPro)).BeginInit();
70
            ((System.ComponentModel.ISupportInitialize)(this.dgvMain)).BeginInit();
71 65
            this.SuspendLayout();
72 66
            // 
73 67
            // btnEnd
......
83 77
            this.btnEnd.UseVisualStyleBackColor = false;
84 78
            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
85 79
            // 
80
            // lblCellTotal
81
            // 
82
            this.lblCellTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
83
            this.lblCellTotal.AutoSize = true;
84
            this.lblCellTotal.BackColor = System.Drawing.Color.Black;
85
            this.lblCellTotal.Font = new System.Drawing.Font("MS 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
86
            this.lblCellTotal.ForeColor = System.Drawing.Color.White;
87
            this.lblCellTotal.Location = new System.Drawing.Point(200, 559);
88
            this.lblCellTotal.Name = "lblCellTotal";
89
            this.lblCellTotal.Size = new System.Drawing.Size(0, 13);
90
            this.lblCellTotal.TabIndex = 53;
91
            // 
92
            // dgvMain
93
            // 
94
            this.dgvMain.AllowUserToAddRows = false;
95
            this.dgvMain.AllowUserToDeleteRows = false;
96
            this.dgvMain.AllowUserToResizeColumns = false;
97
            this.dgvMain.AllowUserToResizeRows = false;
98
            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
99
            this.dgvMain.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
100
            this.dgvMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
101
            | System.Windows.Forms.AnchorStyles.Left) 
102
            | System.Windows.Forms.AnchorStyles.Right)));
103
            this.dgvMain.BackgroundColor = System.Drawing.Color.White;
104
            this.dgvMain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
105
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
106
            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
107
            dataGridViewCellStyle2.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold);
108
            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
109
            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
110
            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
111
            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
112
            this.dgvMain.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
113
            this.dgvMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
114
            this.dgvMain.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
115
            this.Column1,
116
            this.Column2,
117
            this.Column3,
118
            this.Column4,
119
            this.Column5,
120
            this.Column6,
121
            this.Column7,
122
            this.Column8});
123
            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
124
            dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;
125
            dataGridViewCellStyle11.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold);
126
            dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.ControlText;
127
            dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.LightSeaGreen;
128
            dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
129
            dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
130
            this.dgvMain.DefaultCellStyle = dataGridViewCellStyle11;
131
            this.dgvMain.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
132
            this.dgvMain.EnableHeadersVisualStyles = false;
133
            this.dgvMain.Location = new System.Drawing.Point(7, 50);
134
            this.dgvMain.Name = "dgvMain";
135
            this.dgvMain.RowHeadersVisible = false;
136
            this.dgvMain.RowHeadersWidth = 20;
137
            this.dgvMain.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
138
            this.dgvMain.RowTemplate.Height = 21;
139
            this.dgvMain.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
140
            this.dgvMain.Size = new System.Drawing.Size(1120, 496);
141
            this.dgvMain.TabIndex = 52;
142
            this.dgvMain.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMain_CellDoubleClick);
143
            this.dgvMain.SelectionChanged += new System.EventHandler(this.dgvMain_SelectionChanged);
144
            this.dgvMain.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgvMain_MouseUp);
145
            // 
86 146
            // groupBox1
87 147
            // 
88 148
            this.groupBox1.Anchor = System.Windows.Forms.AnchorStyles.Top;
......
201 261
            this.label5.Text = "第";
202 262
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
203 263
            // 
204
            // lblCellTotal
205
            // 
206
            this.lblCellTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
207
            this.lblCellTotal.AutoSize = true;
208
            this.lblCellTotal.BackColor = System.Drawing.Color.Black;
209
            this.lblCellTotal.Font = new System.Drawing.Font("MS 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
210
            this.lblCellTotal.ForeColor = System.Drawing.Color.White;
211
            this.lblCellTotal.Location = new System.Drawing.Point(200, 559);
212
            this.lblCellTotal.Name = "lblCellTotal";
213
            this.lblCellTotal.Size = new System.Drawing.Size(0, 13);
214
            this.lblCellTotal.TabIndex = 53;
215
            // 
216
            // dgvMain
217
            // 
218
            this.dgvMain.AllowUserToAddRows = false;
219
            this.dgvMain.AllowUserToDeleteRows = false;
220
            this.dgvMain.AllowUserToResizeColumns = false;
221
            this.dgvMain.AllowUserToResizeRows = false;
222
            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
223
            this.dgvMain.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
224
            this.dgvMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
225
            | System.Windows.Forms.AnchorStyles.Left) 
226
            | System.Windows.Forms.AnchorStyles.Right)));
227
            this.dgvMain.BackgroundColor = System.Drawing.Color.White;
228
            this.dgvMain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
229
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
230
            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
231
            dataGridViewCellStyle2.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold);
232
            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
233
            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
234
            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
235
            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
236
            this.dgvMain.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
237
            this.dgvMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
238
            this.dgvMain.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
239
            this.Column1,
240
            this.Column2,
241
            this.Column3,
242
            this.Column4,
243
            this.Column5,
244
            this.Column6,
245
            this.Column7,
246
            this.Column8,
247
            this.Column9,
248
            this.Column10,
249
            this.Column11});
250
            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
251
            dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Window;
252
            dataGridViewCellStyle14.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold);
253
            dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.ControlText;
254
            dataGridViewCellStyle14.SelectionBackColor = System.Drawing.Color.LightSeaGreen;
255
            dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
256
            dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
257
            this.dgvMain.DefaultCellStyle = dataGridViewCellStyle14;
258
            this.dgvMain.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
259
            this.dgvMain.EnableHeadersVisualStyles = false;
260
            this.dgvMain.Location = new System.Drawing.Point(7, 50);
261
            this.dgvMain.Name = "dgvMain";
262
            this.dgvMain.RowHeadersVisible = false;
263
            this.dgvMain.RowHeadersWidth = 20;
264
            this.dgvMain.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
265
            this.dgvMain.RowTemplate.Height = 21;
266
            this.dgvMain.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
267
            this.dgvMain.Size = new System.Drawing.Size(1120, 496);
268
            this.dgvMain.TabIndex = 52;
269
            this.dgvMain.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMain_CellDoubleClick);
270
            this.dgvMain.SelectionChanged += new System.EventHandler(this.dgvMain_SelectionChanged);
271
            this.dgvMain.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgvMain_MouseUp);
272
            // 
273 264
            // Column1
274 265
            // 
275 266
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
......
289 280
            dataGridViewCellStyle4.Font = new System.Drawing.Font("MS P明朝", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
290 281
            this.Column2.DefaultCellStyle = dataGridViewCellStyle4;
291 282
            this.Column2.Frozen = true;
292
            this.Column2.HeaderText = "部署";
283
            this.Column2.HeaderText = "工事部署";
293 284
            this.Column2.Name = "Column2";
294 285
            this.Column2.ReadOnly = true;
286
            this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
295 287
            // 
296 288
            // Column3
297 289
            // 
......
299 291
            dataGridViewCellStyle5.Font = new System.Drawing.Font("MS P明朝", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
300 292
            this.Column3.DefaultCellStyle = dataGridViewCellStyle5;
301 293
            this.Column3.Frozen = true;
302
            this.Column3.HeaderText = "担当者名";
294
            this.Column3.HeaderText = "工事担当";
303 295
            this.Column3.Name = "Column3";
304 296
            this.Column3.ReadOnly = true;
305 297
            this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
......
366 358
            this.Column8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
367 359
            this.Column8.Width = 120;
368 360
            // 
369
            // Column9
370
            // 
371
            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
372
            dataGridViewCellStyle11.Font = new System.Drawing.Font("Century", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
373
            this.Column9.DefaultCellStyle = dataGridViewCellStyle11;
374
            this.Column9.HeaderText = "会社経費";
375
            this.Column9.Name = "Column9";
376
            this.Column9.ReadOnly = true;
377
            this.Column9.Resizable = System.Windows.Forms.DataGridViewTriState.False;
378
            this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
379
            // 
380
            // Column10
381
            // 
382
            dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
383
            dataGridViewCellStyle12.Font = new System.Drawing.Font("Century", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
384
            this.Column10.DefaultCellStyle = dataGridViewCellStyle12;
385
            this.Column10.HeaderText = "部署経費";
386
            this.Column10.Name = "Column10";
387
            this.Column10.ReadOnly = true;
388
            this.Column10.Resizable = System.Windows.Forms.DataGridViewTriState.False;
389
            this.Column10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
390
            // 
391
            // Column11
392
            // 
393
            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
394
            dataGridViewCellStyle13.Font = new System.Drawing.Font("Century", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
395
            this.Column11.DefaultCellStyle = dataGridViewCellStyle13;
396
            this.Column11.HeaderText = "営業経費";
397
            this.Column11.Name = "Column11";
398
            this.Column11.ReadOnly = true;
399
            this.Column11.Resizable = System.Windows.Forms.DataGridViewTriState.False;
400
            this.Column11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
401
            // 
402 361
            // FrmPriceOfBudget
403 362
            // 
404 363
            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......
419 378
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
420 379
            this.Text = "未作成台帳確認";
421 380
            this.Load += new System.EventHandler(this.FrmCostStructureDiag_Load);
381
            ((System.ComponentModel.ISupportInitialize)(this.dgvMain)).EndInit();
422 382
            this.groupBox1.ResumeLayout(false);
423 383
            ((System.ComponentModel.ISupportInitialize)(this.numUDConstPro)).EndInit();
424
            ((System.ComponentModel.ISupportInitialize)(this.dgvMain)).EndInit();
425 384
            this.ResumeLayout(false);
426 385
            this.PerformLayout();
427 386

  
......
449 408
        private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
450 409
        private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
451 410
        private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
452
        private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
453
        private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
454
        private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
455 411
    }
456 412
}
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.cs
38 38
            ConstrCode,
39 39
            ConstrName,
40 40
            OrderDate,
41
            ConnstrStatus,
41
            ConstrStatus,
42 42
            OrdersPrice,
43
            CompanyExpeses,
44
            DepartmentExpeses,
45
            SaleseExpeses,
46 43
        }
47 44
        /// <summary>
48
        /// グリッド表示行数
49
        /// </summary>
50
        private const int s_GridDispLine = 5;
51
        /// <summary>
52 45
        /// 自画面幅
53 46
        /// </summary>
54 47
        private const int s_MyWidth = 682;
......
106 99
        private static Color s_RowSelectForeColor = Color.White;
107 100
        private static Color s_RowSelectBackColor = Color.Blue;
108 101
        #endregion
102

  
103
        #region 合計行固定コード
104
        /// <summary>
105
        /// 合計行固定コード
106
        /// </summary>
107
        private const int s_TotalCode = 999999999;
109 108
        #endregion
109
        #endregion
110 110

  
111 111
        #region 変数
112 112
        /// <summary>
......
125 125
        /// </summary>
126 126
        private DialogResult m_EndButton = DialogResult.None;
127 127

  
128
        // 合計エリア
129
        private long[] m_TotalArea;
130

  
131 128
        /// <summary>
132
        /// 経費率マスタレコード数
133
        /// </summary>
134
        private int m_ExpensesMasterCount = 3;
135
        /// <summary>
136 129
        /// 次画面選択
137 130
        /// </summary>
138 131
        private bool m_NextProc = false;
......
427 420
            {
428 421
                DataGridView dgv = dgvMain;
429 422
                DataGridViewRow CurRow = dgv.Rows[CurrentRow];
423

  
424
                Color wrkBackColor = Color.White;
425
                Color wrkForeColor = Color.Black;
426

  
427
                // 奇数行は色を変える
428
                if ((CurrentRow % 2) > 0)
429
                {
430
                    wrkBackColor = dgv.AlternatingRowsDefaultCellStyle.BackColor;
431
                    wrkForeColor = dgv.AlternatingRowsDefaultCellStyle.ForeColor;
432
                }
433
                if (CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.ConstrCode].Value) == s_TotalCode)
434
                {
435
                    wrkBackColor = s_RowTotalBackColor;
436
                    wrkForeColor = s_RowTotalForeColor;
437
                }
438

  
430 439
                // 行の色を変える
431 440
                for (int i = 0; i < dgv.Columns.Count; i++)
432 441
                {
433
                    CurRow.Cells[i].Style.BackColor = Color.White;
434
                    CurRow.Cells[i].Style.ForeColor = Color.Black;
442
                    CurRow.Cells[i].Style.BackColor = wrkBackColor;
443
                    CurRow.Cells[i].Style.ForeColor = wrkForeColor;
435 444
                }
436 445
            }
437 446
            catch (System.Exception ex)
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudget.resx
141 141
  <metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
142 142
    <value>True</value>
143 143
  </metadata>
144
  <metadata name="Column9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
145
    <value>True</value>
146
  </metadata>
147
  <metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
148
    <value>True</value>
149
  </metadata>
150
  <metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
151
    <value>True</value>
152
  </metadata>
153 144
</root>
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PriceOfBudget/FrmPriceOfBudgetAuxiliary.cs
41 41
            DataGridView dgv = dgvMain;
42 42
            try
43 43
            {
44
                // ?????v?G???A??????
45
                int TotalColCnt = Enum.GetNames(typeof(GridColumn)).Length;
46
                m_TotalArea = new long[TotalColCnt];
47
                Array.Clear(m_TotalArea, 0, m_TotalArea.Length);
48

  
49 44
                dgv.Rows.Clear();
50 45

  
46
                // ?????H????????X?g
47
                List<int> nConstrCodeList = new List<int>();
48
                List<KeyValuePair<int, string>> ExpList = new List<KeyValuePair<int, string>>();
49
                // ???v?G???A
50
                long[] TotalArea = null;
51

  
51 52
                // ???????f?[?^?\??????
52
                SetNotCreateRowData();
53
                SetNotCreateRowData(ref nConstrCodeList, ref ExpList, ref TotalArea);
53 54

  
54 55
                // ???f?[?^?\??
55
                SetCreateRowData();
56
                SetCreateRowData(ExpList, ref TotalArea);
56 57

  
57 58
                // ?????v??\??????
58
                DisplayTotalRow((int)RowTitleNum.AllTotal, m_TotalArea);
59
                DisplayTotalRow((int)RowTitleNum.AllTotal, TotalArea);
59 60

  
60 61
            }
61 62
            catch (System.Exception ex)
......
76 77
        /// <summary>
77 78
        /// ????????
78 79
        /// </summary>
79
        private enum DetilData
80
        private enum GetDataEnum
80 81
        {
81 82
            /// <summary>
82
            /// ?????\????
83
            /// 0:?????\????
83 84
            /// </summary>
84
            DepDisplayOrder = 0,
85
            DepDisp = 0,
85 86
            /// <summary>
86
            /// ?H?????
87
            /// 1:?????R?[?h
87 88
            /// </summary>
88
            ConstructionCode,
89
            DepCode,
89 90
            /// <summary>
90
            /// ????z
91
            /// 2:??????
91 92
            /// </summary>
92
            OrdersDecisionPrice,
93
            DepName,
93 94
            /// <summary>
94
            /// ?{?H???t???O
95
            /// 3:?H?????
95 96
            /// </summary>
96
            ConstructionStatusFlg,
97
            ConstrCode,
97 98
            /// <summary>
98
            /// ?H???S??????
99
            /// 4:?H??????
99 100
            /// </summary>
100
            ConstructionPersonCode,
101
            ConstrName,
101 102
            /// <summary>
102
            /// ??????
103
            /// 5:?S????\????
103 104
            /// </summary>
104
            DepartmentString,
105
            ManDisp,
105 106
            /// <summary>
106
            /// ?S?????
107
            /// 6:?H???S??????
107 108
            /// </summary>
108
            PersonName,
109
            ManCode,
109 110
            /// <summary>
110
            /// ???o??
111
            /// 7:?S?????
111 112
            /// </summary>
112
            ExpensesRaito1,
113
            ManName,
113 114
            /// <summary>
114
            /// ?????o??
115
            /// 8:???
115 116
            /// </summary>
116
            ExpensesRaito2,
117
            OrderDate,
117 118
            /// <summary>
118
            /// ?c??o??
119
            /// 9:????z
119 120
            /// </summary>
120
            ExpensesRaito3,
121
            OrValue,
121 122
            /// <summary>
122
            /// ?H??????
123
            /// 10:?{?H???t???O
123 124
            /// </summary>
124
            ConstrName,
125
            Stat,
125 126
            /// <summary>
126
            /// ?S????\????
127
            /// 11:?o??\????
127 128
            /// </summary>
128
            PersonDisplayOrder,
129
            ExpDisp,
129 130
            /// <summary>
130
            /// ???
131
            /// 12:?o??R?[?h
131 132
            /// </summary>
132
            OrderDate,
133
            ExpCode,
133 134
            /// <summary>
134
            /// ?H???\?Z???F?O???[?v??
135
            /// 13:?o????
135 136
            /// </summary>
136
            GroupCount,
137
            ExpName,
137 138
            /// <summary>
138
            /// ?H???\?Z???F?s?J?E???g
139
            /// 14:?o??
139 140
            /// </summary>
140
            LineCount,
141
            ExpRaito,
141 142
            /// <summary>
142
            /// ?H???\?Z???F???s???z
143
            /// 15:?o????z
143 144
            /// </summary>
144
            ExecutionAmount,
145
            /// <summary>
146
            /// ?H???\?Z???F???z??
147
            /// </summary>
148
            AmountConfigRate,
145
            ExpVal,
149 146
        }
150 147
        #endregion
151 148

  
......
153 150
        /// <summary>
154 151
        /// ???????f?[?^?\??????
155 152
        /// </summary>
156
        private void SetNotCreateRowData()
153
        private void SetNotCreateRowData(ref List<int> nConstrCodeList, ref List<KeyValuePair<int, string>> ExpList, ref long[] TotalArea)
157 154
        {
158 155
            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
159
            DataGridView dgv = dgvMain;
160

  
161
            // ???v?G???A??????
162
            int TotalColCnt = Enum.GetNames(typeof(GridColumn)).Length;
163
            long[] CurTotalArea = new long[TotalColCnt];
164
            Array.Clear(CurTotalArea, 0, CurTotalArea.Length);
156
            long[] CurTotalArea = null;
165 157
            try
166 158
            {
167 159
                int SelectPeriod = (int)numUDConstPro.Value;
......
170 162
                // ?R???{?{?b?N?X???I??S???????????
171 163
                int PersonCode = GetConstructionPersonCode();
172 164

  
173
                int iCode1 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?? ?? ??")).Key;
174
                int iCode2 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?{?H?J?n")).Key;
175

  
165
                #region ???r?p?k
176 166
                StringBuilder strSQL = new StringBuilder();
177
                strSQL.Append("(SELECT C1.DISPLAYORDER");
178
                strSQL.Append(", A.CONSTRUCTIONCODE");
179
                strSQL.Append(", A.ORDERSDECISIONPRICE");
180
                strSQL.Append(", A.CONSTRUCTIONSTATUSFLG");
181
                strSQL.Append(", A.CONSTRUCTIONPERSONCODE");
182
                strSQL.Append(", C1.DEPARTMENTSTRING");
183
                strSQL.Append(", B1.PERSONNAME");
184
                strSQL.Append(", D1.EXPENSESRAITO");
185
                strSQL.Append(", D2.EXPENSESRAITO");
186
                strSQL.Append(", D3.EXPENSESRAITO");
187
                strSQL.Append(", E1.DETAILSTRING");
188
                strSQL.Append(", B1.DISPLAYORDER");
189

  
167
                strSQL.Append("SELECT");
168
                strSQL.Append(" C1.DISPLAYORDER AS DepDisp");
169
                strSQL.Append(", C1.DepartmentCode AS DepCode");
170
                strSQL.Append(", A1.DetailString As DepName");
171
                strSQL.Append(", A.CONSTRUCTIONCODE As ConstrCode");
172
                strSQL.Append(", E1.DETAILSTRING As ConstrName");
173
                strSQL.Append(", B1.DISPLAYORDER AS ManDisp");
174
                strSQL.Append(", A.CONSTRUCTIONPERSONCODE As ManCode");
175
                strSQL.Append(", B1.PERSONNAME As ManName");
190 176
                strSQL.Append(", CASE");
191 177
                strSQL.AppendFormat(" WHEN DATE(A.ORDERDATE) = DATE('{0}')", DateTime.MinValue.ToShortDateString());
192 178
                strSQL.Append(" Then A.ProvisionalOrderDate");
193
                strSQL.Append(" Else");
194
                strSQL.Append(" A.ORDERDATE");
179
                strSQL.Append(" Else A.ORDERDATE");
195 180
                strSQL.Append(" End As ORDERDATE");
181
                strSQL.Append(", ifNull(Bud.OrdersDecisionPrice, A.ORDERSDECISIONPRICE) As OrValue");
182
                strSQL.Append(", A.CONSTRUCTIONSTATUSFLG As Stat");
183
                strSQL.Append(", ExpName.DisplayOrder AS ExpDisp");
184
                strSQL.Append(", Budget.ComponentCode As ExpCode");
185
                strSQL.Append(", ExpName.NameString As ExpName");
186
                strSQL.Append(", D1.EXPENSESRAITO As ExpRaito");
187
                strSQL.Append(", Budget.ExecutionAmount As ExpVal");
196 188

  
197
                //strSQL.Append(", A.ORDERDATE");
189
                strSQL.Append(" FROM");
190
                strSQL.Append(" CONSTRUCTIONBASEINFO A");
198 191

  
199
                strSQL.Append(", Budget.GroupCount");
200
                strSQL.Append(", Budget.LineCount");
201
                strSQL.Append(", Budget.ExecutionAmount");
202
                strSQL.Append(", Budget.AmountConfigRate");
203
                strSQL.Append(", ExpName.DisplayOrder");
192
                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL E1");
193
                strSQL.Append("        On E1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
194
                strSQL.AppendFormat("  AND E1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
204 195

  
205
                strSQL.Append(" FROM CONSTRUCTIONBASEINFO A");
206

  
207
                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL A1");
208
                strSQL.Append(" ON A1.ConstructionCode = A.ConstructionCode");
196
                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL A1");
197
                strSQL.Append("       ON A1.ConstructionCode = A.ConstructionCode");
209 198
                strSQL.AppendFormat(" And A1.DetailNo = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstrDepartmentName);
210 199

  
211
                strSQL.Append(" LEFT JOIN constructionbudgetdetail AS Budget");
212
                strSQL.Append(" ON Budget.ConstructionCode = A.ConstructionCode");
200
                strSQL.Append(" LEFT JOIN CONSTRUCTIONBUDGET AS Bud");
201
                strSQL.Append(" ON Bud.ConstructionCode = A.ConstructionCode");
202

  
203
                strSQL.Append(" LEFT JOIN CONSTRUCTIONBUDGETDETAIL AS Budget");
204
                strSQL.Append("       ON Budget.ConstructionCode = A.ConstructionCode");
213 205
                strSQL.AppendFormat(" And Budget.GroupCount = {0}", (int)FrmConstructionBudget.DataGroup.Expenses);
214 206

  
207
                strSQL.Append(" LEFT JOIN DEPARTMENTMASTER C1");
208
                strSQL.Append("       On C1.DEPARTMENTCODE = A.ConstrDepCode");
209

  
215 210
                strSQL.Append(" LEFT JOIN divisionmaster AS ExpName");
216
                strSQL.AppendFormat(" ON ExpName.DivisionCode = {0}", (int)DivisionMaster.DivisionMasterCodeDefine.ConstructionExpenses);
217
                strSQL.Append(" And ExpName.NameCode = Budget.ComponentCode");
211
                strSQL.AppendFormat(" ON ExpName.DivisionCode = {0}", (int)DivisionMaster.DivisionMasterCodeDef.ConstructionExpenses);
212
                strSQL.Append("       And ExpName.NameCode = Budget.ComponentCode");
218 213

  
219
                strSQL.Append(", PERSONINCHARGEMASTER B1");
220
                strSQL.Append(", DEPARTMENTMASTER C1");
221
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER D1 ON D1.DEPARTMENTCODE = C1.DEPARTMENTCODE AND D1.EXPENSESPERIOD = {0} AND D1.NameCode = 3", SelectPeriod);
222
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER D2 ON D2.DEPARTMENTCODE = C1.DEPARTMENTCODE AND D2.EXPENSESPERIOD = {0} AND D2.NameCode = 2", SelectPeriod);
223
                strSQL.AppendFormat(" LEFT JOIN DEPARTMENTEXPENSESMASTER D3 ON D3.DEPARTMENTCODE = C1.DEPARTMENTCODE AND D3.EXPENSESPERIOD = {0} AND D3.NameCode = 1", SelectPeriod);
224
                strSQL.Append(", CONSTRUCTIONBASEINFODETAIL E1");
225
                strSQL.Append(" WHERE NOT EXISTS (SELECT * FROM CONSTRUCTIONLEDGER A1 WHERE A1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE)");
226
                strSQL.AppendFormat(" AND A.CONSTRUCTIONPERIOD = {0}", SelectPeriod);
214
                strSQL.Append(" LEFT JOIN DEPARTMENTEXPENSESMASTER D1");
215
                strSQL.Append("       ON D1.DEPARTMENTCODE = C1.DEPARTMENTCODE");
216
                strSQL.AppendFormat(" AND D1.EXPENSESPERIOD = {0}", SelectPeriod);
217
                strSQL.Append("       AND D1.NameCode = ExpName.NameCode");
227 218

  
219
                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER B1");
220
                strSQL.Append("       On B1.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
221

  
222
                strSQL.Append(" WHERE");
223
                strSQL.AppendFormat(" A.CONSTRUCTIONPERIOD = {0}", SelectPeriod);
228 224
                strSQL.AppendFormat(" AND A.TYINGFLG != {0}", (int)ConstructionBaseInfo.TyingFlgDef.Tying);
229 225
                strSQL.AppendFormat(" AND A.JOINFLG != {0}", (int)ConstructionBaseInfo.JoinFlgDef.JoinChildren);
230 226

  
231
                strSQL.AppendFormat(" And ({0} <= A.ConstructionStatusFlg And A.ConstructionStatusFlg <= {1})", iCode1, iCode2);
232
                strSQL.Append(" AND B1.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
233
                strSQL.Append(" AND C1.DEPARTMENTCODE = A.ConstrDepCode");
234
                strSQL.Append(" AND E1.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
235
                strSQL.AppendFormat(" AND E1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
227
                strSQL.Append(" And");
228
                strSQL.Append(TargetStatusSQL("A."));
229

  
230
                strSQL.Append(" And NOT EXISTS(");
231
                strSQL.Append("         SELECT * FROM processapproval As Approval");
232
                strSQL.Append("         WHERE");
233
                strSQL.Append("            Approval.ConstructionCode = A.CONSTRUCTIONCODE");
234
                strSQL.AppendFormat("      And Approval.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval);
235
                strSQL.Append("            And Approval.SeqNo = 1");
236
                strSQL.AppendFormat("      And Approval.ApprovalStatus = {0})", (int)CommonDefine.ApprovalStatus.Approval);
237

  
236 238
                if (DepartmantCode > 0)
237 239
                {
238 240
                    strSQL.AppendFormat(" AND A.ConstrDepCode = {0}", DepartmantCode);
239 241
                    strSQL.AppendFormat(" And A1.DetailString = '{0}'", cmbDepartment.Text);
240 242
                }
243

  
241 244
                if (PersonCode > 0) strSQL.AppendFormat(" AND A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
242
                strSQL.Append(")");
243
                strSQL.Append(" ORDER BY 1, 12, 2, 18");
244 245

  
245
                ArrayList DatArList = new ArrayList();
246
                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref DatArList)) return;
247
                if (DatArList.Count == 0) return;
246
                strSQL.Append(" ORDER BY DepDisp, ManDisp, ConstrCode, ExpDisp");
247
                #endregion
248 248

  
249
                ArrayList DataArList = new ArrayList();
250
                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref DataArList)) return;
251
                if (DataArList.Count == 0) return;
252

  
253
                
254

  
255
                // ?????????X?g??
256
                GetProcList(DataArList, ref nConstrCodeList, ref ExpList);
257

  
258
                DataGridView dgv = dgvMain;
259
                dgv.Rows.Clear();
260

  
261
                // ?O???b?h??o??????????
262
                CreateExpensesColumn(ExpList);
263

  
264
                // ???????v?G???A??????
265
                int TotalColCnt = ExpList.Count + 1;
266
                CurTotalArea = new long[TotalColCnt];
267

  
268
                // ?????v?G???A??????
269
                TotalArea = new long[TotalColCnt];
270

  
249 271
                int ino = 1;
250
                bool FirstFlg = true;
251
                string BreakKey = string.Empty;
252
                string workDepName = string.Empty;
253
                int ConstrCode = 0;
254
                int ConstrStatus = 0;
255
                long OrdersDecisionPrice = 0;
256
                long[] ExpensesVal = new long[3];
257
                string [] strValue = new string[2];
258
                DateTime dtOrderDate = DateTime.Now;
272
                long[] ExpensesVal = new long[TotalColCnt];
259 273

  
260
                for (int nDataCount = 0; nDataCount < DatArList.Count; nDataCount++)
274
                object[] DspData = new object[dgv.ColumnCount];
275
                object[] FirstWork = (object[])DataArList[0];
276
                string strBreakDep = CommonMotions.cnvString(FirstWork[(int)GetDataEnum.DepName]);
277
                foreach(int CurData in nConstrCodeList)
261 278
                {
262
                    object[] objGetArry = (object[])DatArList[nDataCount];
279
                    // ?s?f?[?^??
280
                    CreateRowData(DataArList, CurData, ExpList, ref DspData, ref ExpensesVal);
263 281

  
264
                    // ?H???????
265
                    ConstrCode = CommonMotions.cnvInt(objGetArry[(int)DetilData.ConstructionCode]);
266
                    Array.Clear(ExpensesVal, 0, ExpensesVal.Length);
282
                    // ??????????1?s?J????
283
                    string strDepName = CommonMotions.cnvString(DspData[(int)GridColumn.DepartmentName]);
284
                    if (strBreakDep != strDepName) dgv.Rows.Add(1);
285
                    strBreakDep = strDepName;
267 286

  
268
                    // ???f?[?^????
269
                    int DataCnt = DatArList.Cast<object[]>().Where(x => CommonMotions.cnvInt(x[(int)DetilData.ConstructionCode]) == ConstrCode).Count();
270

  
271
                    if (DataCnt == 1)
287
                    int RowIndex = dgv.Rows.Add(1);
288
                    DataGridViewRow dgvRow = dgv.Rows[RowIndex];
289
                    foreach(DataGridViewCell CurCell in dgvRow.Cells)
272 290
                    {
273
                        SetNotCreatedOneceRow(objGetArry
274
                                                , ref ConstrStatus
275
                                                , ref OrdersDecisionPrice
276
                                                , ref ExpensesVal
277
                                                , ref workDepName
278
                                                , ref strValue
279
                                                , ref dtOrderDate);
291
                        switch (CurCell.ColumnIndex)
292
                        {
293
                            case 0:
294
                                CurCell.Value = (ino++);
295
                                break;
296
                            case 1:                 // ??????
297
                            case 2:                 // ?S?????
298
                            case 3:                 // ?H?????
299
                            case 4:                 // ?H??????                 
300
                            case 5:                 // ???
301
                            case 6:                 // ?{?H???
302
                                CurCell.Value = DspData[CurCell.ColumnIndex];
303
                                break;
304
                            default:                // ????z->?o??S??
305
                                CurCell.Value = CommonMotions.cnvLong(DspData[CurCell.ColumnIndex]).ToString("#,0");
306
                                break;
307
                        }
280 308
                    }
281
                    else
309
                    // ???????v???Z
310
                    for (int i = 0; i < CurTotalArea.Length; i++)
282 311
                    {
283
                        SetNotCreatedMultiRow(DatArList
284
                                                , ConstrCode
285
                                                , ref ConstrStatus
286
                                                , ref OrdersDecisionPrice
287
                                                , ref ExpensesVal
288
                                                , ref workDepName
289
                                                , ref strValue
290
                                                , ref dtOrderDate
291
                                                , ref nDataCount);
312
                        CurTotalArea[i] += ExpensesVal[(i)];
292 313
                    }
293

  
294
                    if (!BreakKey.Equals(workDepName))
295
                    {
296
                        if (!FirstFlg) dgv.Rows.Add(1);
297
                        FirstFlg = false;
298
                        BreakKey = workDepName;
299
                    }
300
                    else
301
                    {
302
                        workDepName = string.Empty;
303
                    }
304

  
305
                    dgv.Rows.Add((ino++)
306
                                    , workDepName                                   // ??????
307
                                    , strValue[0]                                   // ?S?????
308
                                    , ConstrCode                                    // ?H?????
309
                                    , strValue[1]                                   // ?H??????
310
                                    , dtOrderDate.ToShortDateString()               // ???
311
                                    , CommonDefine.ProjectsStatus[ConstrStatus]     // ?{?H???
312
                                    , OrdersDecisionPrice.ToString("#,0")           // ????z
313
                                    , ExpensesVal[0].ToString("#,0")                // ???o??
314
                                    , ExpensesVal[1].ToString("#,0")                // ?????o??
315
                                    , ExpensesVal[2].ToString("#,0")                // ?c??o??
316
                                );
317

  
318
                    CurTotalArea[(int)GridColumn.OrdersPrice] += OrdersDecisionPrice;                                   // ????z
319
                    CurTotalArea[(int)GridColumn.CompanyExpeses] += ExpensesVal[0];                                     // ???o??
320
                    CurTotalArea[(int)GridColumn.DepartmentExpeses] += ExpensesVal[1];                                  // ?????o??
321
                    CurTotalArea[(int)GridColumn.SaleseExpeses] += ExpensesVal[2];                                      // ?c??o??
322 314
                }
323

  
324
                m_TotalArea[(int)GridColumn.OrdersPrice] += CurTotalArea[(int)GridColumn.OrdersPrice];
325
                m_TotalArea[(int)GridColumn.CompanyExpeses] += CurTotalArea[(int)GridColumn.CompanyExpeses];
326
                m_TotalArea[(int)GridColumn.DepartmentExpeses] += CurTotalArea[(int)GridColumn.DepartmentExpeses];
327
                m_TotalArea[(int)GridColumn.SaleseExpeses] += CurTotalArea[(int)GridColumn.SaleseExpeses];
315
                // ???v???Z
316
                for (int i = 0; i < TotalArea.Length; i++)
317
                {
318
                    TotalArea[i] += CurTotalArea[i];
319
                }
328 320
            }
329 321
            catch (System.Exception ex)
330 322
            {
......
340 332
        }
341 333
        #endregion
342 334

  
343
        #region ???????P?s????
335
        #region ?????\???p?f?[?^??SQL??
344 336
        /// <summary>
345
        /// ???????P?s????
337
        /// ?????\???p?f?[?^??SQL??
346 338
        /// </summary>
347
        private void SetNotCreatedOneceRow(object[] objGetArry
348
                                            , ref int ConstrStatus
349
                                            , ref long OrdersDecisionPrice
350
                                            , ref long[] ExpensesVal
351
                                            , ref string DepName
352
                                            , ref string[] strValue
353
                                            , ref DateTime dtOrderDate)
339
        private string TargetStatusSQL(string strArias = "")
354 340
        {
341
            StringBuilder strSQL = new StringBuilder();
355 342
            try
356 343
            {
357
                ConstrStatus = CommonMotions.cnvInt(objGetArry[(int)DetilData.ConstructionStatusFlg]);                  // ?{?H???t???O
358
                OrdersDecisionPrice = CommonMotions.cnvLong(objGetArry[(int)DetilData.OrdersDecisionPrice]);            // ????z
359
                double ExpensesRaito1 = CommonMotions.cnvDouble(objGetArry[(int)DetilData.ExpensesRaito1]) / 100.0;     // ???o??
360
                double ExpensesRaito2 = CommonMotions.cnvDouble(objGetArry[(int)DetilData.ExpensesRaito2]) / 100.0;     // ?????o??
361
                double ExpensesRaito3 = CommonMotions.cnvDouble(objGetArry[(int)DetilData.ExpensesRaito3]) / 100.0;     // ?c??o??
362
                ExpensesVal[0] = CommonMotions.cnvRound(OrdersDecisionPrice * ExpensesRaito1);
363
                ExpensesVal[1] = CommonMotions.cnvRound(OrdersDecisionPrice * ExpensesRaito2);
364
                ExpensesVal[2] = CommonMotions.cnvRound(OrdersDecisionPrice * ExpensesRaito3);
344
                List<int> stat = new List<int>();
345
                stat.Add(CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?? ?? ??")).Key);           // 3
346
                stat.Add(CommonDefine.ProjectsStatus.First(x => x.Value.Equals("??@?@??")).Key);           // 4
347
                stat.Add(CommonDefine.ProjectsStatus.First(x => x.Value.Equals("???????p")).Key);           // 5
348
                stat.Add(CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?{?H????")).Key);           // 6
349
                stat.Add(CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?{?H?J?n")).Key);           // 7
365 350

  
366
                DepName = CommonMotions.cnvString(objGetArry[(int)DetilData.DepartmentString]);                         // ????????
351
                strSQL.AppendFormat(" {0}ConstructionStatusFlg IN (", strArias);
352
                bool bFirst = true;
353
                foreach (int CurData in stat)
354
                {
355
                    if (!bFirst) strSQL.Append(", ");
356
                    strSQL.AppendFormat("{0}", CurData);
357
                    bFirst = false;
358
                }
359
                strSQL.Append(")");
367 360

  
368
                strValue[0] = CommonMotions.cnvString(objGetArry[(int)DetilData.PersonName]);                           // ?S?????
369
                strValue[1] = CommonMotions.cnvString(objGetArry[(int)DetilData.ConstrName]);                           // ?H??????
361
                return strSQL.ToString();
362
            }
363
            catch (Exception ex)
364
            {
365
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
366
                return string.Empty;
367
            }
368
        }
369
        #endregion
370 370

  
371
                dtOrderDate = CommonMotions.cnvDate(objGetArry[(int)DetilData.OrderDate]);                              // ???
371
        #region ?????????X?g??
372
        /// <summary>
373
        /// ?????????X?g??
374
        /// </summary>
375
        private void GetProcList(ArrayList DatArList
376
                                , ref List<int> nConstrCodeList
377
                                , ref List<KeyValuePair<int, string>> ExpList)
378
        {
379
            try
380
            {
381
                int BKey1 = 0;
382
                foreach (object[] objRec in DatArList)
383
                {
384
                    // ???H???????X?g??????
385
                    int nCode = CommonMotions.cnvInt(objRec[(int)GetDataEnum.ConstrCode]);
386
                    if (BKey1 != nCode)
387
                    {
388
                        nConstrCodeList.Add(nCode);
389
                        BKey1 = nCode;
390
                    }
391
                    // ?o????????X?g??????
392
                    int nExpCode = CommonMotions.cnvInt(objRec[(int)GetDataEnum.ExpCode]);
393
                    if (nExpCode < 1) continue;
394
                    if (!ExpList.Exists(x => x.Key == nExpCode))
395
                    {
396
                        string strName = CommonMotions.cnvString(objRec[(int)GetDataEnum.ExpName]);
397
                        ExpList.Add(new KeyValuePair<int, string>(nExpCode, strName));
398
                    }
399
                }
372 400
            }
373
            catch (System.Exception ex)
401
            catch (Exception ex)
374 402
            {
375 403
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
376 404
            }
377 405
        }
378 406
        #endregion
379 407

  
380
        #region ???????????s????
381 408
        /// <summary>
382
        /// ???????????s????
409
        /// ?x???????G???A
383 410
        /// </summary>
384
        private void SetNotCreatedMultiRow(ArrayList DatArList
385
                                            , int ConstrCode
386
                                            , ref int ConstrStatus
387
                                            , ref long OrdersDecisionPrice
388
                                            , ref long[] ExpensesVal
389
                                            , ref string DepName
390
                                            , ref string[] strValue
391
                                            , ref DateTime dtOrderDate
392
                                            , ref int nDataCount)
411
        private bool bCreateColumn = false;
412
        private DataGridViewColumn[] m_GridExpColList = null;
413
        private DataGridViewCellStyle[] m_GridExpCellStyleList = null;
414
        #region ?O???b?h??o??????????
415
        /// <summary>
416
        /// ?O???b?h??o??????????
417
        /// </summary>
418
        private void CreateExpensesColumn(List<KeyValuePair<int, string>> ExpList)
393 419
        {
394 420
            try
395 421
            {
396
                object[] TargetData = DatArList.Cast<object[]>().Where(x => CommonMotions.cnvInt(x[(int)DetilData.ConstructionCode]) == ConstrCode).ToArray();
422
                if (bCreateColumn) return;
397 423

  
398
                object[] FirstRec = (object[])TargetData[0];
424
                DataGridView dgv = dgvMain;
399 425

  
400
                ConstrStatus = CommonMotions.cnvInt(FirstRec[(int)DetilData.ConstructionStatusFlg]);                    // ?{?H???t???O
401
                OrdersDecisionPrice = CommonMotions.cnvLong(FirstRec[(int)DetilData.OrdersDecisionPrice]);              // ????z
402
                DepName = CommonMotions.cnvString(FirstRec[(int)DetilData.DepartmentString]);                           // ????????
403
                strValue[0] = CommonMotions.cnvString(FirstRec[(int)DetilData.PersonName]);                             // ?S?????
404
                strValue[1] = CommonMotions.cnvString(FirstRec[(int)DetilData.ConstrName]);                             // ?H??????
405
                dtOrderDate = CommonMotions.cnvDate(FirstRec[(int)DetilData.OrderDate]);                                // ???
426
                int nAddColCnt = ExpList.Count;
406 427

  
407
                for (int i = 0; i < TargetData.Length; i++)
428
                m_GridExpColList = new DataGridViewColumn[nAddColCnt];
429
                m_GridExpCellStyleList=new DataGridViewCellStyle[nAddColCnt];
430
                for (int i = 0; i < nAddColCnt; i++)
408 431
                {
409
                    if (i < m_ExpensesMasterCount)
432
                    // ?X?^?C????
433
                    m_GridExpCellStyleList[i] = new DataGridViewCellStyle();
434
                    m_GridExpCellStyleList[i].Alignment = DataGridViewContentAlignment.MiddleRight;
435
                    m_GridExpCellStyleList[i].Font = new System.Drawing.Font("Century", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
436

  
437
                    // ?Z????
438
                    m_GridExpColList[i] = new DataGridViewColumn();
439
                    m_GridExpColList[i].CellTemplate = new DataGridViewTextBoxCell();
440
                    dgv.Columns.Add(m_GridExpColList[i]);
441

  
442
                    // ?J????????
443
                    m_GridExpColList[i].CellTemplate = new DataGridViewTextBoxCell();
444
                    m_GridExpColList[i].DefaultCellStyle = m_GridExpCellStyleList[i];
445
                    m_GridExpColList[i].HeaderText = ExpList[i].Value;
446

  
447
                    m_GridExpColList[i].Name = string.Format("ColExpenses{0}", (i + 1));
448
                    m_GridExpColList[i].ReadOnly = true;
449
                    m_GridExpColList[i].Resizable = DataGridViewTriState.False;
450
                    m_GridExpColList[i].SortMode = DataGridViewColumnSortMode.NotSortable;
451
                    m_GridExpColList[i].Width = 100;
452
                }
453

  
454
                bCreateColumn = true;
455
            }
456
            catch (Exception ex)
457
            {
458
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
459
            }
460
        }
461
        #endregion
462

  
463
        #region ?s?f?[?^??
464
        /// <summary>
465
        /// ?s?f?[?^??
466
        /// </summary>
467
        private void CreateRowData(ArrayList DataArList
468
                                    , int CurData
469
                                    , List<KeyValuePair<int, string>> ExpList
470
                                    , ref object[] DspData
471
                                    , ref long[] ExpensesVal)
472
        {
473
            try
474
            {
475
                Array.Clear(DspData, 0, DspData.Length);
476
                Array.Clear(ExpensesVal, 0, ExpensesVal.Length);
477

  
478
                int GridColCnt = Enum.GetNames(typeof(GridColumn)).Length;
479
                bool bCompSw = false;
480
                foreach (object[] ObjRec in DataArList)
481
                {
482
                    // ?Y???H????O??????????
483
                    int nCode = CommonMotions.cnvInt(ObjRec[(int)GetDataEnum.ConstrCode]);
484
                    if (nCode != CurData)
410 485
                    {
411
                        object[] objRec = (object[])TargetData[i];
412
                        switch (i)
413
                        {
414
                            case 0:
415
                                ExpensesVal[0] = CommonMotions.cnvLong(objRec[(int)DetilData.ExecutionAmount]);
416
                                break;
417
                            case 1:
418
                                ExpensesVal[2] = CommonMotions.cnvLong(objRec[(int)DetilData.ExecutionAmount]);
419
                                break;
420
                            case 2:
421
                                ExpensesVal[1] = CommonMotions.cnvLong(objRec[(int)DetilData.ExecutionAmount]);
422
                                break;
423
                        }
424
                        if (i != 0) nDataCount++;
486
                        if (bCompSw) break;
487
                        continue;
425 488
                    }
489

  
490
                    // ?f?[?^???Z?b?g????
491
                    DspData[(int)GridColumn.DepartmentName] = ObjRec[(int)GetDataEnum.DepName];         // 1:??????
492
                    DspData[(int)GridColumn.PersonName] = ObjRec[(int)GetDataEnum.ManName];             // 2:?S?????
493
                    DspData[(int)GridColumn.ConstrCode] = ObjRec[(int)GetDataEnum.ConstrCode];          // 3:?H?????
494
                    DspData[(int)GridColumn.ConstrName] = ObjRec[(int)GetDataEnum.ConstrName];          // 4:?H??????                 
495
                    DspData[(int)GridColumn.OrderDate] = 
496
                        CommonMotions.cnvDate(ObjRec[(int)GetDataEnum.OrderDate]).ToShortDateString();  // 5:???
497
                    int nStat = CommonMotions.cnvInt(ObjRec[(int)GetDataEnum.Stat]);                    // 6:?{?H???
498
                    DspData[(int)GridColumn.ConstrStatus] = CommonDefine.ProjectsStatus[nStat];
499

  
500
                    DspData[(int)GridColumn.OrdersPrice] = ObjRec[(int)GetDataEnum.OrValue];            // 7:????z
501
                    ExpensesVal[0] = CommonMotions.cnvInt(ObjRec[(int)GetDataEnum.OrValue]);
502

  
503
                    int nExpIndex = ExpArraryIndex(ObjRec, ExpList);
504
                    DspData[GridColCnt + nExpIndex] = ObjRec[(int)GetDataEnum.ExpVal];                  // 8??~:?o??S??
505
                    ExpensesVal[nExpIndex + 1] = CommonMotions.cnvInt(ObjRec[(int)GetDataEnum.ExpVal]);
506

  
507
                    bCompSw = true;
426 508
                }
427 509
            }
428 510
            catch (System.Exception ex)
......
432 514
        }
433 515
        #endregion
434 516

  
517
        #region ?o???\????u????????
518
        /// <summary>
519
        /// ?o???\????u????????
520
        /// </summary>
521
        /// <param name="ObjRec"></param>
522
        /// <param name="ExpList"></param>
523
        /// <returns></returns>
524
        private int ExpArraryIndex(object[] ObjRec, List<KeyValuePair<int, string>> ExpList)
525
        {
526
            try
527
            {
528
                int nIndex = 0;
529

  
530
                // ?o??R?[?h??
531
                int nExpNo = CommonMotions.cnvInt(ObjRec[(int)GetDataEnum.ExpCode]);
532

  
533
                for (int i = 0; i < ExpList.Count; i++)
534
                {
535
                    if (ExpList[i].Key == nExpNo)
536
                    {
537
                        nIndex = i;
538
                        break;
539
                    }
540
                }
541

  
542
                return nIndex;
543
            }
544
            catch (System.Exception ex)
545
            {
546
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
547
                return 0;
548
            }
549
        }
550
        #endregion
551

  
435 552
        #region ???f?[?^?\??
436 553
        /// <summary>
437 554
        /// ???f?[?^?\??????
438 555
        /// </summary>
439
        private void SetCreateRowData()
556
        private void SetCreateRowData(List<KeyValuePair<int, string>> ExpList, ref long[] TotalArea)
440 557
        {
441 558
            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
442 559
            DataGridView dgv = dgvMain;
......
450 567

  
451 568
                int iCode1 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?? ?? ??")).Key;
452 569

  
453
                string strSQL = "SELECT A.COMPLATEFLG, SUM(A.ORDERSDECISIONPRICE), SUM(A.COMPANYEXPENSES), SUM(A.DEPARTMENTEXPENSES), SUM(A.SALESEXPENSES)";
454
                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER C";
455
                strSQL += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
456
                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", SelectPeriod);
457
                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", iCode1);
458
                strSQL += " AND C.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
459
                if (DepartmantCode != 0) strSQL += string.Format(" AND C.DEPARTMENTCODE = {0}", DepartmantCode);
460
                if (PersonCode != 0) strSQL += string.Format(" AND C.PERSONCODE = {0}", PersonCode);
461
                strSQL += " GROUP BY A.COMPLATEFLG";
462
                strSQL += " ORDER BY 1";
570
                StringBuilder strSQL = new StringBuilder();
571
                strSQL.Append("SELECT");
572
                strSQL.Append(" A.COMPLATEFLG");
573
                strSQL.Append(", SUM(A.ORDERSDECISIONPRICE)");
574
                strSQL.Append(", SUM(A.COMPANYEXPENSES)");
575
                strSQL.Append(", SUM(A.DEPARTMENTEXPENSES)");
576
                strSQL.Append(", SUM(A.SALESEXPENSES)");
577
                strSQL.Append(" FROM");
578
                strSQL.Append(" CONSTRUCTIONLEDGER A");
579
                strSQL.Append(", CONSTRUCTIONBASEINFO B");
580
                strSQL.Append(", PERSONINCHARGEMASTER C");
581
                strSQL.Append(" WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE"); ;
582
                strSQL.AppendFormat(" AND B.CONSTRUCTIONPERIOD = {0}", SelectPeriod);
583
                strSQL.AppendFormat(" AND B.CONSTRUCTIONSTATUSFLG != {0}", iCode1);
584
                strSQL.Append(" AND C.PERSONCODE = B.CONSTRUCTIONPERSONCODE");
585
                if (DepartmantCode != 0) strSQL.AppendFormat(" AND C.DEPARTMENTCODE = {0}", DepartmantCode);
586
                if (PersonCode != 0) strSQL.AppendFormat(" AND C.PERSONCODE = {0}", PersonCode);
587
                strSQL.Append(" GROUP BY A.COMPLATEFLG");
588
                strSQL.Append(" ORDER BY 1");
463 589

  
464 590
                ArrayList DatArList = new ArrayList();
465
                if (!BaseDB.ExecuteReader(strSQL, ref DatArList)) return;
591
                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref DatArList)) return;
466 592
                if (DatArList.Count == 0) return;
467 593

  
468 594
                // ???v?G???A??????
469
                int TotalColCnt = Enum.GetNames(typeof(GridColumn)).Length;
595
                int TotalColCnt = ExpList.Count + 1;
470 596
                long[] CurTotalArea = new long[TotalColCnt];
471
                Array.Clear(CurTotalArea, 0, CurTotalArea.Length);
472 597

  
473 598
                int CompFlg = -1;
474 599
                int BreakKey = -1;
......
486 611
                    int ExpensesPrice2 = CommonMotions.cnvInt(objGetArry[3]);           // ?????o??
487 612
                    int ExpensesPrice3 = CommonMotions.cnvInt(objGetArry[4]);           // ?c??o??
488 613

  
489
                    CurTotalArea[(int)GridColumn.OrdersPrice] += OrdersDecisionPrice;   // ????z
490
                    CurTotalArea[(int)GridColumn.CompanyExpeses] += ExpensesPrice1;     // ???o??
491
                    CurTotalArea[(int)GridColumn.DepartmentExpeses] += ExpensesPrice2;  // ?????o??
492
                    CurTotalArea[(int)GridColumn.SaleseExpeses] += ExpensesPrice3;      // ?c??o??
614
                    CurTotalArea[0] += OrdersDecisionPrice;   // ????z
615
                    CurTotalArea[1] += ExpensesPrice1;     // ???o??
616
                    CurTotalArea[2] += ExpensesPrice2;  // ?????o??
617
                    CurTotalArea[3] += ExpensesPrice3;      // ?c??o??
493 618

  
494
                    m_TotalArea[(int)GridColumn.OrdersPrice] += CurTotalArea[(int)GridColumn.OrdersPrice];
495
                    m_TotalArea[(int)GridColumn.CompanyExpeses] += CurTotalArea[(int)GridColumn.CompanyExpeses];
496
                    m_TotalArea[(int)GridColumn.DepartmentExpeses] += CurTotalArea[(int)GridColumn.DepartmentExpeses];
497
                    m_TotalArea[(int)GridColumn.SaleseExpeses] += CurTotalArea[(int)GridColumn.SaleseExpeses];
619
                    // ???v???Z
620
                    for (int i = 0; i < TotalArea.Length; i++)
621
                    {
622
                        TotalArea[i] += CurTotalArea[i];
623
                    }
498 624

  
499 625
                    // ???v?s?\??
500 626
                    DisplayTotalRow((CompFlg + 1), CurTotalArea);
......
539 665
                if (AddBrankRow) dgv.Rows.Add(1);
540 666
                // ???v?s?\??
541 667
                int TotalRow = dgv.Rows.Add(1);
668
                dgv.Rows[TotalRow].Cells[(int)GridColumn.ConstrCode].Value = s_TotalCode;
542 669
                dgv.Rows[TotalRow].Cells[(int)GridColumn.ConstrName].Value = s_TotalTitleArray[TitleNo];
543 670
                dgv.Rows[TotalRow].Cells[(int)GridColumn.ConstrName].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
544 671
                // ?s??F??????
545 672
                SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
546 673

  
547 674
                // ???l?\??
548
                for (int i = (int)GridColumn.OrdersPrice; i <= (int)GridColumn.SaleseExpeses; i++)
675
                int GridColCnt = dgv.ColumnCount;
676
                int nDataCnt = 0;
677
                for (int i = (int)GridColumn.OrdersPrice; i < GridColCnt; i++, nDataCnt++)
549 678
                {
550
                    dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
679
                    dgv.Rows[TotalRow].Cells[i].Value = TotalArea[nDataCnt].ToString("#,0");
551 680
                }
552 681
            }
553 682
            catch (System.Exception ex)
......
578 707
                SetRowColor(dgv.Rows[EditRowCnt], s_RowTotalBackColor, s_RowTotalForeColor);
579 708

  
580 709
                // ???l?\??
581
                for (int i = (int)GridColumn.OrdersPrice; i <= (int)GridColumn.SaleseExpeses; i++)
710
                int GridColCnt = dgv.ColumnCount;
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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