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.SearchallTestType(fromdate, toDate); resultGridView.DataSource = allTests; resultGridView.DataBind(); messageLabel.Text = "TYPE 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 input 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.SearchallTestType(fromdate, toDate); resultGridView.DataSource = allTests; resultGridView.DataBind(); totalTextBox.Text = _aTestManagersrb.GetTotalinStory6(fromdate, toDate).ToString(); } }