Exemplo n.º 1
0
        public CompletedApplicationScreening GenerateCompletedBusinessScreening(string incidentId)
        {
            string[] expand = { "customerid_account" };
            string[] select = { "customerid_account", "incidentid", "spice_applicationstatus" };
            MicrosoftDynamicsCRMincident incident = _dynamicsClient.Incidents.GetByKey(incidentId, expand: expand, select: select);

            SpiceApplicationStatus application = (SpiceApplicationStatus)incident.SpiceApplicationstatus;


            CompletedApplicationScreening screening = new CompletedApplicationScreening()
            {
                RecordIdentifier = incident.CustomeridAccount.SpiceLcrbjobid,
                Result           = SpiceApplicationStatusMapper.MapToCarlaApplicationResult((SpiceApplicationStatus)incident.SpiceApplicationstatus).ToString(),
                Associates       = new List <Associate>()
            };

            string filter = $"_parentcaseid_value eq {incident.Incidentid}";

            string[] associateExpand       = { "customerid_contact" };
            string[] associateSelect       = { "customerid_contact", "incidentid" };
            IncidentsGetResponseModel resp = _dynamicsClient.Incidents.Get(filter: filter, expand: associateExpand, select: associateSelect);

            foreach (var associate in resp.Value)
            {
                screening.Associates.Add(new Associate()
                {
                    SpdJobId   = associate.CustomeridContact.Contactid,
                    LastName   = associate.CustomeridContact.Lastname,
                    FirstName  = associate.CustomeridContact.Firstname,
                    MiddleName = associate.CustomeridContact.Middlename
                });
            }

            return(screening);
        }
Exemplo n.º 2
0
        public static CarlaWorkerSecurityStatus MapToCarlaWorkerResult(SpiceApplicationStatus status)
        {
            switch (status)
            {
            case SpiceApplicationStatus.Cleared:
                return(CarlaWorkerSecurityStatus.Pass);

            case SpiceApplicationStatus.NotCleared:
                return(CarlaWorkerSecurityStatus.Fail);

            case SpiceApplicationStatus.Withdrawn:
                return(CarlaWorkerSecurityStatus.Withdrawn);
            }
            return(CarlaWorkerSecurityStatus.Unknown);
        }
Exemplo n.º 3
0
        public static CarlaBusinessSecurityStatus MapToCarlaApplicationResult(SpiceApplicationStatus status)
        {
            switch (status)
            {
            case SpiceApplicationStatus.FitAndProper:
                return(CarlaBusinessSecurityStatus.Passed);

            case SpiceApplicationStatus.NotFitAndProper:
                return(CarlaBusinessSecurityStatus.Failed);

            case SpiceApplicationStatus.Withdrawn:
                return(CarlaBusinessSecurityStatus.Withdrawn);
            }
            return(CarlaBusinessSecurityStatus.Unknown);
        }