Example #1
0
 public IList <NotesModel> GetNotesById(string userId, NoteTypeEnum noteType)
 {
     try
     {
         ////check the user id and note type is not null
         ///noteType is for isNote=0, isTrash = 1, isArchive=2
         if (!userId.Equals(null) && !noteType.Equals(null))
         {
             ////BusinessLayer method call
             var result = this._businessManager.GetNotesById(userId, noteType);
             ////check
             if (!result.Equals(null))
             {
                 ////return the all notes.
                 return(result);
             }
             else
             {
                 ////throw the exception
                 throw new Exception("The data was not fetched successfuly");
             }
         }
         else
         {
             ////throw the exception
             throw new Exception("user id or note type are invalid");
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 /// <summary>
 /// Gets the type of the notes.
 /// </summary>
 /// <param name="NoteType">The notes model.</param>
 /// <returns>return result.</returns>
 public IList <NotesModel> GetNoteType(NoteTypeEnum NoteType)
 {
     try
     {
         if (!NoteType.Equals(null))
         {
             ////repositoryManager Layer method call
             var result = this.repositoryManager.GetNoteType(NoteType);
             return(result);
         }
         else
         {
             throw new Exception();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }