private void btnInsertTreatment_Click(object sender, RoutedEventArgs e) { DBConnector.Treatment treat = new DBConnector.Treatment("Test", "Developer testing. If this shows up in production, the patient is screwed"); if (connector.Insert(treat)) { labInsertTest.Content = "Treatment Insertion Test Successful! :)"; } else { labInsertTest.Content = "Treatment Insertion Test Unsuccessful! :("; } }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { if ((txtTreatmentTitle.Text != String.Empty && txtTreatmentDescription.Text != String.Empty)) { string treatment = txtTreatmentTitle.Text; string description = txtTreatmentDescription.Text; DBConnector.Treatment newTreatment = new DBConnector.Treatment(treatment, description); MainWindow.Connector.Insert(newTreatment); } else { MessageBox.Show("Please make sure all of the information is filled out. Stop trying to break things. Thank you."); } }