private static void InsertData(Ledger obj, string newDB) { if (CheckData(obj, newDB) == false) { obj.Ledgergroup_id = CLedgergroup_exten.GetId_Name(obj.Ledgergroup_id); CLedger.Insert(obj, new DAL()); } ; }
public void List_Option(ListOption pAction) { fAction = pAction; switch (fAction) { case ListOption.active: if (chk_notactive.Checked == true) { LoadData(CLedgergroup_exten.NotActive(new DAL())); } else { LoadData(CLedgergroup_exten.Active(new DAL())); } break; case ListOption.notactive: if (chk_notactive.Checked == true) { LoadData(CLedgergroup_exten.NotActive(new DAL())); } else { LoadData(CLedgergroup_exten.Active(new DAL())); } break; case ListOption.Search: if (txt_ledgergroup_name.Text != "") { List <Ledgergroup> list = new List <Ledgergroup> { CLedgergroup_exten.SearchName(txt_ledgergroup_name.Text, new DAL()) }; LoadData(list); } else { LoadData(CLedgergroup_exten.Active(new DAL())); } break; default: LoadData(CLedgergroup_exten.Active(new DAL())); break; } }
private Ledger CollectData() { Ledger fobj = new Ledger() { Ledger_id = vId, Ledger_name = txt_ledger_name.Text, Ledgergroup_id = CLedgergroup_exten.GetId_Name(txt_ledgergroup_id.Text), Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; return(fobj); }
private static bool CheckData(Ledger obj, string newDB) { string q = "USE " + newDB + "; "; q += "SELECT * FROM " + LEDGER.LEDGER_TBL + " WHERE " + LEDGER.LEDGER_NAME + " = '" + obj.Ledger_name + "'; "; using (IDataReader redr = new DAL().Listreader(q)) { while (redr.Read() == true) { obj.Ledger_id = redr[LEDGER.LEDGER_ID].ToString(); obj.Ledgergroup_id = CLedgergroup_exten.GetId_Name(obj.Ledgergroup_id); CLedger.Update(obj, new DAL()); return(true); } return(false); } }
public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CLedgergroup_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CLedgergroup.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CLedgergroup_exten.PKId(pPkValue, new DAL()); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CLedgergroup_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CLedgergroup_exten.PKId(pPkValue, new DAL()); this.EnableControls(false); break; } this.LoadData(); }
void txt_ledgergroup_LookupUpdate(object sender, EventArgs e) { txt_ledgergroup_name.LookupList = CLedgergroup_exten.GetforLookup(new DAL()); }