public void SaveNote() { if ((editNote != null) && (rtbNote.Text != "")) { bool isNew = (!editNote.created_on.HasValue); editNote.Note = rtbNote.Text.Trim(); if ((editNote.CallId == 0) && (CurrentCall != null)) { editNote.CallId = CurrentCall.id; } else { editNote.CallId = 0; } if ((editNote.claim_id == 0) && (CurrentClaim != null)) { editNote.claim_id = CurrentClaim.id; } else { editNote.claim_id = 0; } editNote.operatorId = ActiveUser.UserObject.username; if (!editNote.created_on.HasValue) { editNote.created_on = DateTime.Now; } editNote.updated_on = DateTime.Now; ActiveUser.LogAction(ActiveUser.ActionTypes.CreateNote, editNote.claim_id, editNote.CallId, ""); editNote.Save(); if (isNew) { editNote.Note += CreateNoteAdditionalText(editNote); Notes.Insert(0, editNote); } editNote = null; rtbNote.Text = ""; Mode = NotesGridMode.GridView; bsNotes.ResetBindings(false); } else { CancelNote(); } }