private void button9_Click(object sender, EventArgs e) { conn.Open(); MySqlCommand mysqlcommand = conn.CreateCommand(); string searchQuery = "SELECT * FROM patient where patientId='" + paymentID.Text + "'"; mysqlcommand.CommandText = searchQuery; MySqlDataReader reader = mysqlcommand.ExecuteReader(); while (reader.Read()) { firstNamePayment.Text = reader["fname"].ToString(); lastNamePayment.Text = reader["lname"].ToString(); } reader.Close(); mysqlcommand.CommandText = "Select * from sale where patientId='" + paymentID.Text + "'"; MySqlDataReader reader1 = mysqlcommand.ExecuteReader(); while (reader1.Read()) { owingAmount.Text = reader1["balance"].ToString(); } reader.Close(); string queryToday = "sale inner join patient on sale.patientId=patient.patientId " + "where sale.patientId='" + paymentID.Text + "'"; Crud inventory = new Crud(); inventory.createTable(queryToday, balanceDataView); conn.Close(); }
private void searchAppointment_Click(object sender, EventArgs e) { string querySearch = "appointment inner join patient on appointment.patientId=patient.patientId " + "where visitingDate='" + searchedDate.Text + "'"; Crud schedule = new Crud(); schedule.createTable(querySearch, searchResultsDataGrid); }
private void button3_Click(object sender, EventArgs e) { panelChanger(inventoryPanel); Crud inventory = new Crud(); inventory.createTable("glasses", inventoryDataGrid); }
private void button4_Click_1(object sender, EventArgs e) { panelChanger(viewUsersPanel); Crud inventory = new Crud(); inventory.createTable("employee", usersDataGrid); }
private void salesButton_Click(object sender, EventArgs e) { panelChanger(viewSalesPanel); string querySales = "sale inner join patient on sale.patientId=patient.patientId"; Crud sales = new Crud(); sales.createTable(querySales, salesDataGrid); }
private void button10_Click(object sender, EventArgs e) { DateTime date = DateTime.Now; string formatDate = string.Format("{0:D}", date); string queryToday = "appointment inner join patient on appointment.patientId=patient.patientId " + "where appointment.patientId='" + visitingPayment.Text + "'"; Crud inventory = new Crud(); inventory.createTable(queryToday, appointmentGrid); }
private void button3_Click(object sender, EventArgs e) { panelChanger(viewAppointment); //get time from system DateTime date = DateTime.Now; string formatDate = string.Format("{0:D}", date); string queryToday = "appointment inner join patient on appointment.patientId=patient.patientId " + "where visitingDate='" + formatDate + "'"; Crud schedule = new Crud(); schedule.createTable(queryToday, currentAppointments); }