public ActionResult Delete(int ConsentDetailID) { string val = ""; ConsentPatient obj = new ConsentPatient(); BL_ConsentPatient consentPatient = new BL_ConsentPatient(); if (consentPatient.DeleteConsentPatient(ConsentDetailID)) { val = "ConsentPatient Deleted Successfully"; } return(Json(val)); }
public ActionResult GetConsentPatient(int ConsentID) { BL_ConsentPatient BL_obj = new BL_ConsentPatient(); DataSet ds = new DataSet(); List <ConsentPatient> searclist = new List <Models.Patient.ConsentPatient>(); ds = BL_obj.GetConsentMaster(ConsentID); foreach (DataRow dr in ds.Tables[0].Rows) { ConsentPatient obj = new ConsentPatient(); obj.Path = ds.Tables[0].Rows[0]["Path"].ToString(); obj.ConsentID = ds.Tables[0].Rows[0]["ConsentID"].ToString(); obj.ConsentName = ds.Tables[0].Rows[0]["ConsentName"].ToString(); searclist.Add(obj); } return(Json(searclist, JsonRequestBehavior.AllowGet)); }
public ActionResult ConsentPatient(FormCollection fc, ConsentPatient obj) { try { //if (consentMaster.CheckConsentMaster(obj.ConsentID, obj.ConsentName)) //{ obj.billDate = fc["billDate"] + " " + fc["billTime"]; if (obj.PatientRegNo != null) { obj.PatientRegNo = fc["RegNo"].ToString(); } else { obj.PatientRegNo = ""; } if (obj.opdIpdNumberID != null) { obj.opdIpdNumberID = fc["opdIpdNumberid"].ToString(); } else { obj.opdIpdNumberID = ""; } if (obj.PatientName != null) { obj.PatientName = fc["patientName"].ToString(); } else { obj.PatientName = ""; } if (obj.PatientType1 != null) { obj.PatientType1 = fc["PatientType1"].ToString(); } else { obj.PatientType = ""; } if (obj.Gender != null) { obj.Gender = fc["Gender"].ToString(); } else { obj.Gender = ""; } if (obj.Address != null) { obj.Address = fc["Address"].ToString(); } else { obj.Address = ""; } if (obj.GuardianName != null) { obj.GuardianName = fc["guardianName"].ToString(); } else { obj.GuardianName = ""; } if (obj.ConsultantDrID != null) { obj.ConsultantDrID = fc["ConsultantDrID"].ToString(); } else { obj.ConsultantDrID = ""; } if (obj.ReferredDrID != null) { obj.ReferredDrID = fc["ReferredDrID"].ToString(); } else { obj.ReferredDrID = ""; } if (obj.ConsentDetailID == "") { obj.ConsentDetailID = "0"; } int consentDetailID = Convert.ToInt32(obj.ConsentDetailID); if (BLConsentPatient.Save(obj)) { if (consentDetailID > 0) { ModelState.Clear(); TempData["msg"] = "Record Updated Successfully"; return(RedirectToAction("ConsentPatient", "ConsentPatient")); } else { ModelState.Clear(); TempData["msg"] = "Record Saved Successfully"; return(RedirectToAction("ConsentPatient", "ConsentPatient")); } } //} //else //{ // TempData["Msg"] = "ConsentMaster Already Exist's"; //} return(RedirectToAction("ConsentPatient", "ConsentPatient")); } catch (Exception exe) { throw; } return(RedirectToAction("ConsentPatient", "ConsentPatient")); }
public ActionResult FillRegDetails(string PregNo) { List <ConsentPatient> fillList = new List <ConsentPatient>(); ConsentPatient catl = new ConsentPatient(); DataSet dsPatientOPD = new DataSet(); DataSet dsPatientOPDDetails = new DataSet(); DataSet dsPrivilegeCard = new DataSet(); int IPDNo = 0; BL_ConsentPatient BL_obj = new BL_ConsentPatient(); DataSet dsPatient = new DataSet(); dsPatient.Reset(); dsPrivilegeCard.Reset(); if (PregNo != "") { dsPatient = BL_obj.GetGetPatientConsent(Convert.ToInt32(PregNo)); } if (dsPatient.Tables.Count > 0) { if (dsPatient.Tables[0].Rows.Count > 0) { if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "IPD") { IPDNo = Convert.ToInt32(dsPatient.Tables[0].Rows[0]["OPDIPDID"].ToString()); } } } if (dsPatient.Tables.Count > 0) { if (dsPatient.Tables[0].Rows.Count > 0) { catl.PatientRegNo = dsPatient.Tables[0].Rows[0]["PatientRegNO"].ToString(); catl.PrintRegNO = dsPatient.Tables[0].Rows[0]["PrintRegNO"].ToString(); catl.PatientName = dsPatient.Tables[0].Rows[0]["PatientName"].ToString(); catl.GuardianName = dsPatient.Tables[0].Rows[0]["GuardianName"].ToString(); catl.PatientType = dsPatient.Tables[0].Rows[0]["PatientType"].ToString(); catl.Gender = dsPatient.Tables[0].Rows[0]["Gender"].ToString(); catl.Age = dsPatient.Tables[0].Rows[0]["Age"].ToString(); catl.DateOfBirth = Convert.ToDateTime(dsPatient.Tables[0].Rows[0]["DateOfBirth"]).ToString("yyyy-MM-dd"); catl.MobileNo = dsPatient.Tables[0].Rows[0]["MobileNo"].ToString(); catl.Address = dsPatient.Tables[0].Rows[0]["Address"].ToString(); if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "IPD") { #region IPD Detail Of Patient catl.OPDIPDID = dsPatient.Tables[0].Rows[0]["OPDIPDID"].ToString(); if (dsPatient.Tables[0].Rows[0]["ConsultantDrID"].ToString() != "" || dsPatient.Tables[0].Rows[0]["ReferredDrID"].ToString() != "0") { catl.ConsultantDrID = dsPatient.Tables[0].Rows[0]["ConsultantDrID"].ToString(); catl.ReferredByDoctorID = dsPatient.Tables[0].Rows[0]["ReferredDrID"].ToString(); catl.DoctorPrintName = dsPatient.Tables[0].Rows[0]["ConsultantDrName"].ToString(); catl.ReffDoctorName = dsPatient.Tables[0].Rows[0]["ReferredDrName"].ToString(); } #endregion } else if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "OPD") { #region OPD Detail Of Patient if (dsPatient.Tables[0].Rows[0]["ConsultantDrID"].ToString() != "" && dsPatient.Tables[0].Rows[0]["ReferredDrID"].ToString() != "0") { catl.ConsultantDrID = dsPatient.Tables[0].Rows[0]["ConsultantDrID"].ToString(); catl.ReferredByDoctorID = dsPatient.Tables[0].Rows[0]["ReferredDrID"].ToString(); catl.DoctorPrintName = dsPatient.Tables[0].Rows[0]["ConsultantDrName"].ToString(); catl.ReffDoctorName = dsPatient.Tables[0].Rows[0]["ReferredDrName"].ToString(); } catl.OPDIPDID = dsPatient.Tables[0].Rows[0]["OPDIPDID"].ToString(); #endregion } } } fillList.Add(catl); return(Json(fillList, JsonRequestBehavior.AllowGet)); }
public bool Save(ConsentPatient obj) { Connect(); SqlCommand cmd = new SqlCommand("IUConsentPatient", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@HospitalID", HospitalID); cmd.Parameters.AddWithValue("@LocationID", LocationID); if (obj.ConsentDetailID == "0" || obj.ConsentDetailID == "" || obj.ConsentDetailID == null) { cmd.Parameters.AddWithValue("@ConsentDetailID", 0); cmd.Parameters["@ConsentDetailID"].Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@Mode", "Add"); } else { cmd.Parameters.AddWithValue("@ConsentDetailID", obj.ConsentDetailID); cmd.Parameters.AddWithValue("@Mode", "Edit"); } cmd.Parameters.AddWithValue("@ConsentID", obj.ConsentName); if (obj.ConsentNameform == null) { cmd.Parameters.AddWithValue("@ConsentName", string.Empty); } else { cmd.Parameters.AddWithValue("@ConsentName", obj.ConsentNameform); } if (obj.Description == null) { cmd.Parameters.AddWithValue("@Footer", ""); } else { if (obj.Description == "<p><br></p>" || obj.Description == "<h1><br></h1>" || obj.Description == "<h2><br></h2>" || obj.Description == "<h3><br></h3>") { cmd.Parameters.AddWithValue("@Footer", ""); } else { cmd.Parameters.AddWithValue("@Footer", (obj.Description)); } } if (obj.PatientRegNo == null) { cmd.Parameters.AddWithValue("@PatientRegNO", DBNull.Value); } else { cmd.Parameters.AddWithValue("@PatientRegNO", obj.PatientRegNo); } if (obj.OPDIPDID == null) { cmd.Parameters.AddWithValue("@PatientOPDNO", DBNull.Value); } else { cmd.Parameters.AddWithValue("@PatientOPDNO", obj.OPDIPDID); } if (obj.opdIpdNumberID == null) { cmd.Parameters.AddWithValue("@PrintOPDNo", DBNull.Value); } else { cmd.Parameters.AddWithValue("@PrintOPDNo", obj.opdIpdNumberID); } if (obj.billDate == null) { cmd.Parameters.AddWithValue("@PatientRegistrationDate", DBNull.Value); } else { cmd.Parameters.AddWithValue("@PatientRegistrationDate", obj.billDate); } if (obj.PatientType1 == null) { cmd.Parameters.AddWithValue("@PatientType", DBNull.Value); } else { cmd.Parameters.AddWithValue("@PatientType", obj.PatientType1); } if (obj.TPA_ID == null) { cmd.Parameters.AddWithValue("@TPA_ID", DBNull.Value); } else { cmd.Parameters.AddWithValue("@TPA_ID", obj.TPA_ID); } if (obj.ConsultantDrID == null) { cmd.Parameters.AddWithValue("@DoctorID", DBNull.Value); } else { cmd.Parameters.AddWithValue("@DoctorID", obj.ConsultantDrID); } if (obj.DepartmentID == null) { cmd.Parameters.AddWithValue("@DepartmentID", DBNull.Value); } else { cmd.Parameters.AddWithValue("@DepartmentID", obj.DepartmentID); } if (obj.ReferredDrID == null) { cmd.Parameters.AddWithValue("@ReferredByDoctorID", DBNull.Value); } else { cmd.Parameters.AddWithValue("@ReferredByDoctorID", obj.ReferredDrID); } if (obj.Weight == null) { cmd.Parameters.AddWithValue("@Weight", DBNull.Value); } else { cmd.Parameters.AddWithValue("@Weight", obj.Weight); } if (obj.BloodPressure == null) { cmd.Parameters.AddWithValue("@BloodPressure", DBNull.Value); } else { cmd.Parameters.AddWithValue("@BloodPressure", obj.BloodPressure); } cmd.Parameters.AddWithValue("@CreationID", UserID); con.Open(); int i = cmd.ExecuteNonQuery(); con.Close(); if (i > 0) { return(true); } else { return(false); } }