示例#1
0
文件: Timer.aspx.cs 项目: dun3/dun3
        public static Container GetLogItemz(string lastLogId)
        {
            System.Threading.Thread.Sleep(500);

            LogService.LogServiceContractClient client = new LogViewerTest.LogService.LogServiceContractClient();

            var itemz = client.FindSummaryLogItemzByIncidentId(incidentId);
            itemz.Sort((i, j) => j.Id.CompareTo(i.Id));

            Container c = new Container();

            c.LastId = itemz.Max(a => a.Id);

            int lastId = 0;
            if (int.TryParse(lastLogId, out lastId))
            {
                itemz = (from s in itemz
                         where s.Id > lastId
                         select s).ToList();
            }
            c.Text = string.Empty;
            foreach (var item in itemz)
            {
                c.Text += item.Id + ": " + item.Summary + " - ";
            }

            return c;
        }
示例#2
0
        protected override void OnDataBinding(EventArgs e)
        {
            base.OnDataBinding(e);
            using (LogService.LogServiceContractClient c = new LogViewerTest.LogService.LogServiceContractClient())
            {
                LogItemDTO dto = c.FindLogItem(new LogViewerTest.Service.Log.DTO.LogIdDTO() { Id = GetId() });

                lblId.Text = dto.Id.ToString();
                lblMessage.Text = dto.Message;
                lblTitle.Text = dto.Title;
            }
        }