private void btnLookupTicket(object sender, RoutedEventArgs e) { SDTicket.showTicket(tbTicketInfo, txtTicket.Text); }
public static bool showTicket(TextBlock tbNote, string ticketNumber) { SDTicket.RequestLongForm ticketInfo = SDTicket.getServiceTicketEntry(ticketNumber); if (ticketInfo != null) { tbNote.Inlines.Clear(); tbNote.Inlines.Add(new Run("Category: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.CATEGORY + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("By: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.CREATEDBY + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Time: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.CREATEDTIME + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Dept: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.DEPARTMENT + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Requester: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.REQUESTER + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("E-Mail: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.REQUESTEREMAIL + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Subject: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.SUBJECT + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Desc: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.SHORTDESCRIPTION.TrimStart().Replace(" ", " ") + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); tbNote.Inlines.Add(new Run("Technician: ") { FontWeight = FontWeights.Bold }); tbNote.Inlines.Add(new Run(ticketInfo.TECHNICIAN + Environment.NewLine) { Foreground = Brushes.MidnightBlue }); return(true); } else { tbNote.Inlines.Clear(); tbNote.Inlines.Add(new Run("Unable to find ticket") { FontWeight = FontWeights.Bold }); return(false); // MarkTicketAsBad(ticketNumber); } }