Ejemplo n.º 1
0
 public void ChangeSignalStatus(Signal s)
 {
     try
     {
         OpenSession();
         OpenTransaction();
         Session.Update(s, s.SignalID);
         CommitTransaction();
     }
     catch (Exception ex)
     {
         LogUtils.Log("Error changing status to signal " + s.SignalID, ex);
         RollbackTransaction();
         throw ex;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the signal.
        /// </summary>
        /// <param name="s">The s.</param>
        public void CreateSignal(Signal s)
        {
            try
            {
                OpenSession();
                OpenTransaction();
                Session.Save(s);
                CommitTransaction();

            }
            catch (Exception ex)
            {
                LogUtils.Log("Error creating signal", ex);
                RollbackTransaction();
                throw ex;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates the XML.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <param name="c">The c.</param>
        protected void CreateXML(Signal s, Comment c)
        {
            base.CreateXML();
            xmlDocument = XmlUtils.Serialize(s);

            if (c != null)
            {
                XmlNode comment = xmlDocument.ImportNode(XmlUtils.Serialize(c).SelectSingleNode("/Comment"), true);
                xmlDocument.DocumentElement.AppendChild(comment);
            }
        }
Ejemplo n.º 4
0
        public Signal AddSignal(Signal s, string ajaxSessionKey)
        {
            CheckRequest(ajaxSessionKey);

            SignalManager sm = new SignalManager();
            s.CategoryName = null;
            s.Description = WebUtils.FormatHtml(s.Description);
            s.CreationDate = DateTime.Now;
            s.UpdateDate = DateTime.Now;
            s.ReopenDescription = string.Empty;

            if (ConfigurationOptions.Current.GetBool("signal_approve_on_submission"))
                s.Status = Signal.SignalStatus.Approved;
            else
                s.Status = Signal.SignalStatus.NotApproved;

            s.UpdateDate = DateTime.Now;
            s.ResolutionDescription = string.Empty;
            sm.CreateSignal(s);

            SignalSubmissionEmail sse = new SignalSubmissionEmail();
            sse.Send(s);

            return s;
        }
Ejemplo n.º 5
0
 private string GetSignalDescription(Signal s)
 {
     SignalDetail sd = (SignalDetail)new UserControl().LoadControl("/Includes/SignalDetail.ascx");
     sd.BuildSignalDescription(s);
     return WebUtils.RenderControlToString(sd);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Builds the signal description.
 /// </summary>
 /// <param name="currentSignal">The current signal.</param>
 public void BuildSignalDescription(Signal currentSignal)
 {
     title.InnerText = currentSignal.Subject;
     address.Text = currentSignal.Address;
     CategoryManager cm = new CategoryManager();
     category.Text = cm.Load(currentSignal.CategoryID).Name;
     lnkDetail.HRef = currentSignal.Link;
     timeframe.Text = SignalUtils.GetTimeframe(currentSignal.CreationDate);
     if (!currentSignal.Attachment.Equals(string.Empty))
     {
         divImage.Visible = true;
         imgImage.ImageUrl = WebUtils.GetImageUrl(UploadPaths.Comments, currentSignal.Attachment);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates the XML.
 /// </summary>
 /// <param name="s">The s.</param>
 protected void CreateXML(Signal s)
 {
     base.CreateXML();
     xmlDocument = XmlUtils.Serialize(s);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Sends the specified s.
 /// </summary>
 /// <param name="s">The s.</param>
 public void Send(Signal s)
 {
     this.CreateXML(s);
     base.Transform();
     base.Send();
 }