public virtual bool Delet <M>(int id) where M : class, new() { string cmtext = query.Delete <M>(id.ToString()); using CommanderBase commander = DBContext.CreateCommander(); return(commander.NonQuery(cmtext)); }
public virtual bool Update <M>(M t, int id) where M : class, new() { string cmtext = query.Update <M>(id.ToString()); using (CommanderBase commander = DBContext.CreateCommander()) return(commander.NonQuery(cmtext, commander.SetParametrs(t))); }
public virtual bool Delet(int id) { string cmtext = query.Delete(id.ToString()); using (CommanderBase commander = DBContext.CreateCommander()) return(commander.NonQuery(cmtext)); }
public virtual bool Update <M>(string[] columns, object[] values, int id) where M : class, new() { string cmtext = query.Update <M>(id.ToString(), columns); var p = new List <DbParameter>(); using (CommanderBase commander = DBContext.CreateCommander()) { for (int i = 0; i < columns.Length; i++) { p.Add(commander.SetParametr(columns[i], values[i])); } return(commander.NonQuery(cmtext, p)); } }