Esempio n. 1
0
            }                          // đị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 = "=";
            }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public static SqlParameter ParseSqlParam(dynamic data, Models.SysTableDetailView columnitem, string paraName)
 {
     return(ParseSqlParam(data, columnitem, paraName, ParameterDirection.Input));
 }
Esempio n. 4
0
 public static SqlParameter ParseSqlParam(dynamic data, Models.SysTableDetailView columnitem, ParameterDirection direction)
 {
     return(ParseSqlParam(data, columnitem, columnitem.ColumnName, direction));
 }