public Framework.Common.CommonBase.DtoContainer GetAll() { OfficeDtoContainer container = new OfficeDtoContainer(); SdRoleTDataAccess roleDa = new SdRoleTDataAccess(); var roles = roleDa.GetAll().ToList(); container.RoleList.AddRange(roles); return(container); }
public List <SdItRoleExpertDto> GetRoleExperts(int roleId) { OfficeDtoContainer response = roleServiceAdapter.Execute(s => s.GetRoleExperts(roleId)); if (response.Response.HasException) { return(null); } return(response.RoleExperts); }
public List <SdItRoleDto> GetRoles() { OfficeDtoContainer response = (OfficeDtoContainer)roleServiceAdapter.Execute(s => s.GetAll()); if (response.Response.HasException) { return(null); } return(response.RoleList.OrderBy(it => it.Officeid).ToList()); }
public Common.DTOContainer.OfficeDtoContainer GetExpertList() { OfficeDtoContainer container = new OfficeDtoContainer(); ExpertTDataAccess exDa = new ExpertTDataAccess(); var experts = exDa.GetAll(); PersonelTDataAccess pda = new PersonelTDataAccess(); foreach (var item in experts) { item.Personel = pda.GetSingle(it => it.PerId == item.Userid); } container.ExpertList.AddRange(experts); return(container); }
public Common.DTOContainer.OfficeDtoContainer GetRoleExperts(int roleId) { ExpertTDataAccess exDa = new ExpertTDataAccess(); SdRoleTDataAccess da = new SdRoleTDataAccess(); PersonelTDataAccess pDa = new PersonelTDataAccess(); var role = da.GetSingle(it => it.RoleId == roleId); OfficeDtoContainer container = new OfficeDtoContainer(); var dtoList = da.GetSdRoles(roleId); foreach (var dto in dtoList) { dto.Role = role; var expert = exDa.GetSingle(it => it.ItExpertId == dto.Expertid); dto.Expert = expert; var personel = pDa.GetSingle(it => it.PerId == expert.Userid); dto.Personel = personel; } container.RoleExperts.AddRange(dtoList); return(container); }
public OfficeDtoContainer GetDetail(int officeId) { PersonelTDataAccess pda = new PersonelTDataAccess(); OfficeDtoContainer container = new OfficeDtoContainer(); var experts = SdItExpertRepository.GetDtos(this.Repository.Context.SdItExperts.Where(it => it.Officeid == officeId)); var roles = SdItRoleRepository.GetDtos(this.Repository.Context.SdItRoles.Where(it => it.Officeid == officeId)); if (experts != null) { container.ExpertList.AddRange(experts); } if (roles != null) { container.RoleList.AddRange(roles); } foreach (var item in experts) { item.Personel = pda.GetSingle(it => it.PerId == item.Userid); } return(container); }