public virtual List <T> getFromToWithSrc(int from, int to, string srcClm, string srcValue) { string cmtext = query.getFromToWithSrc(from, to, srcClm); using (CommanderBase commander = DBContext.CreateCommander()) return(commander.Reader <T>(cmtext, new List <DbParameter> { commander.SetParametr(srcClm, srcValue) })); }
public virtual List <T> GetByColumName(string columName, object value) { string cmtext = query.GetByColumName(columName); using (CommanderBase commander = DBContext.CreateCommander()) return(commander.Reader <T>(cmtext, new List <DbParameter>() { commander.SetParametr(columName, value) })); }
public virtual (M, bool) GetByColumNameFist <M>(string columName, object value, params string[] selectColumn) where M : class, new() { string cmtext = query.GetByColumName <M>(columName, selectColumn); using (CommanderBase commander = DBContext.CreateCommander()) { return(commander.ReaderFist <M>(cmtext, new List <DbParameter>() { commander.SetParametr(columName, value) })); } }
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)); } }
public virtual int RowCountWithSrc(string srcClm, string srcValue) { string cmtext = query.RowCountWithSrc(srcClm); using (CommanderBase commander = DBContext.CreateCommander()) { var o = commander.Scaller(cmtext, new List <DbParameter>() { commander.SetParametr(srcClm, srcValue) }); if (o != null) { return(Convert.ToInt32(o)); } else { return(0); } } }