예제 #1
0
        private void toolStripButtonNewNote_Click(object sender, EventArgs e)
        {
            // Create a new, blank note form and display it.
            FormNote formNote = new FormNote(this);

            formNote.Show();
        }
예제 #2
0
        // Method for selecting and loading an existing note for
        // view or editing.
        private void GetSelectedNote(DataRowView row)
        {
            // Cancel method if blank space is selected.
            if (row == null)
            {
                return;
            }

            // Create note object from selected row.
            CampaignNote note = new CampaignNote();

            note.Id         = row.Row.Field <int>("Id");
            note.CampaignId = row.Row.Field <int>("CampaignId");
            note.Title      = row.Row.Field <string>("Title");
            note.Type       = row.Row.Field <string>("Type");
            note.DateAdded  = row.Row.Field <DateTime>("DateAdded").ToString();
            note.Note       = row.Row.Field <string>("Note");

            // Create a monster form with loaded data and display it.
            FormNote formNote = new FormNote(this, note);

            formNote.Show();
        }