public ActionResult getForm(RefillViewModel model) { if (ModelState.IsValid) { // find the guid in the table and return the form var pickupManager = new PickUpsDBManager(); var retrievedPickup = pickupManager.findPickUpByPatientName(model.PatientName); if (model.Code == retrievedPickup.GuidRand) { var refillresponsemodel = new RefillResponseViewModel(); refillresponsemodel.CommunicationType = (int)CommunicationPreferenceId.Email; refillresponsemodel.pickupId = retrievedPickup.PickupId; return(PartialView("_RefillResponsePartialView", refillresponsemodel)); } } return(RedirectToAction("Index")); }
public async Task <ActionResult> SubmitResponse(RefillResponseViewModel model) { if (ModelState.IsValid) { var pickupManager = new PickUpsDBManager(); var retrievedPickup = pickupManager.findPickUpById(model.pickupId); if (model.SelectedConfirm && retrievedPickup != null) { pickupManager.confirmRefill(retrievedPickup.PickupId); var appmember = await UserManager.FindByNameAsync(retrievedPickup.PatientName); if (appmember != null) { appmember.CommunicationType = model.CommunicationType; await UserManager.UpdateAsync(appmember); } } } return(RedirectToAction("Index")); }