public ActionResult Delete(PrescriptionPickup pickup) { try { pickupManager.DeletePrescriptionPickup(pickup, 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); } return View(); } }
/// <summary> /// GET Create action - returns the Create view used to enter prescription pickup information. /// </summary> /// <param name="medicationid"> /// The id of the medication that this pickup will be made for. /// </param> /// <returns> /// The Create view. /// </returns> public ActionResult Create(int medicationid) { var accountid = Kernel.Get<Accounts>().GetAccountByIdentity(HttpContext.User.Identity).Id; var pickup = new PrescriptionPickup { AccountId = accountid, MedicationId = medicationid }; return View(pickup); }