Exemple #1
0
    /// <summary>
    /// Edits the specified notes item.
    /// </summary>
    /// <param name="notesItem">The notes item.</param>
    public bool Edit(Notes notesItem){
      bool status             = false;
      int index               = FindNotesIndex(notesItem.GUID);

      if (index != -1) {
        Persistence.Persist.Data.NotesList[index]      = notesItem;
        Persist();
        status                              = true;
      }

      return status;
    }
Exemple #2
0
    /// <summary>
    /// Gets the name of the note. (Subject to Options settings)
    /// </summary>
    /// <param name="noteItem">The note item.</param>
    /// <returns></returns>
    public string GetNoteDisplayName(Notes noteItem){
      string result       = string.Empty;

      if (noteItem.Note.Length > 30) {
        result            = noteItem.Note.Substring(0, 30) + "...";
      } else {
        result            = noteItem.Note.Substring(0, noteItem.Note.Length);
      }

      int enterKey        = result.IndexOf("\n");
      if (enterKey != -1) {
        result            = result.Substring(0, enterKey);
      }

      if (Settings.Default.Note_AddDateToName) {
        result            = noteItem.Date.ToShortDateString() + "     " + result;
      }
      return result;
    }
Exemple #3
0
 /// <summary>
 /// Adds the specified notes item.
 /// </summary>
 /// <param name="notesItem">The notes item.</param>
 public void Add(Notes notesItem){
   Persistence.Persist.Data.NotesList.Add(notesItem);
   Persist();
 }
Exemple #4
0
    /// <summary>
    /// Gets the note. (Subject to Options settings)
    /// </summary>
    /// <param name="noteItem">The note item.</param>
    /// <returns></returns>
    public string GetNote(Notes noteItem){
      string result       = string.Empty;

      result              = Utilities.CleanMultiLines(noteItem.Note);
        if (Settings.Default.Note_AppendDateToNote) {
          result          += "\r\n\r\n\r\n-----------------------------------\r\n" + noteItem.Date;
        }
      return result;
    }
 /// <summary>
 /// Clears the time sheet object.
 /// </summary>
 private void ClearNotesObject(){
   _notesItem = null;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="frmTimeSheetItem"/> class.
 /// </summary>
 /// <param name="timeSheet">The time sheet.</param>
 public NotesItemForm(ref Notes notes) {
   InitializeComponent();
   _notesItem            = notes;
   SetUpNotesItemForm();
 }
Exemple #7
0
      /// <summary>
      /// Adds the notes item.
      /// </summary>
      private void AddNotesItem(){
        try {
          if (tbcMain.SelectedTab != tbNotes) {
            tbcMain.SelectedTab = tbNotes;
          }

          Notes noteItem          = new Notes();
          NotesItemForm frm       = new NotesItemForm(ref noteItem);
          frm.ShowDialog();

          if (noteItem.GUID != "") {
            _noteControl.Add(noteItem);
            PopulateNotes();
          }

        } catch (Exception ex) {
          Utilities.ShowErrorMessage("Error Adding Note!", ex);
        }
      }