public DataSet UpdateDoctorID(TemporaryDoctorMaster obj1) { SqlDataAdapter dt = new SqlDataAdapter(); DataSet ds = new DataSet(); if (obj1.PatientType == "OPD") { if (obj1.ConsultantDoctorID != "") { Connect(); SqlCommand da = new SqlCommand("update PatientOPDDetails set DoctorID = " + obj1.ConsultantDoctorID + " ,DepartmentID = " + obj1.DepartMentID + ",TemporaryDoctor = " + "''" + ",RefferedTemporaryDoctorStatus = " + 0 + ",TemporaryDoctorStatus = " + 0 + " where PatientOPDNO = " + obj1.PatientOPDIPDNO + " ", con); dt.SelectCommand = da; con.Open(); dt.Fill(ds); con.Close(); } if (obj1.ReferredByDoctorID != "") { Connect(); SqlCommand da1 = new SqlCommand("update PatientOPDDetails set ReferredByDoctorID = " + obj1.ReferredByDoctorID + ",RefferedTemporaryDoctor = " + "''" + " where PatientOPDNO = " + obj1.PatientOPDIPDNO + " ", con); dt.SelectCommand = da1; con.Open(); dt.Fill(ds); con.Close(); } } if (obj1.PatientType == "IPD") { if (obj1.ConsultantDoctorID != "") { Connect(); SqlCommand da2 = new SqlCommand("update PatientIPDDetails set ConsultantDrID = " + obj1.ConsultantDoctorID + ",DepartmentID = " + obj1.DepartMentID + " ,TemporaryDoctor = " + "''" + ",RefferedTemporaryDoctorStatus = " + 0 + " ,TemporaryDoctorStatus = " + 0 + " where PatientIPDNO = " + obj1.PatientOPDIPDNO + " ", con); dt.SelectCommand = da2; con.Open(); dt.Fill(ds); con.Close(); } if (obj1.ReferredByDoctorID != "") { Connect(); SqlCommand da3 = new SqlCommand("update PatientIPDDetails set ReferredByDoctorID = " + obj1.ReferredByDoctorID + " ,RefferedTemporaryDoctor = " + "''" + " where PatientIPDNO = " + obj1.PatientOPDIPDNO + " ", con); dt.SelectCommand = da3; con.Open(); dt.Fill(ds); con.Close(); } } return(ds); }
public ActionResult TemporaryDoctorMaster(TemporaryDoctorMaster obj1, FormCollection fc) { DataSet dsPatientdetails = new DataSet(); obj1.patientname = Request.Form["patient_name"].ToString(); obj1.PatientOPDIPDNO = Request.Form["PatientOPDIPDNO"].ToString(); obj1.PatientRegNo = Request.Form["PatientRegNO"].ToString(); obj1.PatientType = Request.Form["PatientType1"].ToString(); if (obj1.TemporaryDoctor != "") { obj1.ConsultantDoctorName = Request.Form["ConsultantDoctorName"].ToString(); obj1.ConsultantDoctorID = Request.Form["ConsultantDoctorID"].ToString(); if (Request.Form["DepartMentID"] == "" || Request.Form["DepartMentID"] == null) { obj1.DepartMentID = ""; } else { obj1.DepartMentID = Request.Form["DepartMentID"].ToString(); } } if (obj1.RefferedTemporaryDoctor != "") { obj1.ReferredByDoctorName = Request.Form["ReferredByDoctorName"].ToString(); obj1.ReferredByDoctorID = Request.Form["ReferredByDoctorID"].ToString(); } temporary.UpdateDoctorID(obj1); if (Convert.ToInt32(obj1.PatientRegNo) > 0) { TempData["Msg"] = "Record Updated Successfully !"; ModelState.Clear(); RedirectToAction("TemporaryDoctorMaster", "TemporaryDoctorMaster"); } else { return(RedirectToAction("TemporaryDoctorMaster", "TemporaryDoctorMaster")); } return(View(obj)); }
public ActionResult PatientRegNO_Leave(string RegNo) { List <TemporaryDoctorMaster> fillList = new List <TemporaryDoctorMaster>(); TemporaryDoctorMaster catl = new TemporaryDoctorMaster(); DataSet dsPatientOPD = new DataSet(); DataSet dsPatientOPDDetails = new DataSet(); BL_TemporaryDoctorMaster BL_obj = new BL_TemporaryDoctorMaster(); DataSet dsPatient = new DataSet(); dsPatient.Reset(); if (RegNo != "") { dsPatient = BL_obj.GetPatientForTemporaryDoctorMaster(HospitalID, LocationID, Convert.ToInt32(RegNo)); } if (dsPatient.Tables.Count > 0) { if (dsPatient.Tables[0].Rows.Count > 0) { catl.PatientRegNo = dsPatient.Tables[0].Rows[0]["PatientRegNO"].ToString(); catl.PatientType = dsPatient.Tables[0].Rows[0]["PatientType"].ToString(); catl.patientname = dsPatient.Tables[0].Rows[0]["PatientName"].ToString(); catl.PatientOPDIPDNO = dsPatient.Tables[0].Rows[0]["PatientOPDIPDNO"].ToString(); catl.Consultant = "Consultant"; catl.Referred = "Referred"; if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "IPD") { #region IPD Detail Of Patient if (dsPatient.Tables[0].Rows[0]["TemporaryDoctor"].ToString() != "" || dsPatient.Tables[0].Rows[0]["RefferedTemporaryDoctor"].ToString() != "0") { catl.TemporaryDoctor = dsPatient.Tables[0].Rows[0]["TemporaryDoctor"].ToString(); catl.RefferedTemporaryDoctor = dsPatient.Tables[0].Rows[0]["RefferedTemporaryDoctor"].ToString(); } #endregion } else if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "OPD") { #region OPD Detail Of Patient if (dsPatient.Tables[0].Rows[0]["TemporaryDoctor"].ToString() != "" || dsPatient.Tables[0].Rows[0]["RefferedTemporaryDoctor"].ToString() != "0") { catl.TemporaryDoctor = dsPatient.Tables[0].Rows[0]["TemporaryDoctor"].ToString(); catl.RefferedTemporaryDoctor = dsPatient.Tables[0].Rows[0]["RefferedTemporaryDoctor"].ToString(); } #endregion } } } fillList.Add(catl); return(Json(fillList, JsonRequestBehavior.AllowGet)); }