Ejemplo n.º 1
0
        // Find and bind search results to grid view
        protected void SearchClick(object sender, EventArgs e)
        {
            List <Patient> patients     = PatientUtility.GetPatients();
            List <Patient> searchReturn = new List <Patient>();

            // Hide result not found error message
            NotFoundError.Visible = false;

            // Check input name against list of patients
            foreach (Patient patient in patients)
            {
                if (patient.name.ToString().Contains(Search.Text))
                {
                    searchReturn.Add(patient);
                }
            }

            // Bind to grid view if any result found
            if (searchReturn.Any())
            {
                PatientGridView.DataSource = searchReturn;
                PatientGridView.DataBind();
            }
            // Show error message if no results found
            else
            {
                NotFoundError.Visible = true;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Hide database error on page load
            DataBaseError.Visible = false;

            // Enable submit button on page load
            SubmitButton.Enabled = true;

            // Redirect to login if not logged in
            if (Session[Global.user] == null)
            {
                Response.Redirect("Login.aspx");
            }

            // If logged in attempt to pull data from database
            try
            {
                // Bind patient data to gridview
                List <Patient> patients = PatientUtility.GetPatients();
                PatientGridView.DataSource = patients;
                PatientGridView.DataBind();
            }
            // If exception caught show database error and
            // disable submit button
            catch (Exception)
            {
                DataBaseError.Visible = true;
                SubmitButton.Enabled  = false;
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["PatientData"] != null)
         {
             DataTable patientData = Session["PatientData"] as DataTable;
             PatientGridView.DataSource = patientData;
             PatientGridView.DataBind();
         }
     }
 }
Ejemplo n.º 4
0
 public void ExeBindBorrow(DataTable data)
 {
     if (data != null)
     {
         PatientGridView.DataSource = data;
         PatientGridView.DataBind();
         lblMsg.Visible = false;
         Session["BorrowDetailData"] = new DataTable();
         Session["BorrowDetailData"] = data;
     }
     else
     {
         lblMsg.Visible = true;
     }
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["BorrowDetailData"] != null)
         {
             DataTable data = Session["BorrowDetailData"] as DataTable;
             PatientGridView.DataSource = data;
             PatientGridView.DataBind();
             lblApplyName.Text = data.Rows[0]["APPLYER_NAME"].ToString();
             lblApplyDate.Text = data.Rows[0]["APPLY_DATE"].ToString();
             lblListNO.Text    = data.Rows[0]["BORROW_LIST_NO"].ToString();
             lblReason.Text    = data.Rows[0]["APPLY_REASON"].ToString();
         }
     }
 }
Ejemplo n.º 6
0
 public void ExeBindPatient(DataTable data)
 {
     PatientGridView.DataSource = data;
     PatientGridView.DataBind();
 }