private SqlGenerator(string tableName, SqlOperationType type, BaseForm form, BaseVM view, int id, SqlQueryFormatter sqlQuery = null, List <string> condition = null, List <string> orderColumns = null) { this.OperationType = type; this.condition = condition; this.orderColumns = orderColumns; this.viewModel = view; this.rowId = id; if (type == SqlOperationType.GetById && id <= 0) { throw new ArgumentException("Id must provide to get the data"); } this.sqlQuery = sqlQuery ?? new SqlQueryFormatter(); var sqlParamsList = GetProperties(form); Parameters = PrepareSqlParams(sqlParamsList); Statement = PrepareSqlStatement(tableName, type, sqlParamsList); }
//public SqlParameterCollection SqlParams { get; set; } //tableName or StoredProcName public SqlGenerator(string tableName, SqlOperationType type, BaseForm form, SqlQueryFormatter sqlQuery = null, List <string> condition = null) : this(tableName, type, form, null, 0, sqlQuery, condition) { }
public SqlGenerator(string tableName, BaseForm form, BaseVM view, SqlQueryFormatter sqlQuery = null, List <string> condition = null, List <string> orderColumns = null) : this(tableName, SqlOperationType.Get, form, view, 0, sqlQuery, condition, orderColumns) { //this.viewModel = view; }
public SqlGenerator(string tableName, BaseVM view, int id, SqlQueryFormatter sqlQuery = null, List <string> condition = null) : this(tableName, SqlOperationType.GetById, null, view, id, sqlQuery, condition) { }
public SqlGenerator(string storedProcName, BaseForm form, SqlQueryFormatter sqlQuery = null, List <string> condition = null) : this(storedProcName, SqlOperationType.StoredProc, form, null, 0, sqlQuery, condition) { }