コード例 #1
0
        public void FillLastInvestigationDataSet(GridViewDataSet <InvestigationDTO> items, UserDTO user)
        {
            using (this.UnitOfWorkProvider.Create())
            {
                var query = (LastInvestidationListQuery)LastInvestidationListQueryFactory();

                query.User = user;
                DotvvmFacadeExtensions.LoadFromQuery(items, query);
            }
        }
コード例 #2
0
        public void FillDataSet(GridViewDataSet <InvestigationDTO> items, InvestigationFilterDTO filter, UserDTO user)
        {
            using (this.UnitOfWorkProvider.Create())
            {
                var query = (InvestidationListQuery)QueryFactory();
                query.Filter = filter;
                query.User   = user;
                DotvvmFacadeExtensions.LoadFromQuery(items, query);

                foreach (var item in items.Items)
                {
                    item.CanEditRemove = (user.Role.Name == "Administrator" || item.OwnerID == user.Id);
                    item.Owner         = AutoMapper.Mapper.Map <User, UserDTO>(this.UserFacade.Repository.GetById(item.OwnerID));
                }
            }
        }