Exemplo n.º 1
0
        public static string GetTicketHistory(LoginUser loginUser, int ticketID, DateTime?minUtcDate)
        {
            ActionLogs logs = new ActionLogs(loginUser);

            if (minUtcDate == null)
            {
                logs.LoadByTicketID(ticketID);
            }
            else
            {
                logs.LoadByTicketID(ticketID, (DateTime)minUtcDate);
            }

            if (logs.IsEmpty)
            {
                return("");
            }

            StringBuilder builder = new StringBuilder();

            builder.Append(@"<div style=""background-color: #EDF0F5; color: #004394; margin-bottom:10px; padding-left:5px; border: solid 1px #9FB0CF; font-size: 18px; font-weight: bold;"" class=""ui-corner-all"">Recent History</div>");

            foreach (ActionLog log in logs)
            {
                builder.Append(string.Format("<div style=\" color: #004394; padding-left:10px; \"><strong>{0}</strong>: {1} - <span style=\"font-style: italic;\">{2}</span></div>", log.CreatorName, log.Description, log.DateCreated.ToString("g", loginUser.CultureInfo)));
            }

            return(builder.ToString());
        }