Example #1
0
        protected void btnMedAdd_Click(object sender, System.EventArgs e)
        {
            if (Session["PatientID"] != null)
            {
                Page.Validate("Medications");
                if (Page.IsValid)
                {
                    DataTool dbTool = new DataTool();

                    dbTool.NewMedication(Int32.Parse(Session["PatientID"].ToString()), Medication.Text.ToString().Replace("'", "''"), float.Parse(Dosage.Text), DosageDrop.SelectedValue);
                    // refresh the lists
                    setupGrid();
                    Medication.Text          = "";
                    Dosage.Text              = "";
                    DosageDrop.SelectedIndex = -1;
                }
                else
                {
                    ValidationSummary1.ValidationGroup = "Medications";
                    setupGrid();
                }
            }
            else
            {
                Server.Transfer("SessionTimedOut.aspx");
            }
        } // Done... Tested