private void btnAddCase_Click(object sender, RoutedEventArgs e) { if (txtCaseNumber.Text.Trim() == "" || txtCaseNumber.Text == SqliteDataAcces.CaseNumberPrefix) { MessageBox.Show("Please enter a case number"); } else if (cmbService.Text == "") { MessageBox.Show("Please choose a service"); } else if (cmbAuthor.Text == "") { MessageBox.Show("Please choose an author"); } else { CaselyUserData pc = new CaselyUserData(); pc.CaseNumber = txtCaseNumber.Text; pc.Service = cmbService.Text; CaseEntry ce = new CaseEntry(); DateTime currentTime = DateTime.Now; ce.AuthorID = cmbAuthor.Text; ce.CaseNumber = txtCaseNumber.Text; ce.Interpretation = txtInterpretation.Text; ce.Result = txtResultEntry.Text; ce.Comment = txtComment.Text; ce.TumorSynoptic = txtTumorSynoptic.Text; ce.DateModifiedString = dtCreated.Value.GetValueOrDefault().ToString("yyyy-MM-dd"); ce.TimeModifiedString = dtCreated.Value.GetValueOrDefault().ToString("HH:mm:ss"); SqliteDataAcces.InsertNewCaseEntry(ce, pc); txtInterpretation.Text = ""; txtComment.Text = ""; txtResultEntry.Text = ""; txtTumorSynoptic.Text = ""; txtCaseNumber.Text = SqliteDataAcces.CaseNumberPrefix; MessageBox.Show("Case Added"); dtCreated.Value = DateTime.Now; } }