示例#1
0
        private void LoadTickets()
        {
            List <project_detail> tickets = ProjectsDB.GetProjectTickets(this_project);

            ltlTicketCount.Text = tickets.Count().ToString();

            StringBuilder sb = new StringBuilder();

            sb.Append("<table id='tblTickets' class='display'>");

            sb.Append("<thead>");
            sb.Append("<th><strong>ID</strong></th>");
            sb.Append("<th><strong>Title</strong></th>");
            sb.Append("<th class='text-center'><strong>Created By</strong></th>");
            sb.Append("<th class='text-center'><strong>Created Date</strong></th>");
            sb.Append("<th><strong>Status</strong></th>");
            sb.Append("<th><strong>Priority</strong></th>");
            sb.Append("<th><strong>Assigned To</strong></th>");
            sb.Append("</thead>");

            sb.Append("<tbody>");

            foreach (project_detail ticket in tickets)
            {
                sb.Append("<tr>");

                sb.AppendFormat("<td>{0}</td>", TicketsDB.GenerateTicketNumber(TicketsDB.GetTicketHeader(ticket.ticket_id)));
                sb.AppendFormat("<td>{0}</td>", ticket.title);
                sb.AppendFormat("<td>{0}</td>", ticket.created_by);
                sb.AppendFormat("<td>{0: dd/MM/yyyy}</td>", ticket.created_date);
                sb.AppendFormat("<td>{0}</td>", ticket.status);
                sb.AppendFormat("<td>{0}</td>", ticket.priority);
                sb.AppendFormat("<td>{0}</td>", ticket.dev);

                sb.Append("</tr>");
            }

            sb.Append("</tbody>");
            sb.Append("</table>");

            ltlTicketsOpen.Text = sb.ToString();
        }