protected void Page_Load(object sender, EventArgs e)
    {
        /*Data loading for the Labels*/
        try
        {
            PatientClass pc = new PatientClass();

            String    selectedRow_Username = Session["selectedRow_Username"].ToString();
            DataTable dt = pc.patientDetails_ForDoctor(selectedRow_Username);
            if (dt.Rows.Count > 0)
            {
                Session["selected_Username"] = dt.Rows[0]["Username"].ToString();
                Session["selected_Name"]     = dt.Rows[0]["Name"].ToString();
                Session["selected_Dob"]      = dt.Rows[0]["Dob"].ToString();
                Session["selected_AgeGrp"]   = dt.Rows[0]["AgeGrp"].ToString();
                Session["selected_Sex"]      = dt.Rows[0]["Sex"].ToString();

                ltrMessage1.Text  = "";
                lbl_Username.Text = Session["selected_Username"].ToString();
                lbl_Name.Text     = Session["selected_Name"].ToString();
                lbl_Dob.Text      = Session["selected_Dob"].ToString();
                lbl_AgeGrp.Text   = Session["selected_AgeGrp"].ToString();
                lbl_Gender.Text   = Session["selected_Sex"].ToString();
            }
            else
            {
                ltrMessage1.Text = "No data found!";
            }
        }
        catch (Exception ex)
        {
            ltrMessage1.Text = ex.Message;
        }

        /*Data loading for the Gridview1*/
        try
        {
            PatientClass pc = new PatientClass();

            String    selectedRow_Username = Session["selectedRow_Username"].ToString();
            DataTable dt = pc.checkUpHistory(selectedRow_Username);
            if (dt.Rows.Count > 0)
            {
                ltrMessage.Text = "";

                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
            else
            {
                GridView1.DataSource = dt;
                GridView1.DataBind();
                ltrMessage.Text = "No any checkup history before!";
            }
        }
        catch (Exception ex)
        {
            ltrMessage.Text = ex.Message;
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*Data loading for the DataList1*/
        try
        {
            PatientClass pc = new PatientClass();

            String    username = Session["username"].ToString();
            DataTable dt       = pc.checkUpHistory(username);
            if (dt.Rows.Count > 0)
            {
                ltrMessage.Text = "";

                DataList1.DataSource = dt;
                DataList1.DataBind();
            }
            else
            {
                DataList1.DataSource = dt;
                DataList1.DataBind();
                ltrMessage.Text = "No any data before!";
            }
        }

        catch (Exception ex)
        {
            ltrMessage.Text = ex.Message;
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            try
            {
                GlobalConnection gc = new GlobalConnection();
                PatientClass     pc = new PatientClass();

                String    username = Session["username"].ToString();
                DataTable dt       = pc.checkUpHistory(username);
                if (dt.Rows.Count > 0)
                {
                    ltrMessage.Text = "";

                    ReportViewer1.Reset();

                    // OR Set Report Path
                    ReportViewer1.LocalReport.ReportPath = HttpContext.Current.Server.MapPath("Report_PatientMaster.rdlc");

                    // Clear the Data Source
                    ReportViewer1.LocalReport.DataSources.Clear();

                    // Set a DataSource to the report
                    ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt));
                    ReportViewer1.DataBind();

                    // Refresh and Display Report
                    ReportViewer1.LocalReport.Refresh();
                }
                else
                {
                    ltrMessage.Text = "No data found!";
                    ReportViewer1.Reset();
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.DataBind();
                    ReportViewer1.LocalReport.Refresh();
                }
            }
            catch (Exception ex)
            {
                ltrMessage.Text = ex.Message;
            }
        }
    }