Пример #1
0
        public void SetAction(BtnEvent pAction, string pPkValue)
        {
            fAction = pAction;

            switch (fAction)
            {
            case BtnEvent.Open:
                btn_save.Text = "&CLOSE";
                obj           = CInvoice_exten.PKId(pPkValue);
                list          = CInvoiceitems_exten.FKId(pPkValue);
                this.EnableControls(false);
                break;

            case BtnEvent.New:
                btn_save.Text = "&SAVE";
                obj           = CInvoice.GetNew;
                list          = CInvoiceitems.GetNew;
                this.EnableControls(true);
                break;

            case BtnEvent.Edit:
                btn_save.Text = "&UPDATE";
                obj           = CInvoice_exten.PKId(pPkValue);
                list          = CInvoiceitems_exten.FKId(pPkValue);
                this.EnableControls(true);
                break;

            case BtnEvent.Delete:
                btn_save.Text = "CONFIRM\r\n&DELETE";
                obj           = CInvoice_exten.PKId(pPkValue);
                list          = CInvoiceitems_exten.FKId(pPkValue);
                this.EnableControls(false);
                break;

            case BtnEvent.Print:
                btn_save.Text = "&PRINT";
                obj           = CInvoice_exten.PKId(pPkValue);
                list          = CInvoiceitems_exten.FKId(pPkValue);
                this.EnableControls(false);
                print_panel.Show();
                break;
            }

            LoadData(obj);
            Loaditems(list);
        }
Пример #2
0
 private void LoadData(Const.Invoice obj)
 {
     vId = obj.Invoice_id;
     txt_order_id.Text     = obj.Order_id;
     txt_invoice_no.Text   = obj.Invoice_no.ToString();
     txt_invoice_date.Text = obj.Invoice_date;
     txt_party_id.Text     = obj.Party_id;
     txt_taxtype_id.Text   = obj.Taxtype_id;
     SetTaxtype();
     txt_salestype_id.Text   = obj.Salestype_id;
     txt_transport_id.Text   = obj.Transport_id;
     txt_deliveredto_id.Text = obj.Deliveredto_id;
     txt_bundel.Text         = obj.Bundel;
     txt_total_qty.Text      = obj.Total_qty.ToString();
     //txt_total_taxable_amount.Text = obj.Total_taxable_amount;
     txt_gsttotal.Text   = obj.Gsttotal.ToString();
     txt_ledger_id.Text  = CLedger_exten.GetName_Id(obj.Ledger_id);
     txt_additional.Text = obj.Additional.ToString();
     txt_grandtotal.Text = obj.Grandtotal.ToString();
     txt_balance.Text    = CInvoice_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString();
     txt_notes.Text      = obj.Notes;
     Core.Stative        = obj.Active_id;
     Setactives();
 }
Пример #3
0
 private void Txt_party_id_TextChanged(object sender, EventArgs e)
 {
     txt_balance.Text = CInvoice_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString();
 }