private static Namespaces EntityData(string q) { using (IDataReader redr = new SQLITE_DAL().Listreader(q)) { while (redr.Read() == true) { Namespaces obj = new Namespaces() { Namespaces_id = redr[NAMESPACES.NAMESPACES_ID].ToString(), Namespaces_name = redr[NAMESPACES.NAMESPACES_NAME].ToString(), Notes = redr[NAMESPACES.NOTES].ToString(), Active_id = redr[NAMESPACES.ACTIVE_ID].ToString() }; return(obj); } redr.Close(); return(new Namespaces()); } }
public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CNamespaces_exten.PKId(pPkValue); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CNamespaces.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CNamespaces_exten.PKId(pPkValue); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CNamespaces_exten.PKId(pPkValue); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CNamespaces_exten.PKId(pPkValue); this.EnableControls(false); break; } this.LoadData(); }
private static List <Namespaces> EntityList(string q) { List <Namespaces> list = new List <Namespaces>(); using (IDataReader redr = new SQLITE_DAL().Listreader(q)) { while (redr.Read() == true) { Namespaces obj = new Namespaces() { Namespaces_id = redr[NAMESPACES.NAMESPACES_ID].ToString(), Namespaces_name = redr[NAMESPACES.NAMESPACES_NAME].ToString(), Notes = redr[NAMESPACES.NOTES].ToString(), Active_id = redr[NAMESPACES.ACTIVE_ID].ToString() }; list.Add(obj); } redr.Close(); } return(list); }