public ActionResult ByCategory(long id = 0) { //id untuk Category Id List <Variant> list = VariantRepo.ByCategory(id); return(PartialView("_ByCategory", list)); }
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)); }
public ActionResult Create() { ViewBag.CategoryList = new SelectList(CategoryRepo.All(), "Id", "Initial"); ViewBag.VariantList = new SelectList(VariantRepo.ByCategory(-1), "Id", "Initial"); return(PartialView("_Create")); }