Ejemplo n.º 1
0
            public static DataSet runScript(environment env, DataTable myInputTable, string script, string appInstance, bool auth = false, string extraParamName = "", string extraParamValue = "", string ePN2 = "", string ePV2 = "", string ePN3 = "", string ePV3 = "", string ePN4 = "", string ePV4 = "")
            {
                try
                {
                    DataTable myParams = new DataTable("Params");
                    myParams.Columns.Add("name");
                    myParams.Columns.Add("value");
                    myParams.Rows.Add("@Script", script);
                    myParams.Rows.Add("@App", appInstance);
                    myParams.Rows.Add("@UserName", "trg\\jmore");
                    myParams.Rows.Add("@Environment", @"DEFAULT");
                    if (extraParamName != "")
                    {
                        myParams.Rows.Add(extraParamName, extraParamValue);
                    }
                    if (ePN2 != "")
                    {
                        myParams.Rows.Add(ePN2, ePV2);
                    }
                    if (ePN3 != "")
                    {
                        myParams.Rows.Add(ePN3, ePV3);
                    }
                    if (ePN4 != "")
                    {
                        myParams.Rows.Add(ePN4, ePV4);
                    }

                    DataSet mySet = new DataSet("test");
                    mySet.Tables.Add(myParams);
                    if (myInputTable != null)
                    {
                        mySet.Tables.Add(myInputTable);
                    }

                    rsseDEV.clsScriptEngineSoapClient    se = new rsseDEV.clsScriptEngineSoapClient();
                    System.ServiceModel.BasicHttpBinding x  = (System.ServiceModel.BasicHttpBinding)se.ChannelFactory.Endpoint.Binding;
                    x.MaxBufferSize          = 1000000000;
                    x.MaxReceivedMessageSize = 1000000000;

                    StringWriter writer = new StringWriter();
                    mySet.WriteXml(writer, XmlWriteMode.WriteSchema);
                    string xml = writer.ToString();
                    var    ds  = se.ExecuteScript(xml);

                    if ((ds.Tables.Count >= 1) && ds.Tables[0].TableName.ToUpper() == "ERRORTABLE")
                    {
                        Console.Write("An error has occurred processing the script: " + script + ":" + Environment.NewLine + ds.Tables[0].Rows[0][0].ToString());
                        return(null);
                    }

                    return(ds);
                }
                catch (Exception ex)
                {
                    string error = "An error has been thrown while processing the script: " + script + ":" + Environment.NewLine + Environment.NewLine + "The error is: " + Environment.NewLine + ex.ToString();
                    Console.Write(error);
                    return(new DataSet());
                }
            }
        private void showSAjobDetails(environment env)
        {
            rectProdDetails.Opacity = (env == environment.prod) ? 1d : 0.29d;
            rectTestDetails.Opacity = (env == environment.test) ? 1d : 0.29d;
            rectDevDetails.Opacity  = (env == environment.dev) ? 1d : 0.29d;


            if ((dgSearchResults.SelectedIndex < 0) || (dgSearchResults.SelectedItem.ToString() == "{NewItemPlaceholder}"))
            {
                // clear the SA job steps
                return;
            }
            results   r   = ((results)dgSearchResults.SelectedItem);
            subresult sr  = null;
            envInfo   inf = null;

            string jobname = "";

            if (env == environment.prod)
            {
                sr      = r.prod;
                inf     = prod;
                jobname = r.prod.SA;
            }

            if (env == environment.test)
            {
                sr      = r.test;
                inf     = test;
                jobname = r.test.SA;
            }

            if (env == environment.dev)
            {
                sr      = r.dev;
                inf     = dev;
                jobname = r.dev.SA;
            }

            List <jobInfo> ji = new List <jobInfo>();

            foreach (DataRow drStep in inf.dtSteps.Rows)
            {
                if (drStep["job_id"].ToString() == sr.jobid)
                {
                    string fontweight = (drStep["step_id"].ToString() == sr.stepid) ? "Bold" : "Normal";
                    ji.Add(new jobInfo()
                    {
                        Step = drStep["step_id"].ToString(), Type = drStep["subsystem"].ToString(), Description = drStep["step_name"].ToString(), Command = drStep["command"].ToString(), CommandWeight = fontweight, DescriptionWeight = fontweight, StepWeight = fontweight, TypeWeight = fontweight
                    });
                }
            }
            dgSASteps.ItemsSource = ji;
        }
Ejemplo n.º 3
0
 ? WithConfiguration(environment, configuration)
 : WithoutConfiguration(environment)
 public Node eval(Node t, environment e)
 {
     return(Nil.getInstance());
 }
Ejemplo n.º 5
0
 var(environment, initialState, initialObservation) = BlackJack.Create();