Exemplo n.º 1
0
        //----------------------------------------------------------------------------//
        //     Property                                                               //
        //----------------------------------------------------------------------------//

        //----------------------------------------------------------------------------//
        //     Method                                                                 //
        //----------------------------------------------------------------------------//
        private void FormMenuEstPlan_Load(object sender, EventArgs e)
        {
            create_cbOffice();              // ComboBox 「事業所」作成
            create_cbDepart();              // ComboBox 「部門」作成
            create_cbCostType();            // ComboBox 「原価目標」作成
            clearLabel();

            // 各ボタンに現在の最新版数表示
            //setButtonLabel(Convert.ToString(comboBoxTaskName.SelectedValue), publisher);

            //ted = new TaskEntryData();
            //ted.OfficeCode = hp.OfficeCode;
            //ted.Department = hp.Department;
            //ted.OfficeName = hp.OfficeName;
            //ted.DepartName = hp.DepartName;
            //ted.MemberCode = hp.MemberCode;
            //ted.TaxRate = hp.TaxRate;
            //ted.AdminCostRate = hp.AdminCostRate;
            //ted.OthersCostRate = hp.OthersCostRate;
            //ted.Expenses = hp.Expenses;
            Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepartment);
            ListFormDataOp lo = new ListFormDataOp();

            //etcd = lo.SelectTaskEntryNameData( hp.OfficeCode, Convert.ToString( comboBoxDepartment.SelectedValue ), null );
            etcd = lo.SelectTaskEntryNameData(Conv.OfficeCode, Conv.DepartCode, null);
            //tcd = lo.SelectTaskCodeNameData( hp.OfficeCode, Convert.ToString( comboBoxDepartment.SelectedValue ), null );
            tcd = lo.SelectTaskCodeNameData(Conv.OfficeCode, Conv.DepartCode, null);
        }
Exemplo n.º 2
0
        private void comboBox_TextChanged(object sender, EventArgs e)
        {
            if (iniPro)
            {
                return;
            }

            ComboBox cb = ( ComboBox )sender;

            ted = new TaskEntryData();
            Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepartment);
            ListFormDataOp lo = new ListFormDataOp();

            switch (cb.Name)
            {
            case "comboBoxOffice":
                ted.OfficeName = cb.Text;
                create_cbDepart();

                etcd = lo.SelectTaskEntryNameData(Conv.OfficeCode, Conv.DepartCode, null);
                tcd  = lo.SelectTaskCodeNameData(Conv.OfficeCode, Conv.DepartCode, "DESC");
                this.textBoxTaskName.Text = "";
                clearLabel();
                break;

            case "comboBoxDepartment":
                ted.DepartName            = cb.Text;
                etcd                      = lo.SelectTaskEntryNameData(Conv.OfficeCode, Conv.DepartCode, null);
                tcd                       = lo.SelectTaskCodeNameData(Conv.OfficeCode, Conv.DepartCode, "DESC");
                this.textBoxTaskName.Text = "";
                clearLabel();
                break;

            case "comboBoxCostType":
                ted.CostType = cb.Text;
                clearLabel();
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        private void button_Click(object sender, EventArgs e)
        {
            Button btn = ( Button )sender;

            if (btn.Name == "buttonClose")
            {
                this.Close();
                return;
            }

            if (btn.Name == "buttonStoreMWorkItems")
            {
                if (formImpMWorkItems == null || formImpMWorkItems.IsDisposed)
                {
                    formImpMWorkItems = new FormImpMWorkItems(hp);
                    formImpMWorkItems.Show();
                }
                else
                {
                    MessageBox.Show(msgAlready);
                }
                return;
            }

            TaskEntryData itd = new TaskEntryData();

            if (btn.Name == "buttonAdd")
            {
                //itd.OfficeCode = Convert.ToString( comboBoxOffice.SelectedValue );
                //itd.Department = Convert.ToString( comboBoxDepartment.SelectedValue );
                //itd.OfficeName = comboBoxOffice.Text;
                //itd.DepartName = comboBoxDepartment.Text;

                //labelTaskEntryID.Text = "";
            }
            else
            {
                if (labelTaskEntryID.Text == "" || labelTaskEntryID.Text == "0")
                {
                    DMessage.DataNotEnough();
                    return;
                }

                itd = itd.SelectTaskEntryData(Convert.ToInt32(labelTaskEntryID.Text));

                itd.MemberCode     = hp.MemberCode;
                itd.TaxRate        = hp.TaxRate;
                itd.AdminCostRate  = hp.AdminCostRate;
                itd.OthersCostRate = hp.OthersCostRate;
                itd.Expenses       = hp.Expenses;

                itd.OfficeCode = Conv.OfficeCode;
                itd.Department = Conv.DepartCode;

                itd.PartnerName = labelPartner.Text;
            }

            switch (btn.Name)
            {
            case "buttonEstimate":
                formEstimate = new FormEstimate(itd);
                formEstimate.Show();
                break;

            case "buttonPlanning":
                formPlanning = new FormPlanning(itd);
                formPlanning.Show();
                break;

            case "buttonOsDetail":
                formOutsource = new FormOutsource(itd);
                formOutsource.Show();
                break;

            case "buttonContract":
                formContract = new FormContract(itd);
                formContract.Show();
                break;

            case "buttonRegular":
                formRegular = new FormRegular(itd);
                formRegular.Show();
                break;

            case "buttonVolumeInvoice":
                formVolumeInvoice = new FormVolumeInvoice(itd);
                formVolumeInvoice.Show();
                break;

            case "buttonInvoice":
                formInvoice = new FormInvoice(itd);
                formInvoice.Show();
                break;

            //case "buttonDetail":
            //    displayDetailLabel(ted);
            //    break;

            case "buttonAdd":
                itd.OfficeCode = Conv.OfficeCode;
                itd.Department = Conv.DepartCode;
                itd.OfficeName = Conv.Office;
                itd.DepartName = Conv.Depart;

                labelTaskEntryID.Text = "";



                itd = FormTaskEntry.DispData(itd);
                displayDetailLabel(itd);

                comboBoxCostType.Text = itd.CostType;
                textBoxTaskName.Text  = itd.TaskName;
                labelPartner.Text     = itd.PartnerName;
                labelTaskPlace.Text   = itd.TaskPlace;
                labelTaskCode.Text    = itd.TaskCode;
                labelTaskEntryID.Text = Convert.ToString(itd.TaskEntryID);
                // ? 仮版 : 正式版
                labelTaskName.Text = (labelTaskCode.Text.Trim() == "") ? "": itd.TaskName;

                ListFormDataOp lo = new ListFormDataOp();
                etcd = lo.SelectTaskEntryNameData(itd.OfficeCode, itd.Department, null);

                buttonTask.Enabled = string.IsNullOrEmpty(labelTaskCode.Text.Trim()) ? true : false;
                buttonTask.Visible = string.IsNullOrEmpty(labelTaskCode.Text.Trim()) ? true : false;

                break;

            case "buttonTask":
                if (String.IsNullOrEmpty(textBoxTaskName.Text))
                {
                    MessageBox.Show("対応する見積・計画用業務名がありません");
                    return;
                }
                tcds = FormTaskCodeNameList.ReceiveItems(tcd);
                if (!writeTaskCodeToTaskEntryData())
                {
                    return;
                }
                if (!displayTaskData(tcds))
                {
                    return;
                }
                break;

            default:
                break;
            }
        }