protected void addButton_Click(object sender, EventArgs e)
        {
            TestRequestManager aRequestManager = new TestRequestManager();
            TestRequestClass   aRequestClass   = new TestRequestClass();

            aRequestClass.MobileNo = mobileNoTextBox.Text;
            if (patientNameTextBox.Text == string.Empty || dateTextBox.Text == string.Empty ||
                mobileNoTextBox.Text == string.Empty || feeTextBox.Text == string.Empty)
            {
                messageLabel.Text = "Insert All Values !";
            }
            else
            {
                if (aRequestManager.GetAllInfoByMobileNo(aRequestClass.MobileNo) == true)
                {
                    messageLabel.Text = "This Mobile No Already Exist";
                }
                else
                {
                    messageLabel.Text = string.Empty;
                    TestRequestClass aTestRequestClass = new TestRequestClass();
                    aTestRequestClass.Fee      = Convert.ToDouble(feeTextBox.Text);
                    aTestRequestClass.MobileNo = mobileNoTextBox.Text;
                    TestSetupManger aTestSetupManger = new TestSetupManger();
                    TestClass       adropClass       = aTestSetupManger.GetAllInfoByTestId(selectTestDropDownList.SelectedValue);



                    DataTable dt = (DataTable)ViewState["TestEntry"];
                    dt.Rows.Add(adropClass.Name.Trim(), feeTextBox.Text.Trim());
                    ViewState["TestEntry"] = dt;
                    this.BindGrid();

                    selectTestDropDownList.SelectedValue = null;

                    double i;
                    if (totalTextBox.Text.Length != 0)
                    {
                        i = int.Parse(totalTextBox.Text);
                        i = i + aTestRequestClass.GetFullFee(aTestRequestClass.Fee);
                    }
                    else
                    {
                        i = int.Parse(feeTextBox.Text);
                    }
                    totalTextBox.Text = i.ToString();
                    feeTextBox.Text   = string.Empty;

                    if (aRequestManager.SaveTestGridview(adropClass, aTestRequestClass) > 0)
                    {
                        messageLabel.Text = "Added";
                    }
                    else
                    {
                        messageLabel.Text = "Failed to Insert";
                    }
                }
            }
        }
        protected void selectTestDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            messageLabel.Text = string.Empty;
            TestSetupManger abSetupManger = new TestSetupManger();
            TestClass       adropClass    = abSetupManger.GetAllInfoByTestId(selectTestDropDownList.SelectedValue);

            feeTextBox.Text = adropClass.Fee.ToString();
        }
        public void LoadTestDropDown()
        {
            TestSetupManger  aTestSetupManger = new TestSetupManger();
            List <TestClass> aList            = aTestSetupManger.GetAllTestInfo();

            selectTestDropDownList.DataSource     = aList;
            selectTestDropDownList.DataTextField  = "Name";
            selectTestDropDownList.DataValueField = "Id";
            selectTestDropDownList.DataBind();
        }
        public void LoadTypeNameDropDown()
        {
            TestSetupManger aTestManger = new TestSetupManger();

            if (!IsPostBack)
            {
                TypeSetupManager aTypeManager = new TypeSetupManager();
                List <TypeClass> aList        = aTypeManager.GetAllTypeName();
                testTypeDropDown.DataSource     = aList;
                testTypeDropDown.DataTextField  = "Name";
                testTypeDropDown.DataValueField = "Id";
                testTypeDropDown.DataBind();
                List <ViewTestAndTest_Type> akList = aTestManger.GetAllTestInfoWithType();
                showGridView.DataSource = akList;
                showGridView.DataBind();
            }
        }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            TestSetupManger aTestManger = new TestSetupManger();
            TestClass       aTestClass  = new TestClass();

            aTestClass.Name       = testNameTextBox.Text;
            aTestClass.TypeNameId = Convert.ToInt32(testTypeDropDown.SelectedValue);

            if (testNameTextBox.Text == string.Empty || feeTextBox.Text == string.Empty ||
                testTypeDropDown.Text == string.Empty)
            {
                messageLabel.Text = "Insert Values";
            }
            else
            {
                aTestClass.Fee = Convert.ToDouble(feeTextBox.Text);
                if (aTestManger.GetAllInfoByTestName(aTestClass.Name) != null)
                {
                    messageLabel.Text = "Test Name Already Exist";
                }
                else
                {
                    if (aTestManger.SaveTestInfo(aTestClass) > 0)
                    {
                        messageLabel.Text    = "Insert Info Successfully";
                        testNameTextBox.Text = string.Empty;
                        feeTextBox.Text      = string.Empty;
                    }
                    else
                    {
                        messageLabel.Text = "Insert Failed !";
                    }
                    List <ViewTestAndTest_Type> akList = aTestManger.GetAllTestInfoWithType();
                    showGridView.DataSource = akList;
                    showGridView.DataBind();
                }
            }
        }