Ejemplo n.º 1
0
 public static List <PageSectionVM> GetAllPages()
 {
     try
     {
         var data = new ProfileDataAccess().GetAllPages();
         if (data != null)
         {
             return(data.Select(e => new PageSectionVM
             {
                 ID = e.ID,
                 Title = e.Title,
                 SectionID = e.SectionID,
                 SequenceNo = e.SequenceNo,
                 IsActive = e.IsActive,
                 URL = e.URL,
                 SectionTitle = new ProfileDataAccess().GetSectionName(int.Parse(e.SectionID.ToString()))
             }).ToList());
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 public static List <ProfileUserVM> GetProfileUsers(int UserID)
 {
     try
     {
         var data = new ProfileDataAccess().GetUserProfiles(UserID);
         if (data != null)
         {
             return(data.Select(e => new ProfileUserVM
             {
                 ID = e.ID,
                 ProfileID = e.ProfileID,
                 UserID = e.UserID,
                 ProfileTitle = new ProfileDataAccess().GetProfileById(int.Parse(e.ProfileID.ToString())).Title
             }).ToList());
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }