示例#1
0
 public ActionResult Edit(EmplDetails details)
 {
     try
     {
         db.Entry(details.ToEmployee()).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("EmplDetails", details));
     }
 }
示例#2
0
 public ActionResult Create(EmplDetails details)
 {
     try
     {
         db.Employees.Add(details.ToEmployee());
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("EmplDetails"));
     }
 }