Ejemplo n.º 1
0
    private void FillControls(SqlInt32 HospitalID)
    {
        HospitalENT entHospital = new HospitalENT();
        HospitalBAL balHospital = new HospitalBAL();

        entHospital = balHospital.SelectByPK(HospitalID);

        if (!entHospital.HospitalName.IsNull)
        {
            txtHospitalName.Text = entHospital.HospitalName.Value.ToString();
        }
        if (!entHospital.Overview.IsNull)
        {
            txtOverview.Text = entHospital.Overview.Value.ToString();
        }
        if (!entHospital.Address.IsNull)
        {
            txtAddress.Text = entHospital.Address.Value.ToString();
        }
        if (!entHospital.Mobile.IsNull)
        {
            txtMobile.Text = entHospital.Mobile.Value.ToString();
        }
        if (!entHospital.Email.IsNull)
        {
            txtEmail.Text = entHospital.Email.Value.ToString();
        }

        if (!entHospital.CityID.IsNull)
        {
            ddlCity.SelectedValue = entHospital.CityID.Value.ToString();
        }
        if (!entHospital.SpecialityID.IsNull)
        {
            ddlSpeciality.SelectedValue = entHospital.SpecialityID.Value.ToString();
        }

        HospitalWiseReportBAL balHospitalWiseReportBAL = new HospitalWiseReportBAL();
        DataTable             dtReport = new DataTable();

        dtReport = balHospitalWiseReportBAL.SelectByHospitalID(HospitalID);

        foreach (DataRow row in dtReport.Rows)
        {
            foreach (ListItem item in chlReport.Items)
            {
                if (item.Value == row["ReportID"].ToString().Trim())
                {
                    item.Selected = true;
                }
            }
        }
    }
    public void fillHospitalDetails(SqlInt32 HospitalID)
    {
        HospitalBAL balHospital = new HospitalBAL();
        HospitalENT entHospital = new HospitalENT();

        entHospital = balHospital.SelectByPK(HospitalID);

        if (!entHospital.HospitalName.IsNull)
        {
            lblHospitalName.Text = entHospital.HospitalName.Value;
        }
        if (!entHospital.SpecialityID.IsNull)
        {
            SpecialityBAL balSpeciality = new SpecialityBAL();
            SpecialityENT entSpeciality = new SpecialityENT();

            entSpeciality = balSpeciality.SelectByPK(Convert.ToInt32(entHospital.SpecialityID.Value));

            lblSpeciality.Text = entSpeciality.SpecialityName.Value;
        }
        if (!entHospital.Overview.IsNull)
        {
            lblOverview.Text = entHospital.Overview.Value;
        }
        if (!entHospital.Address.IsNull)
        {
            hlAddress.Text = entHospital.Address.Value;
        }
        if (!entHospital.Email.IsNull)
        {
            hlEmail.NavigateUrl = "mailto:" + entHospital.Email.Value;
            hlEmail.Text        = entHospital.Email.Value;
        }
        if (!entHospital.Mobile.IsNull)
        {
            hlMobile.NavigateUrl = "tel:" + entHospital.Mobile.Value;
            hlMobile.Text        = entHospital.Mobile.Value;
        }

        HospitalWiseReportBAL balHospitalWiseReport = new HospitalWiseReportBAL();
        DataTable             dtReport = new DataTable();

        dtReport = balHospitalWiseReport.SelectByHospitalID(HospitalID);

        rptReport.DataSource = dtReport;
        rptReport.DataBind();

        DoctorBAL balDoctorBAL = new DoctorBAL();
        DataTable dtDoctor     = new DataTable();

        dtDoctor = balDoctorBAL.SelectByHospitalID(HospitalID);

        if (dtDoctor != null && dtDoctor.Rows.Count > 0)
        {
            rptDoctors.DataSource = dtDoctor;
            rptDoctors.DataBind();

            pnlNoDoctorFound.Visible = false;
        }
        else
        {
            pnlNoDoctorFound.Visible = true;
        }

        if (Convert.ToBoolean(Application["CheckAdmin"]) == true && Convert.ToBoolean(Application["CheckDoctor"]) == false)
        {
            lbEditHospital.Visible = true;
            lbDoctorAdd.Visible    = true;
        }
        else if (Convert.ToBoolean(Application["CheckAdmin"]) == false && Convert.ToBoolean(Application["CheckDoctor"]) == true)
        {
            lbEditHospital.Visible = false;
            lbDoctorAdd.Visible    = false;

            Boolean checkDoctor = dtDoctor.Select().ToList().Exists(row => row["DoctorID"].ToString().ToUpper() == Session["UserID"].ToString());

            if (checkDoctor == true)
            {
                lbEditHospital.Visible = true;
            }
        }
    }
    public void fillHospitalDetails(SqlInt32 HospitalID)
    {
        HospitalBAL balHospital = new HospitalBAL();
        HospitalENT entHospital = new HospitalENT();

        entHospital = balHospital.SelectByPK(HospitalID);

        if (!entHospital.HospitalName.IsNull)
        {
            lblHospitalName.Text = entHospital.HospitalName.Value;
        }
        if (!entHospital.SpecialityID.IsNull)
        {
            SpecialityBAL balSpeciality = new SpecialityBAL();
            SpecialityENT entSpeciality = new SpecialityENT();

            entSpeciality = balSpeciality.SelectByPK(Convert.ToInt32(entHospital.SpecialityID.Value));

            lblSpeciality.Text = entSpeciality.SpecialityName.Value;
        }
        if (!entHospital.Overview.IsNull)
        {
            lblOverview.Text = entHospital.Overview.Value;
        }
        if (!entHospital.Address.IsNull)
        {
            hlAddress.Text = entHospital.Address.Value;
        }
        if (!entHospital.Email.IsNull)
        {
            hlEmail.NavigateUrl = "mailto:" + entHospital.Email.Value;
            hlEmail.Text        = entHospital.Email.Value;
        }
        if (!entHospital.Mobile.IsNull)
        {
            hlMobile.NavigateUrl = "tel:" + entHospital.Mobile.Value;
            hlMobile.Text        = entHospital.Mobile.Value;
        }

        HospitalWiseReportBAL balHospitalWiseReport = new HospitalWiseReportBAL();
        DataTable             dtReport = new DataTable();

        dtReport = balHospitalWiseReport.SelectByHospitalID(HospitalID);

        rptReport.DataSource = dtReport;
        rptReport.DataBind();

        DoctorBAL balDoctorBAL = new DoctorBAL();
        DataTable dtDoctor     = new DataTable();

        dtDoctor = balDoctorBAL.SelectByHospitalID(HospitalID);

        if (dtDoctor != null && dtDoctor.Rows.Count > 0)
        {
            rptDoctors.DataSource = dtDoctor;
            rptDoctors.DataBind();

            pnlNoDoctorFound.Visible = false;
        }
        else
        {
            pnlNoDoctorFound.Visible = true;
        }
    }