public void ModifyManager(CompanyManager manager, CompanyRights rights) { if (rights.HaveAnyRights == false) { companyManagerRepository.Remove(manager); } rights.FillEntity(ref manager); ConditionalSaveChanges(companyManagerRepository); }
public void AddManager(Company company, Citizen citizen, CompanyRights rights) { CompanyManager manager = new CompanyManager() { EntityID = citizen.ID, CompanyID = company.ID, }; var companyLink = EntityLinkCreator.Create(company.Entity); var msg = $"From this day on you are new manager of {companyLink}"; using (NoSaveChanges) warningService.AddWarning(citizen.ID, msg); rights.FillEntity(ref manager); companyManagerRepository.Add(manager); ConditionalSaveChanges(companyManagerRepository); }