Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            string value = this.Context.Request.QueryString["Identity"];

            if (string.IsNullOrEmpty(value))
            {
                throw new BadQueryParameterException("Identity");
            }
            if (string.IsNullOrEmpty(this.Context.Request.QueryString["Name"]))
            {
                throw new BadQueryParameterException("Name");
            }
            if (string.IsNullOrEmpty(this.Context.Request.QueryString["HandlerClass"]))
            {
                throw new BadQueryParameterException("HandlerClass");
            }
            Identity            identity            = Identity.FromIdParameter(value);
            WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=MigrationReport");
            PowerShellResults <JsonDictionary <object> > powerShellResults = (PowerShellResults <JsonDictionary <object> >)webServiceReference.GetObject(identity);

            if (!powerShellResults.SucceededWithValue)
            {
                throw new BadQueryParameterException("Identity");
            }
            if ((MigrationType)powerShellResults.Output[0]["MigrationType"] == MigrationType.BulkProvisioning)
            {
                this.OverrideStringsForBulkProvisioning();
            }
            if (this.linkShowReport != null)
            {
                this.linkShowReport.NavigateUrl = this.Context.Request.RawUrl.Replace("DownloadReport.aspx?", "Download.aspx?");
            }
            base.OnLoad(e);
        }
        private static void LoadCrossPremiseServiceInstance(OrganizationCache.AddValueHandler addValue, OrganizationCache.LogErrorHandler logError)
        {
            string value = string.Empty;

            try
            {
                WebServiceReference webServiceReference = new WebServiceReference("~/DDI/DDIService.svc?schema=HybridConfigurationWizardService&workflow=GetServiceInstance");
                PowerShellResults <JsonDictionary <object> > powerShellResults = (PowerShellResults <JsonDictionary <object> >)webServiceReference.GetObject(null);
                if (powerShellResults.Output.Length > 0)
                {
                    value = (string)powerShellResults.Output[0].RawDictionary["ServiceInstance"];
                }
            }
            catch (Exception ex)
            {
                logError("ServiceInstance", ex.ToString());
            }
            addValue("ServiceInstance", value);
        }