Beispiel #1
0
        private void FormTaskNameList_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            // 罫線設定
            dataGridView1.AdvancedCellBorderStyle.Right = DataGridViewAdvancedCellBorderStyle.Single;
            // 列幅設定、入力不可設定
            dataGridView1.Columns[0].ReadOnly = true;
            dataGridView1.Columns[0].Width    = 600;

            // データをdataGridViewにセット
            if (tcd == null)
            {
                return;
            }
            int wkcnt = tcd.Length;

            if (tcd.Length > 1)
            {
                dataGridView1.Rows.Add(tcd.Length);
            }

            for (int i = 0; i < tcd.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = tcd[i].TaskName;
            }
        }
Beispiel #2
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormRegular_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridViewL);

            uih.DgvReadyNoRHeader();
            uih.NoSortable();

            uih = new UiHandling(dataGridViewR);
            uih.DgvReadyNoRHeader();
            uih.NoSortable();

            uih = new UiHandling(dataGridViewT);
            uih.DgvReadyNoRHeader();
            uih.NoSortable();

            labelPublisher.Text = ted.OfficeName + ted.DepartName; // 部署名

            create_cbOffice();                                     // 事業所comboBox
            comboBoxOffice.Text = ted.OfficeName;
            create_cbWork();                                       // 部門ComboBox
            comboBoxWork.Text = ted.DepartName;

            ListFormDataOp lo = new ListFormDataOp();

            psd = lo.SelectPartnersScData();

            create_dtPicker();

            edit_Labels();

            initialViewSetting(0);

            nowMonth();
        }
Beispiel #3
0
        private void FormTaskCodeNameList_Load(object sender, EventArgs e)
        {
            // DataGridView 設定
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // データをdataGridViewにセット
            if (tcd == null)
            {
                MessageBox.Show("Dataがありません。");
                return;
            }

            //if (tcd.GetLength(0) > 1) dataGridView1.Rows.Add(tcd.GetLength(0) - 1);
            if (tcd.Length > 1)
            {
                dataGridView1.Rows.Add(tcd.Length - 1);
            }

            //for (int i = 0; i < tcd.GetLength(0); i++)
            for (int i = 0; i < tcd.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = tcd[i].TaskCode;
                dataGridView1.Rows[i].Cells[1].Value = tcd[i].TaskName;
                dataGridView1.Rows[i].Cells[2].Value = Convert.ToString(tcd[i].TaskID);
                dataGridView1.Rows[i].Cells[3].Value = Convert.ToString(tcd[i].TaskIndID);
            }
        }
Beispiel #4
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormInvoice_Load(object sender, EventArgs e)
        {
            this.defaultCellStyle = new DataGridViewCellStyle();
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.NoSortable();

            DateTime dtNow = DateTime.Now;

            iniRCnt = Convert.ToInt32((dtNow.EndOfMonth()).Day) - 1;
            dataGridView1.Rows.Add(iniRCnt);

            edit_Labels();
            edit_TextBox();
            create_dtPicker();

            // 作業項目マスタの一覧作成
            EstPlanOp ep = new EstPlanOp();

            wid = ep.StoreWorkItemsData(ted.MemberCode);

            initialProcessing(0);

            nowMonth();
        }
Beispiel #5
0
        private void FormCostList_Load(object sender, EventArgs e)
        {
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // 列幅設定、入力不可設定
            for (int i = 0; i < dataGridView1.ColumnCount; i++)
            {
                dataGridView1.Columns[i].ReadOnly = true;
            }
            //if (cmd.GetLength(0) > 1) dataGridView1.Rows.Add(cmd.GetLength(0) - 1);
            if (cmd.Length > 1)
            {
                dataGridView1.Rows.Add(cmd.Length - 1);
            }
            //for (int i = 0; i < cmd.GetLength(0); i++)
            for (int i = 0; i < cmd.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = cmd[i].CostCode;
                dataGridView1.Rows[i].Cells[1].Value = cmd[i].Item.Replace("(支払い)", "");
                dataGridView1.Rows[i].Cells[2].Value = cmd[i].ItemDetail;
                dataGridView1.Rows[i].Cells[3].Value = cmd[i].Unit;
                dataGridView1.Rows[i].Cells[4].Value = (cmd[i].Cost == 0) ? "": DHandling.DecimaltoStr(cmd[i].Cost, "0.00");
                dataGridView1.Rows[i].Cells[5].Value = cmd[i].CostID;
            }
        }
Beispiel #6
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormOsWkReportSetup_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.NoSortable();
            uih = new UiHandling(dataGridView2);
            uih.DgvReadyNoRHeader();
            uih.NoSortable();

            // 現在の締日一覧
            //this.clsArray = new DateTime[] { hp.CloseHDate, hp.CloseKDate, hp.CloseSDate, hp.CloseTDate };

            create_cbOffice();
            comboBoxOffice.SelectedIndex = Conv.oList.IndexOf(hp.OfficeCode); // 初期値
            create_cbDepart();
            comboBoxDepart.Text = hp.Department;                              // 初期値
            labelMessage.Text   = "";
            labelItemCode.Text  = "";

            // 事業所コードに応じた業務情報取得表示
            //dispTaskCodeNameList(hp.OfficeCode);
            //dispTaskCodeNameList(hp.OfficeCode,hp.Department);
            // 事業所コードに応じた原価情報取得表示
            //dispCostList(hp.OfficeCode);
        }
Beispiel #7
0
        //--------------------------------------------------------------------------//
        //     Property                                                             //
        //--------------------------------------------------------------------------//

        //--------------------------------------------------------------------------//
        //     Method                                                               //
        //--------------------------------------------------------------------------//
        private void FormTaskSummary_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.DgvNotSortable(dataGridView1);

            initializeScreen();
            Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepartment);
        }
Beispiel #8
0
        //-----------------------------------------------//
        //      Property
        //-----------------------------------------------//

        //-----------------------------------------------//
        //      Method
        //-----------------------------------------------//
        private void FormContractCostSummary_Load(object sender, EventArgs e)
        {
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();
            ui.DgvColumnsAlignmentRight(3, 29);
            create_cbFY();
            create_cbOffice();
            Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepart);

            getInformationAboutTask();
        }
Beispiel #9
0
        //--------------------------------------------------------------------------//
        //     Property                                                             //
        //--------------------------------------------------------------------------//

        //--------------------------------------------------------------------------//
        //     Method                                                               //
        //--------------------------------------------------------------------------//
        private void FormInputCostData_Load(object sender, EventArgs e)
        {
            this.defaultCellStyle = new DataGridViewCellStyle();
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.DgvNotSortable(dataGridView1);

            viewModeProperty();
            //reverseProperty();
            initializeScreen();
            initialDisplay();
            calculateAmount();
        }
Beispiel #10
0
        //---------------------------------------------------------------------
        //      Property
        //---------------------------------------------------------------------
        //---------------------------------------------------------------------
        //      Method
        //---------------------------------------------------------------------
        /// <summary>
        /// フォームロード時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormVolumeBook_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(this.dataGridViewList);

            uih.DgvReadyNoRHeader();
            // 並び替えができないようにする
            //uih.NoSortable();
            // 部署コンボボックス設定
            CreateCbOffice();
            // 部門コンボボックス設定
            CreateCbDepartment();
            // 締め月コンボボックス設定
            CreateCbMonth("Dummy");
            // データグリッドビュー初期表示
            CreateDataGridView();
        }
Beispiel #11
0
        //---------------------------------------------------------------------
        //      Property
        //---------------------------------------------------------------------
        //---------------------------------------------------------------------
        //      Method
        //---------------------------------------------------------------------
        /// <summary>
        /// フォームロード時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormMCostMentL_Load(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;   // マウスカーソルを砂時計(Wait)

            UiHandling uih = new UiHandling(this.dataGridViewList);

            uih.DgvReadyNoRHeader();
            // 並び替えができないようにする
            uih.NoSortable();

            // 部署コンボボックス設定
            CreateCbOffice();

            // 原価マスタ表示
            CreateDataGridView();
            CostKeyControl(0);

            Cursor.Current = Cursors.Default;  // マウスカーソルを戻す
        }
Beispiel #12
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormTaskNoConfList_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();

            create_cbOffice();
            create_cbDepart();
            labelMsg.Text = "";

            if (dataCollection())
            {
                editAndView(dataGridView1, Convert.ToString(comboBoxOffice.SelectedValue), Convert.ToString(comboBoxDepart.SelectedValue));
            }
            else
            {
                MessageBox.Show("表示できるデータはありません");
                return;
            }
        }
Beispiel #13
0
        //--------------------------------------------------------------------------//
        //     SubRoutine                                                           //
        //--------------------------------------------------------------------------//
        private void initializeScreen()
        {
            labelMessage.Text = "";

            dataGridView1.Rows.Clear();
            dataGridView1.Rows.Add(iniRCnt);
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.DgvNotSortable(dataGridView1);
            uih.DgvColumnsWrapModeON();

            create_cbOffice();
            comboBoxOffice.Text = hp.OfficeName;
            create_cbDepart();
            comboBoxDepart.Text = hp.DepartName;        // 初期値

            create_cbMonth();

            init_dateTimePicker();
        }
Beispiel #14
0
        private void FormItemList_Load(object sender, EventArgs e)
        {
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // 列幅設定、入力不可設定
            for (int i = 0; i < dataGridView1.ColumnCount; i++)
            {
                dataGridView1.Columns[i].ReadOnly = true;
            }

            dataGridView1.Columns[0].Width = 40;
            dataGridView1.Columns[1].Width = 200;
            dataGridView1.Columns[2].Width = 200;
            dataGridView1.Columns[3].Width = 150;
            dataGridView1.Columns[4].Width = 80;
            dataGridView1.Columns[5].Width = 80;

            //dataGridView1.Rows.Add(wid.GetLength(0));
            dataGridView1.Rows.Add(wid.Length);
            //for (int i = 0; i < wid.GetLength(0); i++)
            for (int i = 0; i < wid.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = wid[i].ItemCode;
                dataGridView1.Rows[i].Cells[1].Value = wid[i].UItem;
                dataGridView1.Rows[i].Cells[2].Value = wid[i].Item;
                dataGridView1.Rows[i].Cells[3].Value = wid[i].ItemDetail;
                dataGridView1.Rows[i].Cells[4].Value = wid[i].Unit;
                if (wid[i].StdCost == 0)
                {
                    dataGridView1.Rows[i].Cells[5].Value = null;
                }
                else
                {
                    dataGridView1.Rows[i].Cells[5].Value = wid[i].StdCost;
                }
            }
        }
Beispiel #15
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormOutsource_Load(object sender, EventArgs e)
        {
            this.defaultCellStyle = new DataGridViewCellStyle();

            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.NoSortable();
            dataGridView1.Rows.Add(iniRCnt);
            buttonNumbering(dataGridView1);

            create_cbOffice();                  // 事業所comboBox
            create_cbWork();                    // 部門ComboBox
            create_cbPartner();                 // 業者名comboBox
            labelTask.Text = ted.TaskName;      // 業務名Label
            create_lblTerm();                   // 工期
            labelTaskCode.Text = ted.TaskCode;  // 業務番号
            create_cbPayRoule();                // 支払基準comboBox
            edit_tbDeliveryPoint();             // 納品場所初期値

            initialSetbuttonFromPlan();
            initialViewSetting(0);
        }
Beispiel #16
0
        private void FormMembersList_Load(object sender, EventArgs e)
        {
            // DataGridView 設定
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // Wakamatsu
            //if(msd.GetLength(0) > 1)
            if (msd.Length > 1)
            {
                // データをdataGridViewにセット
                //dataGridView1.Rows.Add(msd.GetLength(0) - 1);
                dataGridView1.Rows.Add(msd.Length - 1);
            }
            // Wakamatsu
            //for(int i = 0;i < msd.GetLength(0);i++)
            for (int i = 0; i < msd.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = msd[i].MemberCode;
                dataGridView1.Rows[i].Cells[1].Value = msd[i].Name;
            }
        }
Beispiel #17
0
        private void FormCostListSimple_Load(object sender, EventArgs e)
        {
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // 列幅設定、入力不可設定
            for (int i = 0; i < dataGridView1.ColumnCount; i++)
            {
                dataGridView1.Columns[i].ReadOnly = true;
            }
            //if (cmd.GetLength(0) > 1) dataGridView1.Rows.Add(cmd.GetLength(0) - 1);
            if (cmd.Length > 1)
            {
                dataGridView1.Rows.Add(cmd.Length - 1);
            }
            //for (int i = 0; i < cmd.GetLength(0); i++)
            for (int i = 0; i < cmd.Length; i++)
            {
                dataGridView1.Rows[i].Cells[0].Value = cmd[i].CostCode;
                dataGridView1.Rows[i].Cells[1].Value = cmd[i].Item.Replace("(支払い)", "");
            }
        }
Beispiel #18
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormContract_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            uih.NoSortable();
            dataGridView1.Rows.Add(iniRCnt);

            create_cbOffice();                      // 事業所comboBox
            comboBoxOffice.Text = ted.OfficeName;
            create_cbWork();                        // 部門ComboBox
            comboBoxWork.Text = ted.DepartName;

            create_dtPicker();

            edit_Labels();

            initialViewSetting(0);

            nowMonth();

            // 指定月の実績値を外注作業実績データ(D_OsWkReport)から実績値を得る
        }
Beispiel #19
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormReview_Load(object sender, EventArgs e)
        {
            UiHandling uih = new UiHandling(dataGridView1);

            uih.DgvReadyNoRHeader();
            //並び替えができないようにする
            uih.NoSortable();

            uih.DgvColumnsWidth(85);
            uih.DgvColumnsWidth(0, 90);

            dataGridView1.Rows.Add(iniRCnt);
            uih.DgvRowsHeight(26);
            uih.DgvRowsReadOnly(readOnlyRows, Color.PaleGreen);
            uih.DgvRowsReadOnly(readOnlyRowsW, Color.White);
            uih.DgvColumnsReadOnly(readOnlyCells, Color.PaleGreen);

            create_cbOffice();
            create_cbDepart();
            create_cbYM();
            setColumnLimitter();

            setViewData(dataGridView1);
        }
Beispiel #20
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormOsPayment_Load(object sender, EventArgs e)
        {
            create_cbOffice();
            comboBoxOffice.Text = hp.OfficeCode;                                                                 // 初期値
            create_cbDepart();
            comboBoxDepart.Text = hp.Department;                                                                 // 初期値
            this.clsArray       = new DateTime[] { hp.CloseHDate, hp.CloseKDate, hp.CloseSDate, hp.CloseTDate }; // 現在の締日リスト

            dataGridView1.Rows.Add(iniRCnt);
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            readyDateTimePicker();
            dateTimePickerEx1.Value = clsArray[Conv.oList.IndexOf(hp.OfficeCode)].AddMonths(1);         // 初期表示開始月(締月の翌月)
            preReportDate           = dateTimePickerEx1.Value.EndOfMonth();

            labelACheckDate.Text = "";
            labelDCheckDate.Text = "";
            labelPCheckDate.Text = "";
            labelMsg.Text        = "";

            readyCheckBox();
            buttonEnabled();
            buttonCost.Enabled = false;

            // 取引先マスタより外注先一覧作成
            Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepart);
            ListFormDataOp lo = new ListFormDataOp();

            psd = lo.SelectPartnersScData();
            tcd = lo.SelectTaskCodeNameData(Conv.OfficeCode);
            cmd = lo.SelectCostDataInitialF(Conv.OfficeCode);

            selectPaymentData(dataGridView1, dateTimePickerEx1.Value.EndOfMonth(), Conv.OfficeCode, Conv.DepartCode);
        }
Beispiel #21
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormTaskList_Load(object sender, EventArgs e)
        {
            create_cbOffice();
            comboBoxOffice.Text = hp.OfficeName;        // 初期値
            create_cbDepart();

            dataGridView1.Rows.Add(iniRCnt);
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // 20190318 asakawa edit
            // if( hp.OfficeCode == "H" && hp.Department == "0" ) hp.Department = "2";
            // displayTaskData( dataGridView1, hp.OfficeCode, hp.Department );
            if (hp.OfficeCode == "H" && hp.Department == "0")
            {
                displayTaskData(dataGridView1, hp.OfficeCode, "1");
            }
            else
            {
                displayTaskData(dataGridView1, hp.OfficeCode, hp.Department);
            }
            // 20190318 end
        }
Beispiel #22
0
        private void FormSubComList_Load(object sender, EventArgs e)
        {
            // DataGridView 設定
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            // データをdataGridViewにセット
            //dataGridView1.Rows.Add(psd.GetLength(0)-1);
            dataGridView1.Rows.Add(psd.Length - 1);
            //for (int i = 0; i < psd.GetLength(0); i++)
            for (int i = 0; i < psd.Length; i++)
            {
                //dataGridView1.Rows[i].Cells[0].Value = psd[i].PartnerCode;
                dataGridView1.Rows[i].Cells[0].Value = psd[i].AccountCode;
                dataGridView1.Rows[i].Cells[1].Value = psd[i].PartnerName;
                dataGridView1.Rows[i].Cells[2].Value = psd[i].PostCode;
                dataGridView1.Rows[i].Cells[3].Value = psd[i].Address;
                dataGridView1.Rows[i].Cells[4].Value = psd[i].TelNo;
                dataGridView1.Rows[i].Cells[5].Value = psd[i].FaxNo;
                dataGridView1.Rows[i].Cells[6].Value = psd[i].PartnerCode;
                dataGridView1.Rows[i].Cells[7].Value = Convert.ToString(psd[i].PartnerID);
            }
        }
Beispiel #23
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//


        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormVolumeCostDetailList_Load(object sender, EventArgs e)
        {
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvReadyNoRHeader();

            dataGridView1.SelectionMode         = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.AllowUserToDeleteRows = false;

            // 列幅設定、入力不可設定
            for (int i = 0; i < dataGridView1.ColumnCount; i++)
            {
                dataGridView1.Columns[i].ReadOnly = true;
            }
            if (crd.GetLength(0) > 1)
            {
                dataGridView1.Rows.Add(crd.GetLength(0) - 1);
            }

            //年月日
            DateTime dtReportDateBefore  = DateTime.MinValue;
            string   strReportDateBefore = dtReportDateBefore.ToString("yyyy/MM/dd");

            //伝票番号
            string strSlipNoBefore = "";

            //累計(小計)
            decimal decCumulative = 0;
            //累計(合計)
            decimal decTotalCumulative = 0;
            int     intGridCnt         = 0;

            for (int i = 0; i < crd.GetLength(0); i++)
            {
                if (intGridCnt != 0)
                {
                    if (strSlipNoBefore != crd[i].SlipNo.ToString())
                    {
                        dataGridView1.Rows.Add();
                        dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value = "";                                                //年月日
                        dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value     = "";                                                //伝票No
                        dataGridView1.Rows[intGridCnt].Cells["CostCode"].Value   = "";                                                //原価コード
                        dataGridView1.Rows[intGridCnt].Cells["Item"].Value       = "";                                                //品名
                        dataGridView1.Rows[intGridCnt].Cells["Unit"].Value       = "";                                                //単位
                        dataGridView1.Rows[intGridCnt].Cells["UnitPrice"].Value  = "";                                                //単価
                        dataGridView1.Rows[intGridCnt].Cells["Quantity"].Value   = "伝票計";                                             //数量
                        dataGridView1.Rows[intGridCnt].Cells["Cost"].Value       = DHandling.DecimaltoStr(decCumulative, "#,0");      //金額(小計)
                        decTotalCumulative = decTotalCumulative + decCumulative;
                        dataGridView1.Rows[intGridCnt].Cells["Cumulative"].Value = DHandling.DecimaltoStr(decTotalCumulative, "#,0"); //累計
                        decCumulative = 0;
                        intGridCnt++;
                    }
                }

                if (i == crd.GetLength(0) - 1)//最後の場合、伝票計、合計の行を追加しておく
                {
                    dataGridView1.Rows.Add();
                    dataGridView1.Rows.Add();
                }
                dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value = "";
                if (crd[i].ReportDate != null)
                {
                    if (strReportDateBefore != crd[i].ReportDate.ToString("yyyy/MM/dd"))
                    {
                        dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value = crd[i].ReportDate.ToString("yyyy/MM/dd");             //年月日
                        strReportDateBefore = dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value.ToString();
                    }
                }

                dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value = "";
                if (crd[i].SlipNo.ToString() != null && crd[i].SlipNo.ToString() != "")
                {
                    if (strSlipNoBefore != crd[i].SlipNo.ToString())
                    {
                        dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value = crd[i].SlipNo.ToString();
                        strSlipNoBefore = dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value.ToString();
                    }
                }

                dataGridView1.Rows[intGridCnt].Cells["CostCode"].Value  = crd[i].ItemCode;                                                                 //原価コード
                dataGridView1.Rows[intGridCnt].Cells["Item"].Value      = crd[i].Item;                                                                     //品名
                dataGridView1.Rows[intGridCnt].Cells["Unit"].Value      = crd[i].Unit;                                                                     //単位
                dataGridView1.Rows[intGridCnt].Cells["UnitPrice"].Value = (crd[i].UnitPrice == 0) ? "" : DHandling.DecimaltoStr(crd[i].UnitPrice, "#,0");  //単価
                dataGridView1.Rows[intGridCnt].Cells["Quantity"].Value  = (crd[i].Quantity == 0) ? "" : DHandling.DecimaltoStr(crd[i].Quantity, "#,0.00"); //数量
                dataGridView1.Rows[intGridCnt].Cells["Cost"].Value      = (crd[i].Cost == 0) ? "0" : DHandling.DecimaltoStr(crd[i].Cost, "#,0");           //金額
                decCumulative = decCumulative + crd[i].Cost;
                dataGridView1.Rows[intGridCnt].Cells["Cumulative"].Value = "N";
                intGridCnt++;
            }

            if (crd.GetLength(0) > 0)
            {
                dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value = "";                                                //年月日
                dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value     = "";                                                //伝票No
                dataGridView1.Rows[intGridCnt].Cells["CostCode"].Value   = "";                                                //原価コード
                dataGridView1.Rows[intGridCnt].Cells["Item"].Value       = "";                                                //品名
                dataGridView1.Rows[intGridCnt].Cells["Unit"].Value       = "";                                                //単位
                dataGridView1.Rows[intGridCnt].Cells["UnitPrice"].Value  = "";                                                //単価
                dataGridView1.Rows[intGridCnt].Cells["Quantity"].Value   = "伝票計";                                             //数量
                dataGridView1.Rows[intGridCnt].Cells["Cost"].Value       = DHandling.DecimaltoStr(decCumulative, "#,0");      //金額(小計)
                decTotalCumulative = decTotalCumulative + decCumulative;
                dataGridView1.Rows[intGridCnt].Cells["Cumulative"].Value = DHandling.DecimaltoStr(decTotalCumulative, "#,0"); //累計
                decCumulative = 0;
                intGridCnt++;
                dataGridView1.Rows[intGridCnt].Cells["ReportDate"].Value = "";                                                //年月日
                dataGridView1.Rows[intGridCnt].Cells["SlipNo"].Value     = "";                                                //伝票No
                dataGridView1.Rows[intGridCnt].Cells["CostCode"].Value   = "";                                                //原価コード
                dataGridView1.Rows[intGridCnt].Cells["Item"].Value       = "【合計】";                                            //品名
                dataGridView1.Rows[intGridCnt].Cells["Unit"].Value       = "";                                                //単位
                dataGridView1.Rows[intGridCnt].Cells["UnitPrice"].Value  = "";                                                //単価
                dataGridView1.Rows[intGridCnt].Cells["Quantity"].Value   = "";                                                //数量
                dataGridView1.Rows[intGridCnt].Cells["Cost"].Value       = DHandling.DecimaltoStr(decTotalCumulative, "#,0"); //金額(小計)
                dataGridView1.Rows[intGridCnt].Cells["Cumulative"].Value = DHandling.DecimaltoStr(decTotalCumulative, "#,0"); //累計
            }
        }
Beispiel #24
0
        //---------------------------------------------------------------------
        //      Property
        //---------------------------------------------------------------------
        //---------------------------------------------------------------------
        //      Method
        //---------------------------------------------------------------------
        /// <summary>
        /// フォームロード時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormImpAuthority_Load(object sender, EventArgs e)
        {
            // M_Membersから現職のメンバーを取得する
            MembersScData msd = new MembersScData();
            DataTable     dt  = msd.SelectMembersData();

            if (dt == null)
            {
                return;
            }
            fintMember = dt.Rows.Count;

            MembersScData[] msda = new MembersScData[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                msda[i] = new MembersScData(dt.Rows[i]);
                // データグリッドビューに社員名列を追加
                this.dgvSetting.Columns.Add("Member" + msda[i].MemberCode, msda[i].Name + $"\n({msda[i].MemberCode})");
                this.dgvSetting.Columns[i + 3].ReadOnly = true;
                this.dgvSetting.Columns[i + 3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }

            // M_Authorizationからプログラムを取得
            AuthorizationData ad = new AuthorizationData();

            dt = ad.SelectAuthMaster();
            if (dt == null)
            {
                // 行の追加
                this.dgvSetting.Rows.Add(1);
            }
            else
            {
                // 行の追加
                this.dgvSetting.Rows.Add(dt.Rows.Count);
            }

            UiHandling uih = new UiHandling(this.dgvSetting);

            // ヘッダ背景色設定
            uih.DgvReadyNoRHeader();

            // M_Authorizationのレコードを表示
            string[] strMemberCode;             // 社員番号格納用
            if (dt != null)
            {
                Array.Resize(ref fintCheckNum, Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["AuthID"]) + 1);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    // ID
                    this.dgvSetting.Rows[i].Cells[0].Value = Convert.ToString(dt.Rows[i]["AuthID"]);
                    // 使用済みID設定
                    fintCheckNum[Convert.ToInt32(dt.Rows[i]["AuthID"])] = 1;
                    // ラベル
                    this.dgvSetting.Rows[i].Cells[1].Value = Convert.ToString(dt.Rows[i]["ModuleLabel"]);
                    // プログラム
                    this.dgvSetting.Rows[i].Cells[2].Value = Convert.ToString(dt.Rows[i]["ModuleName"]);
                    // 各社員番号設定
                    strMemberCode = Convert.ToString(dt.Rows[i]["AuthMember"]).Split(',');

                    for (int j = 0; j < strMemberCode.Length; j++)
                    {
                        // 登録済み社員番号分繰り返す
                        for (int k = 3; k < fintMember + 3; k++)
                        {
                            // 全社員番号分繰り返す
                            if (this.dgvSetting.Columns[k].Name == "Member" + strMemberCode[j])
                            {
                                this.dgvSetting.Rows[i].Cells[k].Value = "YES";
                            }
                            else if (Convert.ToString(this.dgvSetting.Rows[i].Cells[k].Value) != "YES")
                            {
                                this.dgvSetting.Rows[i].Cells[k].Value = "NO";
                            }
                        }
                    }
                }
            }
            else
            {
                for (int i = 3; i < fintMember + 3; i++)
                {
                    // 社員番号の全設定をNOとする
                    this.dgvSetting.Rows[0].Cells[i].Value = "NO";
                }
            }
        }