コード例 #1
0
        private void Q_Add_Load(object sender, EventArgs e)
        {
            if (this.Owner.GetType() == typeof(Quotes))
            {
                Quotes owner = (Quotes)this.Owner;
                txt_QA_CCode.Text = owner.GetClientCode();
                txt_QA_CName.Text = owner.GetClientName();
                dt = owner.GetQuotes();
            }
            else
            {
                Int_Quotes owner = (Int_Quotes)this.Owner;
                txt_QA_CCode.Text = owner.GetClientCode();
                txt_QA_CName.Text = owner.GetClientName();
                dt = owner.GetQuotes();
            }

            int qNum = 0;

            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState == DataRowState.Deleted)
                {
                    string str = dr["Quote_Number", DataRowVersion.Original].ToString().Trim();
                    int    pos = str.IndexOf("_");
                    int    x   = Convert.ToInt32(str.Remove(0, pos + 2));

                    if (x > qNum)
                    {
                        qNum = x;
                    }
                }
                else
                {
                    string str = dr["Quote_Number"].ToString().Trim();
                    int    pos = str.IndexOf("_");
                    int    x   = Convert.ToInt32(str.Remove(0, pos + 2));
                    if (x > qNum)
                    {
                        qNum = x;
                    }
                }
            }
            txt_QA_QNum.Text = txt_QA_CCode.Text + "_Q" + (qNum + 1).ToString("000");
            txt_QA_Desc.Focus();
        }
コード例 #2
0
        private void Q_Edit_Del_Load(object sender, EventArgs e)
        {
            if (this.Owner.GetType() == typeof(Quotes))
            {
                Quotes owner = (Quotes)this.Owner;

                dt                 = owner.GetQuotes();
                SELECTED_QUOTE     = owner.GetSelectedQuote();
                txt_QED_CCode.Text = owner.GetClientCode();
                txt_QED_CName.Text = owner.GetClientName();
            }
            else
            {
                Int_Quotes owner = (Int_Quotes)this.Owner;

                dt                 = owner.GetQuotes();
                SELECTED_QUOTE     = owner.GetSelectedQuote();
                txt_QED_CCode.Text = owner.GetClientCode();
                txt_QED_CName.Text = owner.GetClientName();
            }
            LoadQuote();
        }
コード例 #3
0
        private void SetSelectedTabButton(object sender)
        {
            Button b    = (Button)sender;
            string name = b.Name;

            switch (name)
            {
            case "btn_LOrders":
            {
                selectedTab = "lOrders";
                Orders frmLOrders = new Orders();
                frmLOrders.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmLOrders;
                break;
            }

            case "btn_LQuotes":
            {
                selectedTab = "lQuotes";
                Quotes frmLQuotes = new Quotes();
                frmLQuotes.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmLQuotes;
                break;
            }

            case "btn_LInvSend":
            {
                selectedTab = "lInvSend";
                Invoices_Send frmInvSend = new Invoices_Send();
                frmInvSend.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmInvSend;
                break;
            }

            case "btn_IOrders":
            {
                selectedTab = "iOrders";
                Int_Orders frmIOrders = new Int_Orders();
                frmIOrders.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmIOrders;
                break;
            }

            case "btn_IQuotes":
            {
                selectedTab = "iQuotes";
                Int_Quotes frmIQuotes = new Int_Quotes();
                frmIQuotes.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmIQuotes;
                break;
            }

            case "btn_IInvSend":
            {
                selectedTab = "iInvSend";
                Int_Invoices_Send frmIInvSend = new Int_Invoices_Send();
                frmIInvSend.SetClient(selectedClientCode, selectedClientName);
                curTabForm = frmIInvSend;
                break;
            }
            }
        }