public ActionResult Editrx(int PatientID, int RxDataID) { RxViewModel p = new RxViewModel(); DataService.Patientportal.PatientPortalService cls = new DataService.Patientportal.PatientPortalService(); try { CommonStatus cs = cls.GetRxData(RxDataID, base.GetLoggedinUserID()); if (cs != null && cs.OpStatus) { RxData input = (RxData)cs.OpPayload; p.RxDataID = input.RxData_ID; p.rxDate = input.RxDate; p.rxDoctor = input.RxDoctor; p.Prescription1 = input.Prescription1; p.Prescription2 = input.Prescription2; p.Prescription3 = input.Prescription3; p.Prescription4 = input.Prescription4; p.Prescription5 = input.Prescription5; } } catch (Exception ex) { } finally { cls = null; } return(PartialView(p)); }
public ActionResult EditRx(int PatientID, RxViewModel input) { string status = string.Empty; string message = string.Empty; if (ModelState.IsValid) { DataService.Patientportal.PatientPortalService cls = new DataService.Patientportal.PatientPortalService(); try { RxData p = new RxData(); p.RxData_ID = input.RxDataID; p.RxDate = input.rxDate; p.RxDoctor = input.rxDoctor; p.Prescription1 = input.Prescription1; p.Prescription2 = input.Prescription2; p.Prescription3 = input.Prescription3; p.Prescription4 = input.Prescription4; p.Prescription5 = input.Prescription5; CommonStatus cs = cls.AddUpdatePatientRxData(PatientID, p, base.GetLoggedinUserID()); if (cs != null && cs.OpStatus) { status = "OK"; message = ""; } else { status = "ERROR"; message = cs.OpMessage; } } catch (Exception ex) { status = "ERROR"; message = ex.Message; } finally { cls = null; } } var jsonData = new { status = status, message = message }; return(Json(jsonData, JsonRequestBehavior.AllowGet)); }