Пример #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));
 }