コード例 #1
0
        public ActionResult ByCategory(long id = 0)
        {
            //id untuk Category Id
            List <Variant> list = VariantRepo.ByCategory(id);

            return(PartialView("_ByCategory", list));
        }
コード例 #2
0
        public ActionResult Edit(long id)
        {
            Product model = ProductRepo.ById(id);

            ViewBag.CategoryList = new SelectList(CategoryRepo.All(), "Id", "Initial");
            ViewBag.VariantList  = new SelectList(VariantRepo.ByCategory(model.Variant.CategoryId), "Id", "Initial");
            return(PartialView("_Edit", model));
        }
コード例 #3
0
 public ActionResult Create()
 {
     ViewBag.CategoryList = new SelectList(CategoryRepo.All(), "Id", "Initial");
     ViewBag.VariantList  = new SelectList(VariantRepo.ByCategory(-1), "Id", "Initial");
     return(PartialView("_Create"));
 }