private void AddNote(object sender, EventArgs e)
		{
			if (_currentOrder != null && !string.IsNullOrWhiteSpace (NewNoteField.StringValue)) 
			{
				var note = new Note 
				{
					WorkOrderId = _currentOrder.WorkOrderId,
					Author = User.CurrentUser,
					Added = DateTime.Now,
					Content = NewNoteField.StringValue
				};

				_db.Notes.Add (note);
				_db.SaveChanges ();

				((NoteViewSource)NoteTable.Source).AddNote (note);
				NoteTable.ReloadData ();

				NewNoteField.StringValue = string.Empty;
			}
		}
Esempio n. 2
0
		public void AddNote(Note note)
		{
			_notes.Add (note);
		}