private void PopulatePatientEncounter(string encounterNo)
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);
            EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            EncounterDate.Value          = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            PatientNo.Value              = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            PatientNameValue.Text        = oDs.Tables[0].Rows[0]["PatientName"].ToString() + ", " + oDs.Tables[0].Rows[0]["Gender"].ToString() + ", " + CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            PatientName.Value            = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            DOB.Value                    = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            Insurance.Value              = oDs.Tables[0].Rows[0]["CompanyName"].ToString();
            InsuranceNo.Value            = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            ServiceType.Value            = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            PhysicianName.Value          = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();
            Remarks.Value                = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            Status.Value                 = oDs.Tables[0].Rows[0]["Status"].ToString();
            ddlDisposition.SelectedValue = oDs.Tables[0].Rows[0]["dispositionID"].ToString();
            RestDays.Value               = oDs.Tables[0].Rows[0]["RestForDays"].ToString();
            Recommendation.Value         = oDs.Tables[0].Rows[0]["WorkRestriction"].ToString();
            FollowUpDate.Value           = oDs.Tables[0].Rows[0]["FollowUpDate"].ToString();

            int StatusID = Convert.ToInt16(oDs.Tables[0].Rows[0]["StatusID"]);

            if ((StatusID == 2) || (StatusID == 4))
            {
                btnSave.Visible = false;
            }
        }
        private void PopulatePatientEncounter(string encounterNo)
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);
            EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            EncounterDate.Value      = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            PatientNo.Value          = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            PatientName.Value        = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            DOB.Value                = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            ddlCompany.SelectedValue = oDs.Tables[0].Rows[0]["InsuranceCompanyID"].ToString();
            InsuranceNo.Value        = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            //  ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0]["FacilityID"].ToString();
            ServiceType.Value          = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            ddlPhysician.SelectedValue = oDs.Tables[0].Rows[0]["PhysicianID"].ToString();
            Remarks.Value           = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            ddlStatus.SelectedValue = oDs.Tables[0].Rows[0]["StatusID"].ToString();

            if (oDs.Tables[0].Rows[0]["StatusID"].ToString() == "4")
            {
                btnMedCertificate.Visible = true;
                btnPrescription.Visible   = true;
                btnSave.Visible           = false;
                btnSaveDoctor.Visible     = false;
            }
        }
        private void PopulatePatientEncounter(string encounterNo)
        {
            lblAddress.Text = "";
            var oDAL   = new PatientEncounterDAL();
            var oClass = new PatientEncounterModel();
            var oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);

            lblDate.Text      = DateTime.Today.ToShortDateString();
            lblPatient.Text   = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            lblGender.Text    = oDs.Tables[0].Rows[0]["gender"].ToString();
            lblAge.Text       = CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            lblPhysician.Text = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();
            lblAddress.Text   = oDs.Tables[0].Rows[0]["Address"].ToString();
            //  lblEncounterDate.Text = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToLongDateString();
            lblPhysicianLicense.Text = oDs.Tables[0].Rows[0]["licenseNo"].ToString();
        }
        private void PopulatePatientEncounter(string encounterNo)
        {
            var oDAL   = new PatientEncounterDAL();
            var oClass = new PatientEncounterModel();
            var oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);

            lblDate.Text      = DateTime.Today.ToShortDateString();
            lblPatient.Text   = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            lblGender.Text    = oDs.Tables[0].Rows[0]["gender"].ToString();
            lblAge.Text       = CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            lblPhysician.Text = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();

            lblEncounterDate.Text    = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToLongDateString();
            lblPhysicianLicense.Text = oDs.Tables[0].Rows[0]["licenseNo"].ToString();

            string DisPosition     = oDs.Tables[0].Rows[0]["Disposition"].ToString();
            var    RestDay         = oDs.Tables[0].Rows[0]["RestForDays"].ToString();
            var    WorkRestriction = oDs.Tables[0].Rows[0]["WorkRestriction"].ToString();
            var    followup        = oDs.Tables[0].Rows[0]["FollowupDate"].ToString();

            lblRecomen.Text = "";
            string Recommendation = "";

            if (DisPosition != "")
            {
                Recommendation = "<br/><b>DISPOSITION</b> <br/> " + DisPosition + "<br/> </br>";
            }

            Recommendation = Recommendation + " <b> RECOMMENDATIONS </b>";
            if (RestDay != "")
            {
                Recommendation = Recommendation + "<br/>To rest for " + RestDay + "days. </br>";
            }

            if (WorkRestriction != "")
            {
                Recommendation = Recommendation + "<br/>Work restrictions as follows <br/>" + WorkRestriction;
            }

            if (followup != "")
            {
                Recommendation = Recommendation + "<br/>FollowUp Date: <br/>" + Convert.ToDateTime(followup).ToShortDateString();
            }

            lblRecomen.Text = Recommendation;

            //EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            //EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            //EncounterDate.Value = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            //PatientNo.Value = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            //PatientName.Value = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            //DOB.Value = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            //ddlCompany.SelectedValue = oDs.Tables[0].Rows[0]["InsuranceCompanyID"].ToString();
            //InsuranceNo.Value = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            ////  ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0]["FacilityID"].ToString();
            //ServiceType.Value = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            //ddlPhysician.SelectedValue = oDs.Tables[0].Rows[0]["PhysicianID"].ToString();
            //Remarks.Value = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            //ddlStatus.SelectedValue = oDs.Tables[0].Rows[0]["StatusID"].ToString();
        }