예제 #1
0
        public ActionResult DivisiNew()
        {
            DivisiViewModel vm = new DivisiViewModel();

            vm.Param = new DivisiParam();
            UpdateDivisiParam(vm.Param);
            return(View(vm));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public ActionResult DivisiNew(DivisiViewModel div)
 {
     if (ModelState.IsValid)
     {
         db.Divisions.Add(div.Divisi);
         db.SaveChanges();
         return(RedirectToAction("Divisi"));
     }
     return(View(div));
 }
예제 #4
0
 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));
 }