Example #1
0
        private void AddNote_button_Click(object sender, EventArgs e)
        {
            string userEmail = "";

            if (Account != null)
            {
                userEmail = Account.EmailAdress;
            }
            if (NoteInfo_textBox.Text != "")
            {
                try
                {
                    NoteAdministration.AddNote(NoteInfo_textBox.Text, userEmail);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("Please fill  in some information for the note");
            }
        }
 private void RemoveNote_button_Click(object sender, EventArgs e)
 {
     try
     {
         NoteAdministration.RemoveNote(Note);
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void ChangeNote_button_Click(object sender, EventArgs e)
 {
     if (NoteInfo_textBox.Text != "")
     {
         try
         {
             NoteAdministration.ChangeNote(Note, NoteInfo_textBox.Text);
             this.DialogResult = DialogResult.OK;
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
 public NoteForm(Account account, NoteAdministration noteAdministration)
 {
     Account            = account;
     NoteAdministration = noteAdministration;
     InitializeComponent();
 }
 public NoteDetailForm(Note note, NoteAdministration noteAdministration)
 {
     Note = note;
     NoteAdministration = noteAdministration;
     InitializeComponent();
 }