예제 #1
0
        /// <summary>
        /// Refresh Bat Window
        /// </summary>
        protected void OnWndRefresh(object sender, StoreRefreshDataEventArgs e)
        {
            try {
                var start = Int32.Parse(e.Parameters["start"]);
                var limit = Int32.Parse(e.Parameters["limit"]);
                var end   = start + limit;
                var data  = new List <object>(limit);

                var userData = UserData;
                var cacheKey = WebUtility.GetCacheKeyName(userData, "his-div-wnd");
                var records  = HttpRuntime.Cache[cacheKey] as List <IDValuePair <NodeInfo, HisDIVInfo> >;
                if (records == null)
                {
                    records = AddDataToCache();
                }
                if (records != null && records.Count > 0)
                {
                    if (end > records.Count)
                    {
                        end = records.Count;
                    }
                    for (int i = start; i < end; i++)
                    {
                        data.Add(new {
                            ID         = i + 1,
                            LscID      = records[i].ID.LscID,
                            LscName    = records[i].ID.LscName,
                            Area1Name  = records[i].ID.Area1Name,
                            Area2Name  = records[i].ID.Area2Name,
                            Area3Name  = records[i].ID.Area3Name,
                            StaName    = records[i].ID.StaName,
                            DevName    = records[i].ID.DevName,
                            NodeID     = records[i].ID.NodeID,
                            NodeName   = records[i].ID.NodeName,
                            Value      = records[i].Value.Value,
                            ValueDesc  = records[i].Value.ValueDesc,
                            UpdateTime = WebUtility.GetDateString(records[i].Value.UpdateTime)
                        });
                    }
                }

                e.Total             = (records != null ? records.Count : 0);
                WndStore.DataSource = data;
                WndStore.DataBind();
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
예제 #2
0
        /// <summary>
        /// Refresh Window
        /// </summary>
        protected void OnWndRefresh(object sender, StoreRefreshDataEventArgs e)
        {
            try {
                var start = Int32.Parse(e.Parameters["start"]);
                var limit = Int32.Parse(e.Parameters["limit"]);
                var end   = start + limit;
                var data  = new List <object>(limit);

                var userData = UserData;
                var cacheKey = WebUtility.GetCacheKeyName(userData, "detail-wnd-report-120");
                var nodes    = HttpRuntime.Cache[cacheKey] as List <Report120Node>;
                if (nodes == null)
                {
                    nodes = AddDataToCache();
                }
                if (nodes != null && nodes.Count > 0)
                {
                    if (end > nodes.Count)
                    {
                        end = nodes.Count;
                    }
                    for (int i = start; i < end; i++)
                    {
                        data.Add(new {
                            ID        = i + 1,
                            LscName   = nodes[i].LscName,
                            Area1Name = nodes[i].Area1Name,
                            Area2Name = nodes[i].Area2Name,
                            Area3Name = nodes[i].Area3Name,
                            StaName   = nodes[i].StaName,
                            DevName   = nodes[i].DevName,
                            NodeName  = nodes[i].NodeName,
                            First     = WebUtility.GetDateString(nodes[i].First),
                            Last      = WebUtility.GetDateString(nodes[i].Last)
                        });
                    }
                }

                e.Total             = (nodes != null ? nodes.Count : 0);
                WndStore.DataSource = data;
                WndStore.DataBind();
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }