示例#1
0
 public SQLParamList(SQLVarsVals vars, string prefix = "@")
 {
     for (int index = 0; index < vars.Count(); index++)
     {
         Parameters.Add(new SQLParam($"{prefix}{vars.GetName(index)}", vars.GetValue(index)));
     }
 }
示例#2
0
 /// <summary>
 /// Creates a new variable to host variables that already exist in another
 /// </summary>
 /// <param name="vars">The variable to be duplicated</param>
 public SQLVarsVals(SQLVarsVals vars) : this()
 {
     foreach (var v in vars.GetVars())
     {
         Variables.Add(v);
     }
 }
示例#3
0
 /// <summary>
 /// Removes a list of variables from the list
 /// </summary>
 /// <param name="vars">the variables to be removed</param>
 public void Remove(SQLVarsVals vars)
 {
     foreach (var v in vars.GetVars())
     {
         Variables.Remove(v);
     }
 }
示例#4
0
 /// <summary>
 /// Adds another instancees variables to this list of variables with values
 /// </summary>
 /// <param name="vars">The variable list to be added to this one</param>
 public void Add(SQLVarsVals vars)
 {
     foreach (var v in vars.GetVars())
     {
         Variables.Add(v);
     }
 }
示例#5
0
        public SQLVarsVals GetVarsVals()
        {
            SQLVarsVals temp = new SQLVarsVals();

            foreach (var v in Variables)
            {
                temp.Add(new SQLVarVal(v.GetName(), v.GetRawValue(), v.GetOperand(), v.GetIsNum()));
            }
            return(temp);
        }
        public List <SQLVarsVals> GetVariables()
        {
            List <SQLVarsVals> temp = new List <SQLVarsVals>();

            string[] fields = Fields.GetFieldNames().Split(',');
            for (int index = 0; index < Values.Count; index++)
            {
                SQLVarsVals var = new SQLVarsVals();
                for (int index2 = 0; index2 < fields.Length; index2++)
                {
                    var.Add(fields[index2], Values[index].GetFieldValues(index2).GetRawValue());
                }
                temp.Add(var);
            }
            return(temp);
        }
示例#7
0
 public SQLInsertTable(string table, SQLVarsVals vars) : this(table)
 {
     Variables = vars;
 }
示例#8
0
 public SQLUpdateTable(string tablename, SQLVarsVals vars, SQLWhereVars where) : this(tablename, vars)
 {
     WhereFields = where;
 }
示例#9
0
 public SQLUpdateTable(string tablename, SQLVarsVals vars) : this(tablename)
 {
     Variables = vars;
 }