Beispiel #1
0
        public ActionResult Group(string group)
        {
            var listModel = new ListPoductModel()
            {
                ProductStatus = productStatusRepositoryFE.GetByAscii(group),
                ListProduct   = productRepositoryFE.GetListByGroupAscii(group)
            };

            return(View(listModel));
        }
Beispiel #2
0
        public ActionResult List(string parentAscii, string ascii, string typeAscii)
        {
            var typeParent = productTypeRepositoryFE.GetByParentAsciiAndAscii(parentAscii, ascii);

            var type = productTypeRepositoryFE.GetByAsciiAndParent(typeAscii, typeParent.ID);

            var listModel = new ListPoductModel()
            {
                TypeParent      = typeParent,
                Type            = type,
                ListProduct     = productRepositoryFE.GetListByTypeAscii(0, 10, typeAscii),
                ListProductType = productTypeRepositoryFE.GetListByParent(typeParent.ID)
            };

            return(View(listModel));
        }
Beispiel #3
0
        public ActionResult Detail(string parentAscii, string ascii, string typeAscii, string product)
        {
            var typeRoot = productTypeRepositoryFE.GetByParentAsciiAndAscii(parentAscii, ascii);

            var typeParentList = productTypeRepositoryFE.GetByParentAsciiAndAscii(ascii, typeAscii);

            var typeList = productTypeRepositoryFE.GetByAsciiAndParent(product, typeParentList.ID);

            if (typeList != null)
            {
                var listModel = new ListPoductModel()
                {
                    TypeParent      = typeRoot,
                    Type            = typeList,
                    ListProduct     = productRepositoryFE.GetListByTypeAscii(0, 10, product),
                    ListProductType = productTypeRepositoryFE.GetListByParent(typeParentList.ID)
                };

                return(View("~/Views/Product/ListThreeLevel.cshtml", listModel));
            }


            var productDetail = productRepositoryFE.GetItemByAscii(product);

            var typeParent = productTypeRepositoryFE.GetByParentAsciiAndAscii(parentAscii, ascii);

            var type = productTypeRepositoryFE.GetByAsciiAndParent(typeAscii, typeParent.ID);

            var detailModel = new ProductDetailModel()
            {
                TypeParent      = typeParent,
                Type            = type,
                ListProduct     = productRepositoryFE.GetListByTypeAscii(0, 10, typeAscii),
                ListProductType = productTypeRepositoryFE.GetListByParent(typeParent.ID),
                Product         = productDetail
            };

            return(View(detailModel));
        }