Ejemplo n.º 1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            var title = TitleBox.Text;
            var text  = MessegeBox.Text;

            try
            {
                NoteController.SaveNote(title, text);
            }
            catch (ArgumentException exeption)
            {
                MessageBox.Show(exeption.Message, "Error");
            }

            NotesGridView1.DataSource = NoteController.GetBindingSource();

            if (NotesGridView1.DataSource != null)
            {
                NotesGridView1.Columns["Id"].Visible     = false;
                NotesGridView1.Columns["UserId"].Visible = false;
                NotesGridView1.Columns["Text"].Visible   = false;
            }
        }