示例#1
0
        public JsonResult GetSubCategory(int selectedValue)
        {
            IRepositoryBase <ProductSubCategory> repositorySubCategory = new ProductSubCategoryRepository();
            var items = repositorySubCategory.GetAll().Where(x => x.ProductCategoryID == selectedValue).ToList();

            return(Json(items, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult Edit(int id)
        {
            var product = repository.GetByID(id);

            GetProduct(product);
            ViewBag.ProductModelID = product.ProductModelId;
            IRepositoryBase <ProductSubCategory> repositorySubCategory = new ProductSubCategoryRepository();

            ViewBag.ProductCategoryID    = repositorySubCategory.GetAll().Where(x => x.ProductSubCategoryID == product.ProductSubCategoryID).Select(y => y.ProductCategoryID).FirstOrDefault();
            ViewBag.ProductSubCategoryID = product.ProductSubCategoryID;
            return(View(product));
        }
示例#3
0
        public Product GetProduct(Product product)
        {
            IRepositoryBase <ProductCategory> repositoryCategory = new ProductCategoryRepository();

            product.ProductCategoryCollection = repositoryCategory.GetAll().ToList();
            IRepositoryBase <ProductSubCategory> repositorySubCategory = new ProductSubCategoryRepository();

            product.ProductSubCategoryCollection = repositorySubCategory.GetAll().ToList();
            IRepositoryBase <ProductModel> repositoryProductModel = new ProductModelRepository();

            product.ProductModelCollection = repositoryProductModel.GetAll().ToList();
            return(product);
        }