Beispiel #1
0
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            progressNoteBindingSource.EndEdit();
            CurrentProgressNote = progressNoteBindingSource.DataSource as ProgressNoteInformation;

            if (CurrentProgressNote != null && CurrentProgressNote.TimeEnded < CurrentProgressNote.TimeStarted)
            {
                MessageBox.Show("Please check the session times.  The end time should not be prior to the start time.",
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (EditMode)
            {
                CurrentProgressNote?.Update();
            }
            else
            {
                // Save the progress note
                CurrentProgressNote?.Insert();
            }

            // Close the screen
            DialogResult = DialogResult.OK;
        }
Beispiel #2
0
 private void ButtonDeleteNote_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(
             "Are you sure you would like to delete this note?  Once confirmed, the process cannot be undone.",
             "Confirm", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
     {
         CurrentProgressNote.Delete();
         DialogResult = DialogResult.Abort;
     }
 }