private Voucher CollectData() { Voucher fobj = new Voucher() { Voucher_id = vId, Company_id = Current.Company_id, Voucher_no = txt_voucher_no.Text, Voucher_date = txt_voucher_date.Text, Vouchertype_id = CVouchertype_exten.GetId_Name(txt_vouchertype_id.Text), Order_id = COrder_exten.GetId_Name(txt_order_id.Text), Ledger_id = CLedger_exten.GetId_Name(txt_ledger_id.Text), Party_id = CParty_exten.GetId_Name(txt_party_id.Text), Purpose = txt_purpose.Text, Credit = "", Debit = "", Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; var method = CVouchertype_exten.GetMethodid_Name(txt_vouchertype_id.Text); if (method == "1")// 1 payment { fobj.Credit = txt_credit.Text; } else if (method == "2") // receipt { fobj.Debit = txt_debit.Text; } return(fobj); }
public void List_Option(ListOption pAction) { fAction = pAction; switch (fAction) { case ListOption.active: if (chk_notactive.Checked == true) { LoadData(CVoucher_exten.NotActive(new DAL())); } else { LoadData(CVoucher_exten.Active(new DAL())); } break; case ListOption.notactive: if (chk_notactive.Checked == true) { LoadData(CVoucher_exten.NotActive(new DAL())); } else { LoadData(CVoucher_exten.Active(new DAL())); } break; case ListOption.Search: List <Voucher> list = CVoucher_exten.Searchfilter( txt_voucher_no.Text , txt_voucher_no_1.Text , txt_voucher_date.Text , txt_voucher_date_1.Text , CVouchertype_exten.GetId_Name(txt_vouchertype.Text) , COrder_exten.GetId_Name(txt_orderref.Text) , CLedger_exten.GetId_Name(txt_ledger.Text) , CParty_exten.GetId_Name(txt_party.Text) , txt_purpose.Text , new DAL()); LoadData(list); break; default: LoadData(CVoucher_exten.Active(new DAL())); break; } }
private void Txt_vouchertype_id_TextChanged(object sender, EventArgs e) { var method = CVouchertype_exten.GetId_Name(txt_vouchertype_id.Text); if (method == "1") { txt_credit.Visible = true; lbl_credit.Visible = true; txt_debit.Visible = false; lbl_debit.Visible = false; } else if (method == "2") { txt_credit.Visible = false; lbl_credit.Visible = false; txt_debit.Visible = true; lbl_debit.Visible = true; } }
void Txt_vouchertype_LookupUpdate(object sender, EventArgs e) { txt_vouchertype_id.LookupList = CVouchertype_exten.GetforLookup(new DAL()); }