Ejemplo n.º 1
0
        /// <summary>
        /// Restart Button Click
        /// </summary>
        protected void RestartBtn_Click(object sender, DirectEventArgs e)
        {
            try {
                var order = new OrderInfo();
                order.LscID      = -1;
                order.TargetID   = -1;
                order.TargetType = EnmNodeType.Null;
                order.OrderType  = EnmActType.Restart;
                order.RelValue1  = Page.User.Identity.Name;
                order.RelValue2  = WebUtility.GetClientIP();
                order.RelValue3  = WebUtility.DefaultString;
                order.RelValue4  = WebUtility.DefaultString;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
                var duration = Int32.Parse(WebConfigurationManager.AppSettings["SyncSettingInterval"]) * 1000;
                Thread.Sleep(duration);
                WebUtility.ShowMessage(EnmErrType.Info, "重启服务命令已下发,请重新登录以获取最新数据!");
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
Ejemplo n.º 2
0
        public void DelLsc(int lscId)
        {
            try {
                var lscEntity = new BLsc();
                lscEntity.DelLsc(lscId);

                var order = new OrderInfo();
                order.LscID      = lscId;
                order.TargetID   = -1;
                order.TargetType = EnmNodeType.Null;
                order.OrderType  = EnmActType.DeleteLsc;
                order.RelValue1  = Page.User.Identity.Name;
                order.RelValue2  = WebUtility.GetClientIP();
                order.RelValue3  = WebUtility.DefaultString;
                order.RelValue4  = WebUtility.DefaultString;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
Ejemplo n.º 3
0
        public void SetAocParms()
        {
            try {
                if (String.IsNullOrEmpty(SettingWindowHF.Text.Trim()))
                {
                    var warningMsg = "获取AO参数时发生错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var ids = WebUtility.ItemSplit(SettingWindowHF.Text.Trim());
                if (ids.Length != 3)
                {
                    var warningMsg = "AO参数格式错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var lscId       = Int32.Parse(ids[0]);
                var nodeId      = Int32.Parse(ids[1]);
                var nodeType    = Int32.Parse(ids[2]);
                var enmNodeType = Enum.IsDefined(typeof(EnmNodeType), nodeType) ? (EnmNodeType)nodeType : EnmNodeType.Null;
                var lscUser     = UserData.LscUsers.Find(lu => { return(lu.LscID == lscId); });
                if (lscUser == null)
                {
                    var warningMsg = "无法获取用户信息,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var order = new OrderInfo();
                order.LscID      = lscId;
                order.TargetID   = nodeId;
                order.TargetType = enmNodeType;
                order.OrderType  = EnmActType.SetAoc;
                order.RelValue1  = (double.MinValue == SettingSpinnerField.Number ? 0 : SettingSpinnerField.Number).ToString("0.000");
                order.RelValue2  = lscId.ToString();
                order.RelValue3  = lscUser.UserID.ToString();
                order.RelValue4  = lscUser.UserName;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            } finally {
                SettingSpinnerField.Number = 0;
                SettingWindow.Hide();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Request Node
        /// </summary>
        /// <param name="node">node</param>
        private void RequestNode(NodeInfo node)
        {
            try {
                var order = new OrderInfo();
                order.LscID      = node.LscID;
                order.TargetID   = node.NodeID;
                order.TargetType = node.NodeType;
                order.OrderType  = EnmActType.RequestNode;
                order.RelValue1  = WebUtility.DefaultString;
                order.RelValue2  = WebUtility.DefaultString;
                order.RelValue3  = WebUtility.DefaultString;
                order.RelValue4  = WebUtility.DefaultString;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch { throw; }
        }