示例#1
0
        private static void MapProcessProfiles(ThisEntity input, ref MCD.AssessmentDetail output)
        {
            if (input.ProcessProfilesSummary != null && input.ProcessProfilesSummary.Any())
            {
                var url = string.Format("detail/ProcessProfile/{0}/", input.RowId.ToString());
                output.ProcessProfiles = new List <AJAXSettings>();
                foreach (var item in input.ProcessProfilesSummary)
                {
                    var ajax = new AJAXSettings()
                    {
                        Label       = item.Name,
                        Description = "",
                        Total       = item.Totals,
                        URL         = externalFinderSiteURL + url + item.Id.ToString(),
                        TestURL     = ServiceHelper.finderApiSiteURL + url + item.Id.ToString(),
                    };
                    //not sure we need this as part of the URL
                    var qd = new ProcessProfileAjax()
                    {
                        Id            = input.RowId.ToString(),
                        ProcessTypeId = item.Id,
                        //EndPoint = externalFinderSiteURL + url + item.Id.ToString()
                    };
                    ajax.QueryData = qd;
                    output.ProcessProfiles.Add(ajax);
                }

                return;
            }

            //process profiles
            if (input.AdministrationProcess.Any())
            {
                output.AdministrationProcess = ServiceHelper.MapAJAXProcessProfile("Administration Process", "", input.AdministrationProcess);
            }
            if (input.DevelopmentProcess.Any())
            {
                output.DevelopmentProcess = ServiceHelper.MapAJAXProcessProfile("Development Process", "", input.DevelopmentProcess);
            }
            if (input.MaintenanceProcess.Any())
            {
                output.MaintenanceProcess = ServiceHelper.MapAJAXProcessProfile("Maintenance Process", "", input.MaintenanceProcess);
            }
        }
示例#2
0
        private static void MapProcessProfiles(ThisEntity input, ref ThisEntityDetail output)
        {
            if (input.ProcessProfilesSummary != null && input.ProcessProfilesSummary.Any())
            {
                var url = string.Format("detail/ProcessProfile/{0}/", input.RowId.ToString());
                output.ProcessProfiles = new List <AJAXSettings>();
                foreach (var item in input.ProcessProfilesSummary)
                {
                    var ajax = new AJAXSettings()
                    {
                        Label       = item.Name,
                        Description = "",
                        Total       = item.Totals,
                        URL         = externalFinderSiteURL + url + item.Id.ToString(),
                        TestURL     = ServiceHelper.finderApiSiteURL + url + item.Id.ToString(),
                    };
                    //not sure we need this as part of the URL
                    var qd = new ProcessProfileAjax()
                    {
                        Id            = input.RowId.ToString(),
                        ProcessTypeId = item.Id,
                        //EndPoint = externalFinderSiteURL + url + item.Id.ToString()
                    };
                    ajax.QueryData = qd;

                    /*need to know
                     * endpoint: detail/processprofile
                     * id:		 input.RowId
                     * processProfileTypeId: item.Id?
                     *
                     */
                    //var filter = ( new MD.LabelLink()
                    //{
                    //	Label = item.Name,
                    //	Count = item.Totals,
                    //	URL = externalFinderSiteURL + url + item.Id.ToString()
                    //} );


                    output.ProcessProfiles.Add(ajax);
                }

                return;
            }

            //process profiles
            if (input.AdministrationProcess.Any())
            {
                output.AdministrationProcess = ServiceHelper.MapAJAXProcessProfile("Administration Process", "", input.AdministrationProcess);
            }
            if (input.AppealProcess.Any())
            {
                output.AppealProcess = ServiceHelper.MapAJAXProcessProfile("Appeal Process", "", input.AppealProcess);
            }
            if (input.ComplaintProcess.Any())
            {
                output.ComplaintProcess = ServiceHelper.MapAJAXProcessProfile("Complaint Process", "", input.ComplaintProcess);
            }
            if (input.DevelopmentProcess.Any())
            {
                output.DevelopmentProcess = ServiceHelper.MapAJAXProcessProfile("Development Process", "", input.DevelopmentProcess);
            }
            if (input.MaintenanceProcess.Any())
            {
                output.MaintenanceProcess = ServiceHelper.MapAJAXProcessProfile("Maintenance Process", "", input.MaintenanceProcess);
            }
            if (input.ReviewProcess.Any())
            {
                output.ReviewProcess = ServiceHelper.MapAJAXProcessProfile("Review Process", "", input.ReviewProcess);
            }
            if (input.RevocationProcess.Any())
            {
                output.RevocationProcess = ServiceHelper.MapAJAXProcessProfile("Revocation Process", "", input.RevocationProcess);
            }
        }
示例#3
0
        private static void MapVerificationServiceProfile(Organization org, ref WMA.OrganizationDetail output, OrganizationManager.OrganizationRequest request)
        {
            if (request.IncludingVerificationProfiles)
            {
                if (org.VerificationServiceProfiles == null || !org.VerificationServiceProfiles.Any())
                {
                    return;
                }

                output.HasVerificationServiceTemp = new List <WMA.VerificationServiceProfile>();
                foreach (var item in org.VerificationServiceProfiles)
                {
                    WMA.VerificationServiceProfile vsp = new WMA.VerificationServiceProfile()
                    {
                        DateEffective                 = item.DateEffective,
                        Description                   = item.Description,
                        HolderMustAuthorize           = item.HolderMustAuthorize,
                        SubjectWebpage                = item.SubjectWebpage,
                        VerificationDirectory         = item.VerificationDirectory,
                        VerificationMethodDescription = item.VerificationMethodDescription,
                        VerificationService           = item.VerificationServiceUrl
                    };
                    if (item.Jurisdiction != null && item.Jurisdiction.Any())
                    {
                        vsp.Jurisdiction = ServiceHelper.MapJurisdiction(item.Jurisdiction);
                    }
                    if (item.Region != null && item.Region.Any())
                    {
                        vsp.Region = ServiceHelper.MapJurisdiction(item.Region);
                    }
                    //CostProfiles
                    if (item.EstimatedCost != null && item.EstimatedCost.Any())
                    {
                        vsp.EstimatedCost = ServiceHelper.MapCostProfiles(item.EstimatedCost, searchType);
                    }

                    //OfferredIn
                    if (item.JurisdictionAssertions != null && item.JurisdictionAssertions.Any())
                    {
                        vsp.OfferedIn = ServiceHelper.MapJurisdiction(item.JurisdictionAssertions, "OfferedIn");
                    }
                    //
                    //if ( item.OfferedByAgent != null && !string.IsNullOrWhiteSpace( item.OfferedByAgent.Name ) )
                    //	vsp.OfferedBy = ServiceHelper.MapToEntityReference( item.OfferedByAgent, searchType );
                    //
                    if (item.OfferedByAgent != null && !string.IsNullOrWhiteSpace(item.OfferedByAgent.Name))
                    {
                        var ab = ServiceHelper.MapToOutline(item.OfferedByAgent, searchType);
                        vsp.OfferedBy = ServiceHelper.MapOutlineToAJAX(ab, "Offered by {0} Organization(s)");
                    }
                    vsp.VerifiedClaimType = ServiceHelper.MapPropertyLabelLinks(item.ClaimType, "organization", false);
                    if (item.TargetCredential != null && item.TargetCredential.Any())
                    {
                        vsp.TargetCredential = ServiceHelper.MapCredentialToAJAXSettings(item.TargetCredential, "Has {0} Target Credential(s)");
                        //vsp.TargetCredential = new List<TopLevelEntityReference>();
                        //foreach ( var target in item.TargetCredential )
                        //{
                        //	if ( target != null && !string.IsNullOrWhiteSpace( target.Name ) )
                        //		vsp.TargetCredential.Add( ServiceHelper.MapToEntityReference( target, "credential" ) );
                        //}
                        //vsp.TargetCredential = ServiceHelper.MapToEntityReference( item.TargetCredential );
                    }

                    output.HasVerificationServiceTemp.Add(vsp);
                }
                output.HasVerificationService = new AJAXSettings()
                {
                    //Type=null,
                    Label = string.Format("Has {0} Verification Service(s)", output.HasVerificationServiceTemp.Count()),
                    Total = output.HasVerificationServiceTemp.Count()
                };
                List <object> obj = output.HasVerificationServiceTemp.Select(f => ( object )f).ToList();
                output.HasVerificationService.Values = obj;
                output.HasVerificationServiceTemp    = null;
            }
            else if (org.VerificationServiceProfileCount > 0)
            {
                var url = string.Format("detail/VerificationService/{0}", org.RowId.ToString());
                output.HasVerificationService = new AJAXSettings();
                var ajax = new AJAXSettings()
                {
                    Label   = string.Format("Has {0} Verification Service(s)", org.HasCostManifest.Count()),
                    Total   = org.VerificationServiceProfileCount,
                    URL     = externalFinderSiteURL + url,
                    TestURL = ServiceHelper.finderApiSiteURL + url
                };
                //don't need this, as have the URL
                //var qd = new ProcessProfileAjax()
                //{
                //	Id = org.RowId.ToString(),
                //	//EndPoint = externalFinderSiteURL + url + item.Id.ToString()
                //};
                //ajax.QueryData = qd;
                output.HasVerificationService = ajax;
                //var filter = ( new WMA.LabelLink()
                //{
                //	Label = "Has Verification Service",
                //	Count = org.VerificationServiceProfileCount,
                //	URL = externalFinderSiteURL + url
                //} );
                //output.HasVerificationServiceSummary.Add( filter );

                //return;
            }
        }