public int DeactivateOrganization(int organizationId, User user) { SecOrg secOrganization = _repository.RetrieveSecOrganization(organizationId); secOrganization.DeletedAt = DateTime.Now; this.LogTransaction(secOrganization, SecurityLogTypeEnum.ORG_DEACTIVATED, user); return(_repository.UpdateOrganization(secOrganization)); }
public int UpdateOrganization(int orgId, int?parentOrgId, string orgLabel, User user) { SecOrg secOrganization = _repository.RetrieveSecOrganization(orgId); secOrganization.ParentOrgId = parentOrgId; secOrganization.OrgLabel = orgLabel; secOrganization.UpdatedAt = DateTime.Now; this.LogTransaction(secOrganization, SecurityLogTypeEnum.ORG_UPDATED, user); return(_repository.UpdateOrganization(secOrganization)); }
private void LogTransaction(SecOrg secOrg, string securityLogTypeEnum, User user) { Organization organization = new Organization { OrgId = secOrg.OrgId, OrgCode = secOrg.OrgCode, OrgLabel = secOrg.OrgLabel }; _securityLogService.EntityUpdatedOrCreated(securityLogTypeEnum, organization, user); }
public Organization(SecOrg organization) { this.OrgId = organization.OrgId; this.ParentOrgId = organization.ParentOrgId; this.OrgCode = organization.OrgCode; this.OrgLabel = organization.OrgLabel; this.CreatedAt = organization.CreatedAt; this.UpdatedAt = organization.UpdatedAt; this.DeletedAt = organization.DeletedAt; this.OrgTypeId = organization.OrgtypeId; // this.POI = organization.QmsPersonnelOfficeIdentifier. }
public int CreateOrganization(Organization newOrg, User user) { SecOrg secOrganization = new SecOrg() { OrgCode = newOrg.OrgCode, OrgLabel = newOrg.OrgLabel, ParentOrgId = newOrg.ParentOrgId, CreatedAt = DateTime.Now }; int orgId = _repository.CreateOrganization(secOrganization); this.LogTransaction(secOrganization, SecurityLogTypeEnum.ORG_CREATED, user); return(orgId); }
private void SubmitForResolution() { SecOrg PPRB = getOrg(RBCCode); SecOrg PPRM = getOrg(PPRMCode); int currentOrgId = entity.AssignedToOrgId.HasValue ? entity.AssignedToOrgId.Value : submitter.OrgId.Value; bool isAtPPRB = (currentOrgId == PPRB.OrgId); Employee emp = new EmployeeService().RetrieveById(entity.EmplId); entity.AssignedToUserId = null; entity.AssignedAt = null; entity.AssignedByUserId = null; entity.StatusId = referenceRepository.GetStatus(StatusType.UNASSIGNED).StatusId; if (routesToRBC && !isAtPPRB && emp.PersonnelOfficeIdentifier != "4008")//Don't send CABS employees to BRC per Jamie Hamlin { entity.AssignedToOrgId = PPRB.OrgId; } else { entity.AssignedToOrgId = PPRM.OrgId; } }
public int CreateOrg(SecOrg secOrg) { context.SecOrg.Add(secOrg); context.SaveChanges(); return(secOrg.OrgId); }
public Organization RetrieveOrganization(int organizationId) { SecOrg secOrganization = _repository.RetrieveSecOrganization(organizationId); return(new Organization(secOrganization)); }
public int UpdateOrganization(SecOrg secOrg) { _context.SecOrg.Update(secOrg); return(_context.SaveChanges()); }
public int CreateOrganization(SecOrg secOrg) { _context.SecOrg.Add(secOrg); _context.SaveChanges(); return(secOrg.OrgId); }