예제 #1
0
        public int Update(AlterArgs args)
        {
            ExecArgs ea    = ArgsHelper.Update("Record", args);
            int      count = ExecEditor(ea.Text, ea.Type, ea.Param);

            return(count);
        }
예제 #2
0
        public static ExecArgs Update(string table, AlterArgs args)
        {
            SQLiteParameter[] param = null;
            string            set   = string.Empty;

            if (args != null && args.Length > 0)
            {
                param = new SQLiteParameter[args.Length];
                for (int i = 0; i < args.Length; i++)
                {
                    param[i] = new SQLiteParameter(args[i].Name, args[i].Value);
                    if (!args.Where.Contains(args[i].Name))
                    {
                        set += string.Format("{0}=@{0},", args[i].Name);
                    }
                }

                set = set.Remove(set.Length - 1);
            }

            string cmdText = string.Format("Update {0} Set {1} Where {2}", table, set, args?.Where);

            ExecArgs ea = new ExecArgs()
            {
                Text  = cmdText,
                Type  = CommandType.Text,
                Param = param
            };

            return(ea);
        }
예제 #3
0
        public int Delete(AlterArgs args)
        {
            ExecArgs ea = ArgsHelper.Delete("Config", args);

            int count = this.ExecEditor(ea.Text, ea.Type, ea.Param);

            return(count);
        }
예제 #4
0
        public static ExecArgs Delete(string table, AlterArgs args)
        {
            SQLiteParameter[] param = null;
            if (args != null && args.Length > 0)
            {
                param = new SQLiteParameter[args.Length];
                for (int i = 0; i < args.Length; i++)
                {
                    param[i] = new SQLiteParameter(args[i].Name, args[i].Value);
                }
            }


            string cmdText = string.Format("Delete From {0} Where {1}", table, args?.Where);

            ExecArgs ea = new ExecArgs()
            {
                Text  = cmdText,
                Type  = CommandType.Text,
                Param = param
            };

            return(ea);
        }
예제 #5
0
 public int Update <T>(T tag, AlterArgs args)
 {
     throw new NotImplementedException();
 }
예제 #6
0
        public int Update(AlterArgs args)
        {
            ExecArgs ea = ArgsHelper.Update("Config", args);

            return(ExecEditor(ea.Text, ea.Type, ea.Param));
        }