Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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.
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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;
            }
        }
Esempio n. 7
0
 public int CreateOrg(SecOrg secOrg)
 {
     context.SecOrg.Add(secOrg);
     context.SaveChanges();
     return(secOrg.OrgId);
 }
Esempio n. 8
0
        public Organization RetrieveOrganization(int organizationId)
        {
            SecOrg secOrganization = _repository.RetrieveSecOrganization(organizationId);

            return(new Organization(secOrganization));
        }
Esempio n. 9
0
 public int UpdateOrganization(SecOrg secOrg)
 {
     _context.SecOrg.Update(secOrg);
     return(_context.SaveChanges());
 }
Esempio n. 10
0
 public int CreateOrganization(SecOrg secOrg)
 {
     _context.SecOrg.Add(secOrg);
     _context.SaveChanges();
     return(secOrg.OrgId);
 }