Esempio n. 1
0
        // Call this when a device (Box) has been selected in the list of discovered devices
        public static bool SubmitTicket(string aInstallerVersion, string aProductName, string aEntryPoint, string aFirstName, string aLastName,
                                        string aEmail, string aPhoneNumber, string aContactNotes, string aFaultDescription,
                                        Diagnostics aDiagnostics, Box aBox, out string aSubmissionReport, out string aTicketXmlData)
        {
            // get the test results from Diagnostics (a List of Tests)
            while (!aDiagnostics.AllComplete())
            {
                System.Threading.Thread.Sleep(1000);
            }

            ListOfTestResource testList = new ListOfTestResource();

            var testResults = aDiagnostics.Results();

            foreach (TestResult result in testResults)
            {
                TestResourceResult passFailWarn;

                switch (result.result)
                {
                case "PASS":
                    passFailWarn = TestResourceResult.Pass;
                    break;

                case "WARN":
                    passFailWarn = TestResourceResult.Warning;
                    break;

                default:
                case "FAIL":
                    passFailWarn = TestResourceResult.Fail;
                    break;
                }

                CreateTest(testList, result.title, passFailWarn, result.description, result.startTime, result.endTime, result.content);
            }


            // Get the other (non-test) stuff (a List of Categories)
            ListOfCategoryResource categoryList = new ListOfCategoryResource();
            var info = new DiagnosticInfo(aBox);

            var categoryDeviceInfo = Ticket.CreateCategory(categoryList, "DeviceInfo");

            Ticket.CreateItem(categoryDeviceInfo, "All Device Info", info.DeviceInfo);

            var categorySystemInfo = Ticket.CreateCategory(categoryList, "SystemInfo");

            Ticket.CreateItem(categorySystemInfo, "All System Info", info.SystemInfo);

            var categoryUserLog = Ticket.CreateCategory(categoryList, "UserLog");

            Ticket.CreateItem(categoryUserLog, "Full UserLog", info.UserLog);


            return(SubmitTicket(aInstallerVersion, aProductName, aEntryPoint, aFirstName, aLastName,
                                aEmail, aPhoneNumber, aContactNotes, aFaultDescription,
                                info.ProductId, info.SoftwareVersion, info.MacAddress, categoryList, testList,
                                out aSubmissionReport, out aTicketXmlData));
        }