public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CMethod_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CMethod.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CMethod_exten.PKId(pPkValue, new DAL()); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CMethod_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CMethod_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; } this.LoadData(); }
public void List_Option(ListOption pAction) { fAction = pAction; switch (fAction) { case ListOption.active: if (chk_notactive.Checked == true) { LoadData(CMethod_exten.NotActive(new DAL())); } else { LoadData(CMethod_exten.Active(new DAL())); } break; case ListOption.notactive: if (chk_notactive.Checked == true) { LoadData(CMethod_exten.NotActive(new DAL())); } else { LoadData(CMethod_exten.Active(new DAL())); } break; case ListOption.Search: if (txt_method_name.Text != "") { List <Method> list = new List <Method> { CMethod_exten.SearchName(txt_method_name.Text, new DAL()) }; LoadData(list); } else { LoadData(CMethod_exten.Active(new DAL())); } break; default: LoadData(CMethod_exten.Active(new DAL())); break; } }
private Vouchertype CollectData() { Vouchertype fobj = new Vouchertype() { Vouchertype_id = vId, Vouchertype_name = txt_vouchertype_name.Text, Method_id = CMethod_exten.GetId_Name(txt_method_id.Text), Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; return(fobj); }
void txt_method_LookupUpdate(object sender, EventArgs e) { txt_method_name.LookupList = CMethod_exten.GetforLookup(new DAL()); }