/// <summary>
 /// Pulling data from database for FilesFormModel
 /// </summary>
 /// <param UserClass="user"></param>
 /// <param DatabaseContext="context"></param>
 /// <returns>Two list of related information</returns>
 public static FilesData GetFilesForm(CachedUser user, EntityContext context)
 {
     if (user == null)
     {
         return(new FilesData());
     }
     return(new FilesData()
     {
         FileNumbers = ByUser.GetFileNumber(user, context).ToList()
     });
 }
        /// <summary>
        /// Pulling data from database for FamiliesFormModel
        /// </summary>
        /// <param UserClass="user"></param>
        /// <param DatabaseContext="context"></param>
        /// <returns>family with FileNumbers related to that family</returns>
        public static List <FamiliesDataItem> GetFamiliesForm(CachedUser user, EntityContext context)
        {
            if (user == null)
            {
                return(new List <FamiliesDataItem>());
            }
            var families = ByUser.GetFamilies(user, context);

            return(families.Select(p => new FamiliesDataItem
            {
                Family = p,
                FileNumbers = p.Family_Listings.Select(q => q.File_Numbers).ToList()
            }).ToList());
        }
        /// <summary>
        /// Pulling data from database for RecentActivitiesModel
        /// </summary>
        /// <param UserClass="user"></param>
        /// <param DatabaseContext="context"></param>
        /// <returns>Three list of related information</returns>
        public static List <RecentActivitesDataItem> GetRecentActivites(CachedUser user, EntityContext context)
        {
            if (user == null)
            {
                return(new List <RecentActivitesDataItem>());
            }
            // finds it project number has a investigator that is the same as the CachedUser
            var fileNumbers = ByUser.GetFileNumber(user, context);

            return(fileNumbers.Select(p =>
                                      new RecentActivitesDataItem()
            {
                FileNumber = p,
                Transactions = p.Transactions.ToList()
            }
                                      ).ToList());
        }