public ViewElementRoleService(IDbContextBase dbContextBase, IUserRoleService userRoleService, IUserService userService, ICompanyChartRoleService companyChartRoleService)//,IViewElementService viewElementService) : base(dbContextBase) { _repositoryBase = new ViewElementRoleRepository(ContextBase); UserService = userService; UserRoleService = userRoleService; CompanyChartRoleService = companyChartRoleService; //_viewElementService = viewElementService; }
public int Create(List <int> inseretedCompanyViewElement, List <int> deletedCompanyViewElement, int companyId, bool allowSaveChange = true) { var viewlementCompany = (_repositoryBase as CompanyViewElementRepository).Create(inseretedCompanyViewElement, deletedCompanyViewElement, companyId, allowSaveChange); var viewElementRoleRepo = new ViewElementRoleRepository(_dbcontcontext); var _companyService = new CompanyService(_dbcontcontext); var foundedCMP = _companyService.Find(companyId); var CompanyRole = foundedCMP.CompanyRoles.FirstOrDefault(); viewElementRoleRepo.Create(inseretedCompanyViewElement, deletedCompanyViewElement, CompanyRole.RoleId, true); return(viewlementCompany); }