Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            int projectID = -1;

            if (!string.IsNullOrEmpty(context.Request.QueryString["projectID"]))
            {
                projectID = int.Parse(context.Request.QueryString["projectID"]);
            }
            UpcomingEvent        todayEvent     = new UpcomingEvent();
            List <UpcomingEvent> upcomingEvents = new EventsApplication().GetEventList(DateTime.Now, UserID, projectID, 10);
            int           itemCount             = 0;
            StringBuilder stringBuilder         = new StringBuilder();

            if (upcomingEvents.Count > 0 && upcomingEvents[0].Day == DateTime.Now.Date)
            {
                todayEvent = upcomingEvents[0];
                stringBuilder.AppendFormat("<div class=\"contentTitle cdtitleeventlist\"> {0}</div>", "Today")
                .Append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"table-advance\">")
                .Append(" <thead><tr><th width=\"110\">Name</th><th>Title</th></tr></thead>")
                .Append("<tbody>");
                for (int i = 0; i < todayEvent.list.Count; i++)
                {
                    itemCount++;
                    SunNet.PMNew.Entity.EventModel.ListView item = todayEvent.list[i];
                    stringBuilder.AppendFormat("<tr {0} class=\"{1}\">", ShowEditEvent(item.ID), i % 2 == 0 ? "" : "whiterow")
                    .AppendFormat("<td width=\"40%\" notAction><img src=\"/images/clock.png\" style=\"vertical-align: middle;\"> {0}</td>", item.Time)
                    .AppendFormat("<td width=\"60%\">{0}</td>", item.Name)
                    .Append("</tr>");
                }
                stringBuilder.Append("</tbody></table>");
            }
            if (itemCount == 0)
            {
                stringBuilder.Append("<div class=\"mainowConbox\" style=\"min-height: 80px;\">")
                .Append("<div class=\"ownothingText\" style=\"color:red\">No scheduled event.</div>")
                .Append("</div>");
            }
            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            int projectID = -1;

            if (!string.IsNullOrEmpty(context.Request.QueryString["projectID"]))
            {
                projectID = int.Parse(context.Request.QueryString["projectID"]);
            }
            List <UpcomingEvent> upcomingEvents = new EventsApplication().GetEventList(DateTime.Now, UserID, projectID, 10);
            StringBuilder        stringBuilder  = new StringBuilder();
            int itemCount = 0;

            foreach (SunNet.PMNew.Entity.EventModel.UpcomingEvent upcomingEvent in upcomingEvents)
            {
                stringBuilder.AppendFormat("<div class=\"pdlistTop\"> {0}</div>", upcomingEvent.Date)
                .Append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"listtwo\">")
                .Append("<tbody>");
                for (int i = 0; i < upcomingEvent.list.Count; i++)
                {
                    itemCount++;
                    SunNet.PMNew.Entity.EventModel.ListView item = upcomingEvent.list[i];
                    stringBuilder.AppendFormat("<tr {0} class=\"{1}\">", ShowEditEvent(item.ID), i % 2 == 0 ? "listrowone" : "listrowtwo")
                    .AppendFormat("<td width=\"40%\" notAction><img src=\"/images/clock.png\" style=\"vertical-align: middle;\"> {0}</td>", item.Time)
                    .AppendFormat("<td width=\"60%\">{0}</td>", item.Name)
                    .Append("</tr>");
                }
                stringBuilder.Append("</tbody></table>");
            }
            if (itemCount == 0)
            {
                stringBuilder.Append("<div class=\"mainowConbox\" style=\"min-height: 80px;\">")
                .Append("<div class=\"ownothingText\">Nothing was scheduled.</div>")
                .Append("</div>");
            }
            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }