// GET: Product Category
        public ActionResult Index()
        {
            List <Product> lst_product = product_service.GetAllProduct(this.GetShopId());
            // List<Shop> lst_shop = shop_service.GetAll().ToList();
            List <ProductCategory> lst_procate = PC_service.GetAll().ToList();

            //ViewData["Shop"] = lst_shop;
            ViewData["ProductCategory"] = lst_procate;
            return(View(lst_product));
        }
 //
 // GET: /ProductCategory/
 public ActionResult Index()
 {
     listProductCategory = _productCategoryService.GetAll().ToList();
     // Check language not use anymore
     if (Session["language"] == null)
     {
         Session["language"] = "en_US.js";
     }
     return(View(listProductCategory));
 }
Пример #3
0
        public ResponseMessageWrap <GetAllResponse> GetAll(NoneRequest reqMsg)
        {
            var categoryList = service.GetAll();

            return(new ResponseMessageWrap <GetAllResponse>
            {
                Body = new GetAllResponse
                {
                    CategoryList = categoryList
                }
            });
        }
        /// <summary>
        /// /添加
        /// </summary>
        /// <param name="productCategory"></param>
        /// <returns></returns>
        public IHttpActionResult AddCategory(ProductCategory productCategory)
        {
            var productCategoryService = new ProductCategoryService();
            var maxCateNum             = productCategoryService.GetAll().Select(item => item.CateNum).LastOrDefault();
            int i = Int32.Parse(maxCateNum);

            i++;
            productCategory.CateNum    = i.ToString().PadLeft(6, '0');
            productCategory.IsDelete   = 0;
            productCategory.CreateTime = DateTime.Now;
            productCategory.CreateUser = "******";
            var addCategory = productCategoryService.Add(productCategory);
            var result      = new
            {
                Count = addCategory
            };

            return(Json(result));
        }
Пример #5
0
        public HttpResponseMessage getAllPage(HttpRequestMessage request, string keyword, int page, int pageSize = 20)
        {
            return(CreateHttpResponse(request, () =>
            {
                int totalRow = 0;
                var responseData = ProductCategoryService.ReadPage(keyword, page, pageSize);

                totalRow = ProductCategoryService.GetAll(keyword).Count;

                var paginationSet = new PaginationSet <ProductCategoryModel>()
                {
                    Items = responseData,
                    Page = page,
                    TotalCount = totalRow,
                    TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize)
                };
                var response = request.CreateResponse(HttpStatusCode.OK, paginationSet);
                return response;
            }));
        }
Пример #6
0
        public List <tblCategory> GetCategories()
        {
            List <tblCategory> categories = service.GetAll().ToList <tblCategory>();

            return(categories);
        }
Пример #7
0
 public void GetAllCategoryService_Test()
 {
     var categoryList = service.GetAll();
 }