Exemple #1
0
 public PageInfo <ViewSystemAction> GetPageList(PageInfo <ViewSystemAction> pageInfo, ViewSystemAction oSearchEntity = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     if (!string.IsNullOrWhiteSpace(oSearchEntity.ScontrollerName))
     {
         SystemController entitySystemController = _systemControllerService.Select(new SystemController()
         {
             ScontrollerName = oSearchEntity.ScontrollerName
         });
         if (entitySystemController != null)
         {
             oSearchEntity.IcontrollerId = entitySystemController.Id;
             pageInfo = _mapper.Map <PageInfo <ViewSystemAction> >(_systemActionRepository.GetPageList(_mapper.Map <PageInfo <SystemAction> >(pageInfo), _mapper.Map <SystemAction>(oSearchEntity), sOperator, iOrderGroup, sSortName, sSortOrder));
         }
     }
     else
     {
         pageInfo = _mapper.Map <PageInfo <ViewSystemAction> >(_systemActionRepository.GetPageList(_mapper.Map <PageInfo <SystemAction> >(pageInfo), _mapper.Map <SystemAction>(oSearchEntity), sOperator, iOrderGroup, sSortName, sSortOrder));
     }
     if (pageInfo.data?.Count > 0)
     {
         foreach (var entity in pageInfo.data)
         {
             SystemController entitySystemController = _systemControllerService.Select(entity.IcontrollerId);
             if (entitySystemController != null)
             {
                 entity.ScontrollerName = entitySystemController.ScontrollerName;
                 entity.SactionName     = "/" + entitySystemController.ScontrollerName + "/" + entity.SactionName + "?iMethodId=" + entity.Id;
             }
         }
     }
     return(pageInfo);
 }