public void FillLastInvestigationDataSet(GridViewDataSet <InvestigationDTO> items, UserDTO user) { using (this.UnitOfWorkProvider.Create()) { var query = (LastInvestidationListQuery)LastInvestidationListQueryFactory(); query.User = user; DotvvmFacadeExtensions.LoadFromQuery(items, query); } }
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)); } } }