public ActionResult Delete(int? facilityid, MedicalAppointment appointment) { try { this.appointmentManager.DeleteMedicalAppointment(appointment, HttpContext.User.Identity); return RedirectToAction("Index"); } catch (Exception exception) { ViewBag.ErrorMessage = string.Format( "There was an error while trying to process your action. The message is: {0}", exception.Message); if (exception.InnerException != null) { ViewBag.InnerErrorMessage = string.Format( "The inner message is: {0}", exception.InnerException.Message); } if (facilityid.HasValue) { ViewBag.FacilityId = facilityid; } return View(appointment); } }
/// <summary> /// GET Create action - returns the Create view used to enter appointment information. /// </summary> /// <param name="providerid"> /// The id of the provider that this appointment will be made for. /// </param> /// <returns> /// The Create view. /// </returns> public ActionResult Create(int providerid) { var accountid = Kernel.Get<Accounts>().GetAccountByIdentity(HttpContext.User.Identity).Id; var appointment = new MedicalAppointment { AccountId = accountid, ProviderId = providerid }; return View(appointment); }