Пример #1
0
        public int AddComment(Comment c, string ajaxSessionKey)
        {
            CheckRequest(ajaxSessionKey);

            CommentManager cm = new CommentManager();
            c.CreationDate = DateTime.Now;
            c.Text = WebUtils.FormatHtml(c.Text);
            c.Status = Comment.CommentStatus.Approved;
            int ret = cm.AddComment(c);

            SignalAlertEmail sae = new SignalAlertEmail();
            sae.Send(c, c.SignalID);

            return ret;
        }
Пример #2
0
        public void ChangeSignalStatus(int signalID, int newStatus, string description, string sessionKey)
        {
            CheckRequest(sessionKey);

            SignalManager sm = new SignalManager();
            Signal s = sm.LoadSingnal(signalID);
            s.Status = newStatus;

            switch (newStatus)
            {
                case Signal.SignalStatus.ReOpened:
                    s.ReopenDate = DateTime.Now;
                    s.ReopenDescription = WebUtils.FormatHtml(description);
                    break;
                case Signal.SignalStatus.Resolved:
                    s.ResolutionDate = DateTime.Now;
                    s.ResolutionDescription = WebUtils.FormatHtml(description);
                    break;
            }

            sm.ChangeSignalStatus(s);

            SignalAlertEmail email = new SignalAlertEmail();
            email.Send(signalID);
        }