Exemple #1
0
        private void btnAdTest_Click(object sender, EventArgs e)
        {
            //            CodeTests testForSourceCode = new CodeTests();
            //            testForSourceCode.CheckRegex();

            Cursor.Current = Cursors.WaitCursor;
            TreeNode treeNode = new TreeNode(string.Format("START: {0}", DateTime.Now.ToString()));

            resultView.Nodes.Add(treeNode);
            TestOdataServises clTst2 = new TestOdataServises();

            clTst2.Authorization();
            for (int i = 25000; i < 30000; i++)
            {
                if (clTst2.CreateAsset(i))
                {
                    Console.WriteLine(i);
                }
//                System.Threading.Thread.Sleep(1000); //sleep time between sending Asset
            }
            TreeNode treeNode1 = new TreeNode(string.Format("END: {0}", DateTime.Now.ToString()));

            resultView.Nodes.Add(treeNode1);

            Cursor.Current = Cursors.Default;
        }
Exemple #2
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            TestOdataServises clTst2 = new TestOdataServises();

            clTst2.IncommingXMLTest();

            clTst2.Authorization();
            RootObject newWO;

            if (clTst2.GetWorkorders(out newWO))
            {
                //                DataTable dataTable = ConvertToDatatable(newWO.value);
                XmlSerializer xmlSerializer = new XmlSerializer(newWO.GetType());
                string        s             = JsonConvert.SerializeObject(newWO);
                int           numItem       = 1;
                foreach (Value elem in newWO.value)
                {
                    TreeNode   node2    = new TreeNode(elem.Id.ToString());
                    TreeNode   node3    = new TreeNode(elem.CallDate);
                    TreeNode[] array    = new TreeNode[] { node2, node3 };
                    TreeNode   treeNode = new TreeNode(string.Format("WO:{0}", numItem), array);
                    resultView.Nodes.Add(treeNode);
                    numItem++;
                }
            }

            //clTst2.ApiGetAuthorizationCode();

            Cursor.Current = Cursors.Default;
        }
Exemple #3
0
        private void GetAllWo_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            TestOdataServises clTst2 = new TestOdataServises();

            clTst2.Authorization();
            int        numPackage = 0;
            RootObject newWO;

            //to get all workorders
            while (clTst2.GetWorkorders(out newWO))
            {
                numPackage++;
                foreach (Value elem in newWO.value)
                {
                    if (WoFind.Text.CompareTo(elem.Id.ToString()) == 0)
                    {
                        resultView.Nodes.Add(string.Format("We have the WO:{0}", WoFind.Text));
                        Console.WriteLine("We have the WO");
                    }
                }
            }
            resultView.Nodes.Add(string.Format("NumberPackages:{0}", numPackage));

            Console.WriteLine(numPackage);

            Cursor.Current = Cursors.Default;
        }