Example #1
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            object[] arr = new object[dataGridView1.Columns.Count];
            dataGridView1.Columns.CopyTo(arr, 0);
            String x = arr[0].ToString();

            x = x.Substring(33, x.IndexOf(',') - 33);
            switch (x)
            {
            case "Note ID":

                noteString          = user.openNote(this.note_id);
                richTextBox1.Text   = noteString.ElementAt(6);
                dataGridView1.Width = 447;
                richTextBox1.Show();
                buttonModify.Show();
                buttonSave.Show();
                buttonClose.Show();
                CreateYourNote.Show();
                break;

            case "Course ID":
                DataTable notes = user.getNotesByCourse(this.course_id);
                dataGridView1.DataSource = notes;
                dataGridView1.Refresh();
                break;
            }
        }
Example #2
0
 private void btnAddNew_Click(object sender, EventArgs e)
 {
     dataGridView1.Width = 447;
     richTextBox1.Show();
     buttonModify.Show();
     buttonSave.Show();
     buttonClose.Show();
     CreateYourNote.Show();
 }
Example #3
0
        private void buttonClose_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure?", "Close Note", MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
            }
            else if (result == DialogResult.Yes)
            {
                dataGridView1.Width = 873;
                richTextBox1.Hide();
                buttonModify.Hide();
                buttonSave.Hide();
                buttonClose.Hide();
                CreateYourNote.Hide();
                richTextBox1.Clear();
            }
        }