public IList <ModelInfo> GetModelList(ModelType modelTyp, ModelShowType showType)
        {
            IList <ModelInfo> list      = new List <ModelInfo>();
            string            strSql    = "SELECT * FROM PE_Model WHERE 1 = 1 ";
            Parameters        cmdParams = new Parameters();

            switch (modelTyp)
            {
            case ModelType.Content:
                strSql = strSql + " AND IsEshop = @IsEshop ";
                cmdParams.AddInParameter("@IsEshop", DbType.Boolean, false);
                break;

            case ModelType.Shop:
                strSql = strSql + " AND IsEshop = @IsEshop ";
                cmdParams.AddInParameter("@IsEshop", DbType.Boolean, true);
                break;
            }
            switch (showType)
            {
            case ModelShowType.Enable:
                strSql = strSql + " AND Disabled = @Disabled ";
                cmdParams.AddInParameter("@Disabled", DbType.Boolean, false);
                break;

            case ModelShowType.Disable:
                strSql = strSql + " AND Disabled = @Disabled ";
                cmdParams.AddInParameter("@Disabled", DbType.Boolean, true);
                break;
            }
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(ModelInfoFromDataReader(reader));
                }
            }
            return(list);
        }
Exemple #2
0
 public static IList <ModelInfo> GetShopModelList(ModelShowType showType)
 {
     return(GetModelList(ModelType.Shop, showType));
 }
Exemple #3
0
 public static IList <ModelInfo> GetModelList(ModelType modelType, ModelShowType showType)
 {
     return(dal.GetModelList(modelType, showType));
 }
Exemple #4
0
 public static IList <ModelInfo> ContentModelList(ModelShowType showType)
 {
     return(GetModelList(ModelType.Content, showType));
 }