Exemple #1
0
        public static ProductCategory_CE ToCE(ProductCategoryEntity item)
        {
            ProductCategory_CE target = new ProductCategory_CE();

            target.ID         = item.ID;
            target.CateNum    = item.CateNum;
            target.CateName   = item.CateName;
            target.IsDelete   = item.IsDelete;
            target.CreateTime = item.CreateTime;
            target.CreateUser = item.CreateUser;
            target.Remark     = item.Remark;
            return(target);
        }
        /// <summary>
        /// 根据类别名称查询类别信息
        /// </summary>
        /// <param name="cateName"></param>
        /// <returns></returns>
        public ProductCategory_CE GetSingleCateName(string cateName)
        {
            if (cateName.IsEmpty())
            {
                return(null);
            }
            ProductCategoryProvider provider = new ProductCategoryProvider();
            ProductCategoryEntity   entity   = provider.GetSingleCateName(cateName);

            if (entity.IsNotNull())
            {
                ProductCategory_CE ce = ProductCategory_To.ToCE(entity);
                return(ce);
            }
            return(null);
        }
        /// <summary>
        /// 查询所有的货品种类
        /// </summary>
        /// <returns></returns>
        public List <ProductCategory_CE> GetList()
        {
            ProductCategoryProvider      provider   = new ProductCategoryProvider();
            List <ProductCategoryEntity> listResult = provider.GetList();

            if (!listResult.IsNullOrEmpty())
            {
                List <ProductCategory_CE> list = new List <ProductCategory_CE>();
                foreach (ProductCategoryEntity item in listResult)
                {
                    ProductCategory_CE ce = ProductCategory_To.ToCE(item);
                    list.Add(ce);
                }
                return(list);
            }
            return(null);
        }