private void buttonAdminQuery_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(this.textBoxAdminQuery.Text)) { MessageBox.Show("Please enter a query"); } else { var query = this.textBoxAdminQuery.Text; var result = AdminPanelQueries.ExecuteCustomQuery(query); this.dataGridView.DataSource = result; } }
private void buttonSearchAppointmentsBetween_Click(object sender, EventArgs e) { var dateTimeStart = this.dateTimePickerStartDate.Value; var dateTimeEnd = this.dateTimePickerEndDate.Value; DataTable results = AdminPanelQueries.GenerateReport(dateTimeStart, dateTimeEnd); this.listViewAppointmentsBetween.Items.Clear(); foreach (DataRow resultRow in results.Rows) { ListViewItem row = new ListViewItem(new[] { (resultRow["visit_datetime"]).ToString(), (resultRow["patient_id"]).ToString(), (resultRow["patient_name"]).ToString(), (resultRow["doctor_name"]).ToString(), (resultRow["nurse_name"]).ToString(), (resultRow["diagnoses"]).ToString() }); this.listViewAppointmentsBetween.Items.Add(row); } }