private void GetGridview() { DateTime fromDate = DateTime.ParseExact(fromDateTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); DateTime toDate = DateTime.ParseExact(toDateTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); PatientManagersrb aPatientManagersrb = new PatientManagersrb(); List <Patient> patients = aPatientManagersrb.GetallUnpaidPatients(fromDate, toDate); unpaidGridView.DataSource = patients; unpaidGridView.DataBind(); messageLabel.Text = "LIST OF UN PAID PATIENT"; }
protected void searchButton_Click(object sender, EventArgs e) { if (fromDateTextBox.Text == "" || toDateTextBox.Text == "") { messageLabel.Text = "You Have to Select the Dates"; } else { pdfButton.Visible = true; Label2.Visible = true; totalTextBox.Visible = true; DateTime fromDate = DateTime.ParseExact(fromDateTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); DateTime toDate = DateTime.ParseExact(toDateTextBox.Text, "MM/dd/yyyy", CultureInfo.InvariantCulture); PatientManagersrb aPatientManagersrb = new PatientManagersrb(); List <Patient> patients = aPatientManagersrb.GetallUnpaidPatients(fromDate, toDate); unpaidGridView.DataSource = patients; unpaidGridView.DataBind(); double total = Convert.ToDouble(aPatientManagersrb.GetTotalDue(fromDate, toDate)); totalTextBox.Text = total.ToString(); } }