public ActionResult Add() { MultiDrop model = new MultiDrop(); ViewBag.Locations = RepoLocation.FindAll(); return(View("Form", model)); }
public ActionResult Edit(int id) { Context.Multidrop dbitem = RepoMultidrop.FindByPK(id); MultiDrop model = new MultiDrop(dbitem); ViewBag.name = model.tujuan; ViewBag.Locations = RepoLocation.FindAll(); return(View("Form", model)); }
public ActionResult Edit(MultiDrop model) { if (ModelState.IsValid) { Context.Multidrop dbitem = RepoMultidrop.FindByPK(model.Id); model.setDb(dbitem); RepoMultidrop.save(dbitem); return(RedirectToAction("Index")); } ViewBag.Locations = RepoLocation.FindAll(); return(View("Form", model)); }