public ActionResult Edit(DailyHours d, string command)
 {
     if (command.Equals("Update"))
     {
         // if (ModelState.IsValid)
         //{
         d.UpdateDailyHours(d);
         // }
         //  else
         //{
         //   return View(d);
         //  }
     }
     else
     {
         d.DeleteDailyHours(d);
     }
     return(RedirectToAction("Details"));
 }
Exemplo n.º 2
0
 public ActionResult Edit(DailyHours d, string command)
 {
     if (d == null || string.IsNullOrEmpty(command))
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (d == null || string.IsNullOrEmpty(command))
     {
         return(HttpNotFound());
     }
     if (command.Equals("Update"))
     {
         d.UpdateDailyHours(d);
     }
     else
     {
         d.DeleteDailyHours(d);
     }
     return(RedirectToAction("Details"));
 }