public override StepResult RunTest()
        {
            string strFullIP = "";

            try
            {
                foreach (string strIP in Properties.Settings.Default.NetworkAddress)
                {
                    Ping ping = new Ping();
                    strFullIP = strIP;
                    this.setResultLabel("(" + strIP.Trim() + ")");
                    PingReply pingReply = ping.Send(strIP);
                    {
                        if (!pingReply.Status.Equals(IPStatus.Success))
                        {
                            ExplanationForm myForm = new ExplanationForm();

                            myForm.strLabel1 = "Failed to PING [" + strIP + "]";
                            myForm.strLabel2 = "Contact your IT department";
                            myForm.ShowDialog();

                            return(StepResult.stepFailed);
                        }
                    }
                }
//                Ping ping = new Ping();
//                PingReply pingreply = ping.Send("ENGACSDB.ENG.PSCNET.COM");
//                if ( pingreply.Status.Equals())

                return(StepResult.stepPassed);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ":" + ex.InnerException.Message);

                ExplanationForm myForm = new ExplanationForm();

                myForm.strLabel1 = "Failed to PING [ " + strFullIP + "]";
                myForm.strLabel2 = "Contact your IT department";
                myForm.ShowDialog();

                return(StepResult.stepFailed);
            }
        }
Exemplo n.º 2
0
        public override StepResult RunTest()
        {
            DialogResult dResult;

            //    return base.RunTest();
            try
            {
                int iIndex = 0;
                foreach (string strQuestion in Properties.Settings.Default.UserQuestions)
                {
                    this.setResultLabel("(" + strQuestion.Trim() + ")");
                    dResult = MessageBox.Show(strQuestion, strQuestion, MessageBoxButtons.YesNo);
                    if (!(dResult == DialogResult.Yes))
                    {
                        //                Ping ping = new Ping();
                        //                PingReply pingreply = ping.Send("EDB.ANON.DL.COM");
                        //                if ( pingreply.Status.Equals())

                        string          strDirection = Properties.Settings.Default.UserDirections[iIndex];
                        ExplanationForm myForm       = new ExplanationForm();

                        myForm.strLabel1 = strQuestion;
                        myForm.strLabel2 = strDirection;

                        myForm.ShowDialog();

                        return(StepResult.stepFailed);
                    }
                    iIndex++;
                }
                return(StepResult.stepPassed);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ":" + ex.InnerException.Message);
                return(StepResult.stepFailed);
            }
        }
        /// <summary>
        /// overridden RunTest to do actual test
        /// </summary>
        /// <returns>StepResult enum - pass, fail, skip</returns>
        public override StepResult RunTest()
        {
            string strDBName = Properties.Settings.Default.DatabaseName;



            //    return base.RunTest();
            try
            {
                this.setResultLabel("(" + strDBName + ")");
                Ping      ping      = new Ping();
                PingReply pingreply = ping.Send(strDBName);
//                if ( pingreply.Status.Equals())
//                ExplanationForm myform = new ExplanationForm();

//                myform.ShowDialog();
                if (!(pingreply.Status == IPStatus.Success))
                {
                    ExplanationForm myForm = new ExplanationForm();

                    myForm.strLabel1 = "Failed to PING the Database Server:[" + strDBName + "]";
                    myForm.strLabel2 = "Contact your IT department";
                    myForm.ShowDialog();
                    return(StepResult.stepFailed);
                }
                return(StepResult.stepPassed);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ":" + ex.InnerException.Message);
                ExplanationForm myForm = new ExplanationForm();

                myForm.strLabel1 = "Failed to PING the Database Server:" + strDBName;
                myForm.strLabel2 = "Contact your IT department";
                myForm.ShowDialog();
                return(StepResult.stepFailed);
            }
        }
Exemplo n.º 4
0
        public override StepResult RunTest()
        {
            SAPXML      mySAPXML;
            SAPPost     sp;
            XmlDocument xmlDoc = new XmlDocument();
            XmlNodeList oNodes;
            XmlNode     aNode;
            int         qty;
            string      strAddress;
            DataTable   myTable;
            int         iRows;



            clsDiagnosticTest.InputDialogBox ib = new InputDialogBox();

            ib.Caption  = "Enter a Production Order";
            ib.Prompt   = "Enter the valid Production Order number ( or a valid Production Order)";
            ib.Response = "";
            ib.ShowDialog();
            if (ib.exitOK == InputDialogBox.inputresponse.OK)
            {
                string strProdOrder = (string)ib.Response.ToString().Clone();
                string strlongProdOrder;  // = String.Format("{000000000000}", strProdOrder.Trim());
                strlongProdOrder = strProdOrder.PadLeft(12, '0');


                ib.Close();
                this.setResultLabel("(" + strlongProdOrder.Trim() + ")");

                /*            clsDiagnosticTest.InputDialogBox ib = new clsDiagnosticTest.InputDialogBox();
                 *
                 *
                 *
                 * ib.FormPrompt = "Enter aNode Production OrderedEnumerableRowCollection";
                 * ib.FormCaption = "Test Production Order";
                 * ib.DefaultValue = "000600001234";
                 * ib.ShowDialog();
                 * string s = ib.InputResponse;
                 */

                try
                {
                    sp = new SAPPost("ZC_SEND_PODAT_AS");
                    sp.setProperty("AUFNR", strlongProdOrder);
                    //           sp.setProperty("VALID_FROM", strDateTimeholder);
                    //           sp.setProperty("VALID_TO", strDateTimeholder);


                    //                string strAddress = HomeAddress;   //+ "/sap/PRD/default.asp";
                    strAddress = "http://home/sap/PRD/default.asp";
                    mySAPXML   = sp.Post(strAddress);
                    xmlDoc     = mySAPXML.getXDOC();


                    myTable = mySAPXML.getDataTable("PODAT_AS");
                    iRows   = myTable.Rows.Count;

                    if (iRows < 2)
                    {
                        MessageBox.Show("Error getting BOM for PO - call IT");

                        ExplanationForm myForm = new ExplanationForm();

                        myForm.strLabel1 = "Failed to get BOM for Production Order =[" + strlongProdOrder + "]";
                        myForm.strLabel2 = "Contact your IT department";
                        myForm.ShowDialog();


                        return(StepResult.stepFailed);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Got BOMPull exception=" + ex.Message);
                    return(StepResult.stepFailed);
                }


                try
                {
                    sp = new SAPPost("ZC_SEND_POSERIALDATA_AS");
                    sp.setProperty("AUFNR", strlongProdOrder);
                    //           sp.setProperty("VALID_FROM", strDateTimeholder);
                    //           sp.setProperty("VALID_TO", strDateTimeholder);


                    //                string strAddress = HomeAddress;   //+ "/sap/PRD/default.asp";
                    //            strAddress = "http://home/sap/PRD/default.asp";
                    mySAPXML = sp.Post(strAddress);
                    xmlDoc   = mySAPXML.getXDOC();


                    myTable = mySAPXML.getDataTable("ZSERIALNR_AS");
                    iRows   = myTable.Rows.Count;

                    if (iRows < 2)
                    {
                        MessageBox.Show("Error getting Serials for production order.  Contact IT");
                        ExplanationForm myForm = new ExplanationForm();

                        myForm.strLabel1 = "Failed to get Serial Numbers for Production Order=[" + strlongProdOrder + "]";
                        myForm.strLabel2 = "Contact your IT department";
                        myForm.ShowDialog();

                        return(StepResult.stepFailed);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Got serial number pull error=" + ex.Message);
                    return(StepResult.stepFailed);
                }
            }
            else
            {
                return(StepResult.stepUserCancelled);
            }
            return(StepResult.stepPassed);
        }
        public override StepResult RunTest()
        {
            SqlConnection sqlConnect1;
            string        strSqlConnect;
            int           iNumberofSubtestLimits = 0;
            int           iNumberofBomParts      = 0;

            //    return base.RunTest();
            try
            {
                strSqlConnect = Properties.Settings.Default.TestDatabase;

                sqlConnect1 = new SqlConnection(strSqlConnect);
                sqlConnect1.Open();
                if (sqlConnect1.State.Equals(ConnectionState.Open))
                {
                    SqlCommand cmdTestDB = sqlConnect1.CreateCommand();
                    cmdTestDB.CommandType = CommandType.StoredProcedure;
                    cmdTestDB.CommandText = "ame_TestSubtestsExist";

                    SqlDataReader sqlRead = cmdTestDB.ExecuteReader();
                    if (sqlRead.Read())
                    {
                        iNumberofSubtestLimits = Int32.Parse(sqlRead[0].ToString());
                        this.setResultLabel("(" + iNumberofSubtestLimits.ToString().Trim() + ")");
                        if (iNumberofSubtestLimits < 10000)
                        {
                            ExplanationForm myForm = new ExplanationForm();

                            myForm.strLabel1 = "Unable to find subtestlimits. [" + iNumberofSubtestLimits.ToString().Trim() + "]";
                            myForm.strLabel2 = "Contact AME";
                            myForm.ShowDialog();

                            return(StepResult.stepFailed);
                        }
                    }

                    string x = sqlRead[0].ToString();
                    sqlRead.NextResult();
                    if (sqlRead.Read())
                    {
                        iNumberofBomParts = Int32.Parse(sqlRead[0].ToString());
                        this.setResultLabel("(" + iNumberofSubtestLimits.ToString().Trim() + ":" + iNumberofBomParts.ToString().Trim() + ")");
                        if (iNumberofBomParts < 10)
                        {
                            ExplanationForm myForm = new ExplanationForm();

                            myForm.strLabel1 = "Unable to find BOM parts. [" + iNumberofSubtestLimits.ToString().Trim() + ":" + iNumberofBomParts.ToString().Trim() + "]";
                            myForm.strLabel2 = "Contact AME";
                            myForm.ShowDialog();

                            return(StepResult.stepFailed);
                        }
                    }
                }

//                Ping ping = new Ping();
//                PingReply pingreply = ping.Send("EDB.ANON.DL.COM");
//                if ( pingreply.Status.Equals())

                return(StepResult.stepPassed);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ":" + ex.InnerException.Message);
                ExplanationForm myForm = new ExplanationForm();

                myForm.strLabel1 = "Unable to find subtestlimits or BOM parts";
                myForm.strLabel2 = "Contact AME";
                myForm.ShowDialog();

                return(StepResult.stepFailed);
            }
        }