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))); } }
/// <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); } }
/// <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); } }
/// <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); } }
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); }
public SQLInsertTable(string table, SQLVarsVals vars) : this(table) { Variables = vars; }
public SQLUpdateTable(string tablename, SQLVarsVals vars, SQLWhereVars where) : this(tablename, vars) { WhereFields = where; }
public SQLUpdateTable(string tablename, SQLVarsVals vars) : this(tablename) { Variables = vars; }