public Condition(string field, object value, string condition) { Value = new Col(field, value); this.Condition_Type = condition; }
public Condition(Col value) { Value = value; }
public Condition(string field, object value) { Value = new Col(field, value); }
public static string Select(string table, List <string> Columes) { return($"select {Col.Values_SQL_Syntax(Columes, ",")} from {table};"); }
public Condition(Col value, string condition) { Value = value; this.Condition_Type = condition; }
public static string Select(string table, List <string> Columns, List <Condition> Conditions, string ConditionType) { return($"select {Col.Values_SQL_Syntax(Columns, ",")} from {table} where {Condition.SQL_Syntax(Conditions, ConditionType)};"); }
public static string Update(string table, List <Col> Updated_Values, Condition Condition) { string values = Col.Values_SQL_Syntax(Updated_Values, ","); return($"update {table} set {values.Trim(',')} where {Condition.SQL_Syntax()};"); }
public static string Update(string table, List <Col> Updated_Values, List <Condition> Conditions, string ConditionType) { string values = Col.Values_SQL_Syntax(Updated_Values, ","), selector = Condition.SQL_Syntax(Conditions, ConditionType); return($"update {table} set {values} where {selector};"); }
private static string SQL_Syntax(Col value) { return($"{value.GetField()} = {value.Value_SQL_Syntax()}"); }
/// <summary> /// Copy column data from another column /// </summary> /// <param name="col">column to cope from</param> public void Set(Col col) { _field = col.GetField(); _value = col.GetValue(); }