private void ApplyNoteForRows(IList rows, Transactions transactions)
        {
            if (rows.Count == 0)
            {
                return;
            }

            var currentNote = ((Transaction)((OLVListItem)rows[0]).RowObject).Note;
            var newNote     = NoteDialogForm.GetNoteFromUser(currentNote, this);

            if (currentNote == newNote)
            {
                return;
            }

            RefreshItems(rows, txs => transactions.SetNote(txs, newNote).ToVoid());
        }
Exemple #2
0
 public static string GetNoteFromUser(string initial, IWin32Window parentForm)
 {
     using (var dialog = new NoteDialogForm())
     {
         dialog.richTextBoxNote.Text = initial;
         var dialogResult = dialog.ShowDialog(parentForm);
         if (dialogResult == DialogResult.OK)
         {
             if (dialog.IsNoteRemoved)
             {
                 return(null);
             }
             else
             {
                 return(dialog.richTextBoxNote.Text);
             }
         }
         else
         {
             return(initial);
         }
     }
 }