} // định bỏ //public static bool checkExistence(int filterIndex, NameValueCollection @params) //{ // return (@params[string.Format("filter[{0}][field]", filterIndex)] != null); //} public Filter(Models.SysTableDetailView metacolumn) { //Id = id; Field = metacolumn.ColumnName; DataType = Services.ExConvert.Sqltype2Systemtype(metacolumn.DATA_TYPE); DataValue = metacolumn.FilterExpression; Datacomparison = "="; }
public static SqlParameter ParseSqlParam(dynamic data, Models.SysTableDetailView columnitem, string paraName, ParameterDirection direction) { var sqlparameter = new SqlParameter(); sqlparameter.Direction = direction; sqlparameter.ParameterName = string.Format("@{0}", paraName); var value = data.GetType().GetProperty(columnitem.ColumnName).GetValue(data, null) ?? String.Empty; if (string.IsNullOrEmpty(value.ToString())) { sqlparameter.SqlDbType = Convert2SqlDbType(columnitem.DATA_TYPE); sqlparameter.Value = DBNull.Value; } else { sqlparameter.Value = value; } return(sqlparameter); }
public static SqlParameter ParseSqlParam(dynamic data, Models.SysTableDetailView columnitem, string paraName) { return(ParseSqlParam(data, columnitem, paraName, ParameterDirection.Input)); }
public static SqlParameter ParseSqlParam(dynamic data, Models.SysTableDetailView columnitem, ParameterDirection direction) { return(ParseSqlParam(data, columnitem, columnitem.ColumnName, direction)); }