public ActionResult SaveAuditionDate(AdminEditAuditionDate m) { AuditionDate myAuditionDate = new AuditionDate(); try { if (ModelState.IsValid) { myAuditionDate.dateID = m.DateID; myAuditionDate.musicalID = m.MusicalID; myAuditionDate.date = DateTime.Parse(m.Date); myAuditionDate.Save(); } else { return View("EditAuditionDate", m); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View("EditAuditionDate", m); } return RedirectToRoute("AdminDates", new { musicalID = m.MusicalID }); }
public ActionResult EditAuditionDate(int musicalID, int dateID) { AuditionDate ad = new AuditionDate(dateID); AdminEditAuditionDate m = new AdminEditAuditionDate(); m.MusicalID = musicalID; m.DateID = dateID; if (ad.dateID != 0) { m.Date = ((DateTime)ad.date).ToString("MM/dd/yyyy"); }; return View(m); }