예제 #1
0
        public ActionResult Create(PolisPegawai polispegawai)
        {
            if (ModelState.IsValid)
            {
                db.PolisPegawais.Add(polispegawai);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(polispegawai);
        }
예제 #2
0
 public ActionResult Edit(PolisPegawai polispegawai)
 {
     if (ModelState.IsValid)
     {
         db.Entry(polispegawai).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(polispegawai);
 }