Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SmeTicketCard"/> class.
 /// </summary>
 /// <param name="ticket">The ticket model with the latest details.</param>
 /// <param name="payload">Payload from the response card.</param>
 public SmeTicketCard(TicketEntity ticket, UpdateTicketResponsePayload payload)
 {
     this.ticket = ticket;
     this.updateTicketResponsePayload = new UpdateTicketResponsePayload();
     if (payload != null)
     {
         this.updateTicketResponsePayload = payload;
     }
 }
 /// <summary>
 /// Gets the current status of the ticket to display in the SME team.
 /// </summary>
 /// <param name="ticket">The current ticket information.</param>
 /// <param name="payload">Payload from the response card.</param>
 /// <returns>A status string.</returns>
 public static string GetTicketDisplayStatusForSme(TicketEntity ticket, UpdateTicketResponsePayload payload)
 {
     if (ticket?.Status == (int)TicketState.Answered && payload == null)
     {
         return(string.Format(CultureInfo.InvariantCulture, Strings.SMETicketAnsweredStatus, ticket?.AssignedToName));
     }
     else if (ticket?.Status == (int)TicketState.UnAnswered)
     {
         return(Strings.SMETicketUnansweredStatus);
     }
     else if (payload.Action == UpdateTicketResponsePayload.UpdateResponseAction)
     {
         return(string.Format(CultureInfo.InvariantCulture, Strings.SMETicketAnsweredAndUpdatedStatus, ticket?.AssignedToName));
     }
     else
     {
         return(string.Format(CultureInfo.InvariantCulture, Strings.SMETicketAnsweredStatus, ticket?.AssignedToName));
     }
 }