Beispiel #1
0
 public DataModel.Response.FindAllItemReponse <DataModel.Model.PresentationModel> GetPresentation()
 {
     try
     {
         IPresentationRepository preRepository = RepositoryClassFactory.GetInstance().GetPresentationRepository();
         IList <Presentation>    pres          = preRepository.FindAll();
         var _pres = pres.Select(n => MapperUtil.CreateMapper().Mapper.Map <Presentation, PresentationModel>(n)).ToList();
         return(new FindAllItemReponse <PresentationModel>
         {
             Items = _pres,
             ErrorCode = (int)ErrorCode.None,
             Message = string.Empty
         });
     }
     catch (Exception ex)
     {
         return(new FindAllItemReponse <PresentationModel>
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }
Beispiel #2
0
 public DataModel.Response.FindAllItemReponse <DataModel.Model.PresentationModel> GetPresentation(int pageSize, int pageIndex)
 {
     try
     {
         IPresentationRepository preRepository = RepositoryClassFactory.GetInstance().GetPresentationRepository();
         var result = preRepository.FindAll(pageSize, pageIndex);
         var _pre   = result.Item2.Select(n => MapperUtil.CreateMapper().Mapper.Map <Presentation, PresentationModel>(n)).ToList();
         return(new FindAllItemReponse <PresentationModel>
         {
             Count = result.Item1,
             Items = _pre,
             ErrorCode = (int)ErrorCode.None,
             Message = string.Empty
         });
     }
     catch (Exception ex)
     {
         return(new FindAllItemReponse <PresentationModel>
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }