Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "StudentId,FirstName,LastName,StudentCode,PhoneNumber,Address,CourseId")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(int id, CustomerViewModel customerViewModel)
 {
     try
     {
         var customer = Mapper.Map <Customer>(customerViewModel);
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }