Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
        public virtual bool Delet(int id)
        {
            string cmtext = query.Delete(id.ToString());

            using (CommanderBase commander = DBContext.CreateCommander())
                return(commander.NonQuery(cmtext));
        }
Exemplo n.º 4
0
        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));
            }
        }