Beispiel #1
0
        public void InitBal(BloodBankBAL balBank, BloodDonationCampBAL balCamp, BloodDonorBAL balDonor,
                            BloodDonorDonationBAL balDonation, BloodInventoryBAL balInventory, HospitalBAL balHospital, TransactionBAL balTransaction)
        {
            try
            {
                this.balBank        = balBank;
                this.balCamp        = balCamp;
                this.balDonor       = balDonor;
                this.balDonation    = balDonation;
                this.balInventory   = balInventory;
                this.balHospital    = balHospital;
                this.balTransaction = balTransaction;
            }

            catch (System.Data.SqlClient.SqlException ex)
            {
                MessageHandler.ShowErrorMessage(ex.Message);
            }

            catch (ValidationException ex)
            {
                MessageHandler.ShowErrorMessage(ex.Message);
            }
            catch (ConnectedDalException ex)
            {
                MessageHandler.ShowErrorMessage(ex.Message);
            }
            catch (Exception ex)
            {
                MessageHandler.ShowErrorMessage(ex.Message);
            }
        }
    public void fillHospitalRepeater(Int32 PageIndex)
    {
        HospitalBAL balHospital = new HospitalBAL();
        DataTable   dt = new DataTable();
        SqlString   CityID, SpecialityID;
        int         recordCount = 0;

        if (ViewState["CityID"].ToString() == "")
        {
            CityID = "";
        }
        else
        {
            CityID = ViewState["CityID"].ToString();
        }
        if (ViewState["SpecialityID"].ToString() == "")
        {
            SpecialityID = "";
        }
        else
        {
            SpecialityID = ViewState["SpecialityID"].ToString();
        }
        if (ViewState["CityID"].ToString() == "" && ViewState["SpecialityID"].ToString() == "")
        {
            CityID       = null;
            SpecialityID = null;
        }

        dt          = balHospital.SelectByCityIDSpecialityID(CityID, SpecialityID, PageIndex, PageSize);
        recordCount = balHospital.SelectByCityIDSpecialityIDRecordCount(CityID, SpecialityID);

        if (dt != null && dt.Rows.Count > 0)
        {
            rptHospital.DataSource = dt;
            rptHospital.DataBind();
            pnlHospitalList.Visible  = true;
            pnlHospitalEmpty.Visible = false;
        }
        else
        {
            if (recordCount > 0)
            {
                fillHospitalRepeater(1);
                return;
            }
            else
            {
                pnlHospitalList.Visible  = false;
                pnlHospitalEmpty.Visible = true;
            }
        }

        ViewState["CurrentPageIndex"] = PageIndex;
        PopulatePager(recordCount, PageIndex);
    }
Beispiel #3
0
    public void fillHospitalGridview()
    {
        HospitalBAL balHospital = new HospitalBAL();
        DataTable   dt          = new DataTable();

        dt = balHospital.SelectAll();

        gvHospital.DataSource = dt;
        gvHospital.DataBind();
    }
Beispiel #4
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;
                }
            }
        }
    }
Beispiel #5
0
        void InitBal()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;

            balBank        = new BloodBankBAL(connectionString);
            balCamp        = new BloodDonationCampBAL(connectionString);
            balDonor       = new BloodDonorBAL(connectionString);
            balDonation    = new BloodDonorDonationBAL(connectionString);
            balInventory   = new BloodInventoryBAL(connectionString);
            balHospital    = new HospitalBAL(connectionString);
            balTransaction = new TransactionBAL(connectionString);
        }
Beispiel #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        #region server side validation
        String strErrorMessage = "";
        Int32  Count           = 0;

        if (txtHospitalName.Text.Trim() == "")
        {
            strErrorMessage += "- Enter Hospital Name <br/>";
        }
        if (txtOverview.Text.Trim() == "")
        {
            strErrorMessage += "- Enter Overview <br/>";
        }
        if (txtAddress.Text.Trim() == "")
        {
            strErrorMessage += "- Enter Address <br/>";
        }
        if (txtEmail.Text.Trim() == "")
        {
            strErrorMessage += "- Enter Email <br/>";
        }
        if (txtMobile.Text.Trim() == "")
        {
            strErrorMessage += "- Enter Mobile <br/>";
        }
        if (ddlCity.SelectedIndex <= 0)
        {
            strErrorMessage += "- Select City <br/>";
        }
        if (ddlSpeciality.SelectedIndex <= 0)
        {
            strErrorMessage += "- Select Speciality <br/>";
        }

        foreach (ListItem item in chlReport.Items)
        {
            if (item.Selected == true)
            {
                Count++;
            }
        }

        if (Count == 0)
        {
            strErrorMessage = strErrorMessage + "- Please select at least one Report. <br/>";
        }

        if (strErrorMessage.Trim() != "")
        {
            lblErrorMessage.Text = strErrorMessage;
            return;
        }
        else
        {
            lblErrorMessage.Text = "";
        }
        #endregion server side validation

        #region Collect Form Data
        HospitalENT entHospital = new HospitalENT();

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

        if (ddlCity.SelectedIndex > 0)
        {
            entHospital.CityID = Convert.ToInt32(ddlCity.SelectedValue.ToString().Trim());
        }
        if (ddlSpeciality.SelectedIndex > 0)
        {
            entHospital.SpecialityID = Convert.ToInt32(ddlSpeciality.SelectedValue.ToString().Trim());
        }

        #endregion Collect Form Data

        HospitalBAL           balHospital           = new HospitalBAL();
        HospitalWiseReportBAL balHospitalWiseReport = new HospitalWiseReportBAL();
        HospitalWiseReportENT entHospitalWiseReport = new HospitalWiseReportENT();

        if (Request.QueryString["HospitalID"] == null)
        {
            if (balHospital.Insert(entHospital))
            {
                entHospitalWiseReport.HospitalID = Convert.ToInt32(entHospital.HospitalID.Value);
                foreach (ListItem item in chlReport.Items)
                {
                    if (item.Selected == true)
                    {
                        entHospitalWiseReport.ReportID = Convert.ToInt32(item.Value.ToString().Trim());
                        if (!balHospitalWiseReport.Insert(entHospitalWiseReport))
                        {
                            lblErrorMessage.Text = balHospitalWiseReport.Message;
                        }
                    }
                }
                foreach (ListItem item in chlReport.Items) // uncheck Image category list
                {
                    if (item.Selected == true)
                    {
                        item.Selected = false;
                    }
                }

                ClientScript.RegisterStartupScript(GetType(), "SweetAlert", "swal({ type: 'success', title: 'Hospital Information inserted Successfully', showConfirmButton: false, timer: 2000});", true);
            }
            else
            {
                lblErrorMessage.Text = balHospital.Message;
            }
        }
        else
        {
            entHospital.HospitalID = Convert.ToInt32(Request.QueryString["HospitalID"]);

            if (balHospital.Update(entHospital))
            {
                if (balHospitalWiseReport.DeleteByHospitalID(Convert.ToInt32(Request.QueryString["HospitalID"])))
                {
                    entHospitalWiseReport.HospitalID = Convert.ToInt32(entHospital.HospitalID.Value);
                    foreach (ListItem item in chlReport.Items)
                    {
                        if (item.Selected == true)
                        {
                            entHospitalWiseReport.ReportID = Convert.ToInt32(item.Value.ToString().Trim());
                            if (!balHospitalWiseReport.Insert(entHospitalWiseReport))
                            {
                                lblErrorMessage.Text = balHospitalWiseReport.Message;
                            }
                        }
                    }
                    foreach (ListItem item in chlReport.Items) // uncheck Image category list
                    {
                        if (item.Selected == true)
                        {
                            item.Selected = false;
                        }
                    }

                    Response.Redirect("~/AdminPanel/Hospital/HospitalList.aspx");
                }
                else
                {
                    lblErrorMessage.Text = balHospitalWiseReport.Message;
                }
            }
            else
            {
                lblErrorMessage.Text = balHospital.Message;
            }
        }
    }
    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;
        }
    }