public ActionResult DivisiNew() { DivisiViewModel vm = new DivisiViewModel(); vm.Param = new DivisiParam(); UpdateDivisiParam(vm.Param); return(View(vm)); }
public ActionResult DivisiDelete(int id) { DivisiViewModel vm = new DivisiViewModel(); vm.Divisi = db.Divisions.Single(p => p.DivisionId == id); vm.Param = new DivisiParam(); UpdateDivisiParam(vm.Param); return(View(vm)); }
public ActionResult DivisiNew(DivisiViewModel div) { if (ModelState.IsValid) { db.Divisions.Add(div.Divisi); db.SaveChanges(); return(RedirectToAction("Divisi")); } return(View(div)); }
public ActionResult DivisiEdit(DivisiViewModel div) { if (ModelState.IsValid) { db.Divisions.Attach(div.Divisi); db.Entry(div.Divisi).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Divisi")); } return(View(div)); }