private void LoadResultGridview() { DateTime fromdate = DateTime.ParseExact(fromTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); DateTime toDate = DateTime.ParseExact(toTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); TestManagersrb _aTestManagersrb = new TestManagersrb(); List <Testsearch> allTests = _aTestManagersrb.SearchallTest(fromdate, toDate); resultGridView.DataSource = allTests; resultGridView.DataBind(); messageLabel.Text = "Test wise Report FROM " + fromTextBox.Text + " TO" + toTextBox.Text + ""; }
protected void searchButton_Click(object sender, EventArgs e) { if (fromTextBox.Text == "" || toTextBox.Text == "") { messageLabel.Text = "You Have To Select The Dates"; } else { totalTextBox.Visible = true; pdfButton.Visible = true; totalLabel.Visible = true; DateTime fromdate = DateTime.ParseExact(fromTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); DateTime toDate = DateTime.ParseExact(toTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); TestManagersrb _aTestManagersrb = new TestManagersrb(); List <Testsearch> allTests = _aTestManagersrb.SearchallTest(fromdate, toDate); resultGridView.DataSource = allTests; resultGridView.DataBind(); totalTextBox.Text = _aTestManagersrb.GetTotalinStory5(fromdate, toDate).ToString(); } }