/// <summary>
        /// Main Grid Store Refresh
        /// </summary>
        protected void OnMainGridRefresh(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 DataTable();

                var userData = UserData;
                var cacheKey = WebUtility.GetCacheKeyName(userData, "his-alarm-min-interval-source1");
                var source1 = HttpRuntime.Cache[cacheKey] as DataTable;
                if (source1 == null) { source1 = AddDataToCache(); }
                if (source1 != null && source1.Rows.Count > 0) {
                    data = source1.Clone();
                    if (end > source1.Rows.Count) { end = source1.Rows.Count; }
                    for (int i = start; i < end; i++) {
                        data.Rows.Add(source1.Rows[i].ItemArray);
                    }
                }

                e.Total = (source1 != null ? source1.Rows.Count : 0);
                MainGridStore.DataSource = data;
                MainGridStore.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>
        /// Main Grid Store Refresh
        /// </summary>
        protected void OnMainGridRefresh(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 <AlmMaskEntity>(limit);

                var cacheKey = WebUtility.GetCacheKeyName(UserData, "alarm-masking-report");
                var nodes    = HttpRuntime.Cache[cacheKey] as List <AlmMaskEntity>;
                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(nodes[i]);
                    }
                }

                e.Total = (nodes != null ? nodes.Count : 0);
                MainGridStore.DataSource = data;
                MainGridStore.DataBind();
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
示例#3
0
        /// <summary>
        /// Main Grid Store Refresh
        /// </summary>
        protected void OnMainGridRefresh(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 cacheKey = WebUtility.GetCacheKeyName(UserData, "dev-load-report");
                var nodes    = HttpRuntime.Cache[cacheKey] as List <DevLoadPageEntity>;
                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].Device.LscName,
                            Area1Name           = nodes[i].Device.Area1Name,
                            Area2Name           = nodes[i].Device.Area2Name,
                            Area3Name           = nodes[i].Device.Area3Name,
                            StaName             = nodes[i].Device.StaName,
                            DevTypeName         = nodes[i].Device.DevTypeName,
                            DevName             = nodes[i].Device.DevName,
                            SingleRatedCapacity = nodes[i].Device.SingleRatedCapacity * nodes[i].Device.ModuleCount,
                            DevDesignCapacity   = nodes[i].Device.DevDesignCapacity,
                            TotalRatedCapacity  = nodes[i].Device.TotalRatedCapacity,
                            RedundantCapacity   = nodes[i].Device.RedundantCapacity,
                            LoadRate            = nodes[i].Device.DevDesignCapacity > 0 ? String.Format("{0:P2}", nodes[i].Value / nodes[i].Device.DevDesignCapacity) : "",
                            LoadLevel           = nodes[i].Device.DevDesignCapacity > 0 ? GetLoadLevel(nodes[i].SubDev, nodes[i].Value / nodes[i].Device.DevDesignCapacity) : ""
                        });
                    }
                }

                e.Total = (nodes != null ? nodes.Count : 0);
                MainGridStore.DataSource = data;
                MainGridStore.DataBind();
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
        /// <summary>
        /// Main Grid View Refresh
        /// </summary>
        protected void OnMainGridRefresh(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 cacheKey = WebUtility.GetCacheKeyName(UserData, "dev-performance-report");
                var nodes    = HttpRuntime.Cache[cacheKey] as List <HisNodeValueGridInfo>;
                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,
                            LscID      = nodes[i].LscID,
                            LscName    = nodes[i].LscName,
                            NodeID     = nodes[i].ID,
                            NodeName   = nodes[i].Name,
                            Value      = nodes[i].Value,
                            ValueDesc  = nodes[i].ValueDesc,
                            UpdateTime = WebUtility.GetDateString(nodes[i].UpdateTime)
                        });
                    }
                }

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