Пример #1
0
        public string ToXml()
        {
            StringBuilder data = new StringBuilder();

            data.AppendLine("<ticket>");
            data.AppendLine("<status>" + Status.ToString().Replace("TicketStatus.", string.Empty) + "</status>");
            data.AppendLine("<priority>" + Priority.ToString().Replace("Priority.", string.Empty) + "</priority>");
            data.AppendLine("<summary>");
            data.AppendLine(System.Web.HttpUtility.HtmlEncode(Summary));
            data.AppendLine("</summary>");
            data.AppendLine("<description>");
            data.AppendLine(System.Web.HttpUtility.HtmlEncode(Description));
            data.AppendLine("</description>");
            data.AppendLine("<assigned-to-id>" + Owner.ToString() + "</assigned-to-id>");
            data.AppendLine("<milestone-id>" + Milestone.ToString() + "</milestone-id");
            data.AppendLine("</ticket>");
            return(data.ToString());
        }
Пример #2
0
    /// <summary>
    /// 转换出票状态名称
    /// </summary>
    /// <param name="togetherTicketStatus">出票状态</param>
    /// <returns>出票状态名称</returns>
    public static string TicketStatusName(TicketStatus ticketStatus)
    {
        //合买出票状态
        string status = string.Empty;

        switch (ticketStatus)
        {
        case TicketStatus.Waitting:
            status = "待出票";
            break;

        case TicketStatus.Ticketing:
            status = "出票中";
            break;

        case TicketStatus.PrintTicket:
            status = "已打票";
            break;

        case TicketStatus.Abort:
            status = "被终止";
            break;

        case TicketStatus.Skipped:
            status = "被跳过";
            break;

        case TicketStatus.Ticketed:
            status = "已出票";
            break;

        case TicketStatus.Error:
            status = "出票失败";
            break;

        default: status = ticketStatus.ToString(); break;
        }
        return(status);
    }
 public static IZendeskQuery WithTicketStatus(this IZendeskQuery query, TicketStatus status, FilterOperator op = FilterOperator.Equals)
 {
     return(query.WithFilter("status", status.GetType().GetTypeInfo().GetDeclaredField(status.ToString()).GetCustomAttribute <EnumMemberAttribute>().Value, op));
 }