public JsonResult DeleteAuditionTime(int timeID) { AuditionTime at = new AuditionTime(timeID); at.Delete(); return Json(new {result="Delete Successful"}, JsonRequestBehavior.AllowGet); }
public ActionResult SaveAuditionTime(AdminEditAuditionTime m) { AuditionTime myAuditionTime = new AuditionTime(); try { if (ModelState.IsValid) { myAuditionTime.timeID = m.TimeID; myAuditionTime.availableSlots = m.Capacity; myAuditionTime.dateID = m.DateID; myAuditionTime.timeDescription = m.TimeDescription; myAuditionTime.signupStartDate = DateTime.Parse(m.SignUpStartDate); myAuditionTime.signupEndDate = DateTime.Parse(m.SignUpEndDate); myAuditionTime.Save(); } else { return View("EditAuditionTime", m); } } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return View("EditAuditionTime", m); } return RedirectToRoute("AdminDates", new { musicalID = m.MusicalID }); }
public ActionResult EditAuditionTime(int musicalID, int dateID, int timeID) { AuditionTime at = new AuditionTime(timeID); AdminEditAuditionTime m = new AdminEditAuditionTime(); m.MusicalID = musicalID; m.DateID = dateID; m.TimeID = timeID; if(at.timeID!=0) { m.TimeDescription = at.timeDescription; m.SignUpStartDate = ((DateTime)at.signupStartDate).ToString("MM/dd/yyyy"); m.SignUpEndDate = ((DateTime)at.signupEndDate).ToString("MM/dd/yyyy"); m.Capacity = Int32.Parse(at.availableSlots.ToString()); }; return View(m); }