private void saleInvoiceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormInvoice fi = new FormInvoice();

            fi.Show();
            this.Hide();
        }
Beispiel #2
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;
            }
        }