Esempio n. 1
0
        public static bool ProcessAlertFun(int alertID, int _value, int processID, string processName)
        {
            TagAlert.UpdateStatusByAlertId(alertID, AlertStatusType.Resolved);
            string reason = "";

            if (_value == 1)
            {
                reason = "确认报警,并 " + processName;
            }
            else if (_value == 0)
            {
                reason = "误报";
            }
            AlertProcessLog.Insert(alertID, ContextUser.Current.Id, AlertStatusType.Resolved, reason);
            return(true);
        }
        protected void alertProcess_Click(object sender, EventArgs e)
        {
            if (alertResultList.SelectedItem.Text == "其它" && otherReason.Text.Trim().Length == 0)
            {
                feedbacks.Items.AddError("报警原因选择其它时,需要输入具体信息。");
                return;
            }

            TagAlert.UpdateStatusByAlertId(_id, AlertStatusType.Resolved);

            string reason = me.Name + "将报警原因设置为:" + alertResultList.SelectedItem.Text;

            if (otherReason.Text != null && otherReason.Text.Trim().Length > 0)
            {
                reason += "," + otherReason.Text.Trim();
            }
            AlertProcessLog.Insert(_id, me.Id, AlertStatusType.Resolved, reason);
            LoadTagAlert();
        }
Esempio n. 3
0
        protected void setResolved_Click(object sender, EventArgs e)
        {
            IEnumerable <int> idList = Strings.ParseToArray <int>(Request.Form["selection"]);

            if (idList.Count() > 0)
            {
                using (AppDataContext db = new AppDataContext())
                {
                    var alerts = db.TagAlerts.Where(x => idList.Contains(x.AlertId)).ToList();
                    foreach (var item in alerts)
                    {
                        //TagStatusView.ChangeStatus(TagStatusView.SelectTagStatus(item.TagId).Mac, (SupportEvent)item.AlertType, EventStatus.Cleared);
                        //if need to notify server???
                        TagAlert.UpdateStatusByAlertId(item.AlertId, AlertStatusType.Processing);
                        AlertProcessLog.Insert(item.AlertId, me.Id, AlertStatusType.Processing, "处理中");
                    }
                }
            }
            me.TagEventApprizingTimePoint = DateTime.Now;
            Response.Redirect(Fetch.CurrentUrl);
        }