public JsonResult GetAllConsentPatient()
        {
            BL_ConsentPatient BL_obj = new BL_ConsentPatient();

            return(new JsonResult {
                Data = BL_obj.GetAllConsentPatient(), JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public JsonResult GetPrintNo_ToRegNo(string PrintRegNo)
        {
            BL_ConsentPatient BL_Reg = new BL_ConsentPatient();
            string            RegNo  = BL_Reg.GetPrintNo_ToRegNo(PrintRegNo);

            return(new JsonResult {
                Data = RegNo, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        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 FillPatientConsentOLDBillsNO(int RegNo)
        {
            BL_ConsentPatient     BL_obj    = new BL_ConsentPatient();
            DataSet               ds        = new DataSet();
            List <ConsentPatient> searclist = new List <Models.Patient.ConsentPatient>();

            ds = BL_obj.GetPatientConsentOLDBillsNO(RegNo);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                searclist.Add(new ConsentPatient
                {
                    oldBill         = dr["BillNo&Date"].ToString(),
                    ConsentDetailID = dr["ConsentDetailID"].ToString(),
                });
            }
            return(new JsonResult {
                Data = searclist, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        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 OLDBillDataFill(int BillNo)
        {
            BL_ConsentPatient     BL_obj    = new BL_ConsentPatient();
            DataSet               ds        = new DataSet();
            List <ConsentPatient> searclist = new List <Models.Patient.ConsentPatient>();

            ds = BL_obj.GetConsentPatient(BillNo);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                searclist.Add(new ConsentPatient
                {
                    Footer          = dr["Footer"].ToString(),
                    ConsentDetailID = dr["ConsentDetailID"].ToString(),
                    ConsentID       = dr["ConsentID"].ToString(),
                    ConsentName     = dr["ConsentName"].ToString(),
                    billDate        = Convert.ToDateTime(dr["PatientRegistrationDate"]).ToString("yyyy-MM-dd"),
                    billTime        = Convert.ToDateTime(dr["PatientRegistrationDate"]).ToString("hh:mm"),
                });
            }
            return(new JsonResult {
                Data = searclist, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        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));
        }