Ejemplo n.º 1
0
        public PowerShellResults ProcessRequest(HttpContext context)
        {
            Identity identity = Identity.FromIdParameter(context.Request.QueryString["Identity"]);
            string   text     = context.Request.QueryString["Name"];

            if (identity == null || string.IsNullOrEmpty(identity.RawIdentity))
            {
                throw new BadQueryParameterException("Identity");
            }
            if (string.IsNullOrEmpty(text))
            {
                throw new BadQueryParameterException("Name");
            }
            context.Response.ContentType = "text/csv";
            context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}\"", HttpUtility.UrlEncode(text)));
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary["CsvStream"] = context.Response.OutputStream;
            DDIParameters properties = new DDIParameters
            {
                Parameters = new JsonDictionary <object>(dictionary)
            };
            IDDIService       iddiservice       = (IDDIService) new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=MigrationReport&workflow=ExportMigrationReport").ServiceInstance;
            PowerShellResults powerShellResults = iddiservice.SingleObjectExecute(identity, properties);

            if (this.IsValidUserError(powerShellResults))
            {
                powerShellResults = new PowerShellResults();
            }
            return(powerShellResults);
        }
Ejemplo n.º 2
0
        public PowerShellResults <JsonDictionary <object> > GetList(DDIParameters filter, SortOptions sort)
        {
            MethodInfo method = this.ServiceType.GetMethod("GetList", new Type[]
            {
                typeof(DDIParameters),
                typeof(SortOptions)
            });

            return((PowerShellResults <JsonDictionary <object> >)method.Invoke(this.ServiceInstance, new object[]
            {
                filter,
                sort
            }));
        }
Ejemplo n.º 3
0
        private PowerShellResults <JsonDictionary <object> > GetPowerShellResult(string outputColumn, string properties, string schema, string filter)
        {
            IDDIService   iddiservice              = (IDDIService) new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=" + schema).ServiceInstance;
            DDIParameters ddiparameters            = new DDIParameters();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary["workflowOutput"] = outputColumn;
            dictionary["PropertyList"]   = properties;
            if (!string.IsNullOrEmpty(filter))
            {
                JavaScriptSerializer        javaScriptSerializer = new JavaScriptSerializer();
                Dictionary <string, object> dictionary2          = javaScriptSerializer.Deserialize <Dictionary <string, object> >(filter);
                foreach (KeyValuePair <string, object> keyValuePair in dictionary2)
                {
                    dictionary[keyValuePair.Key] = keyValuePair.Value;
                }
            }
            ddiparameters.Parameters = new JsonDictionary <object>(dictionary);
            return(iddiservice.GetList(ddiparameters, null));
        }