コード例 #1
0
 public ActionResult Edit(CustomerEnt customer)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(customer).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Details", new { id = customer.ClientID }));
         }
         return(View("Error"));
     }
     catch (Exception)
     { return(View("Error")); }
 }
コード例 #2
0
 public ActionResult CreateConfirmed(CustomerEnt customer)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.CustomerEnts.Add(customer);
             db.SaveChanges();
             return(RedirectToAction("Details", new { id = customer.ClientID }));
         }
         return(View("Error"));
     }
     catch (Exception)
     { return(View("Error")); }
 }