Пример #1
0
        private void ProcessProdTickets(ServiceNowProdChangeAPI.query query, MailMessage mm,
                                        ServiceNowProdChangeAPI.ServiceNow_Prod_ChangeQuery changeQuery, string[] changeTickets)
        {
            var serviceNowUrl = ConfigurationManager.AppSettings["ServiceNowProductionLink"];

            foreach (string ticket in changeTickets)
            {
                mm.Subject          = "TFS Integration Ticket #: " + ticket;
                query.change_number = ticket;
                ServiceNowProdChangeAPI.queryResponse qr = changeQuery.query(query);

                string body = "<html><body>";


                foreach (ServiceNowProdChangeAPI.queryResponseGroup qrg in qr.approvals)
                {
                    var assignmentGroup = qrg.assignment_group;
                    var comments        = qrg.comments;
                    var status          = qrg.status;
                    var location        = qrg.location;

                    body += "<div><span>Assignment Group: " + assignmentGroup + "</span><br />";
                    body += "<span><b>Status: " + status + "</b></span><br />";
                    body += "<span>Comments: " + comments + "</span><br />";
                    body += "<span>Location: " + location + "</span><br /><br /></div>";
                    //body += "<span>ServiceNowURL: " + serviceNowUrl + "</span><br /><br /></div>";
                }

                body += "</body></html>";

                //ticketDirectory = executingExePath + "\\" + ticket;
                mm.HtmlBody = body;

                SaveFileOnNASDrive(mm, ticket);
            }
        }