Example #1
0
        public static void SendReport(string group, int?pxid, string data)
        {
            ReportLinkGroup linkGroup = ReportLinkGroup.CreateManager().Load(group);

            if (group == null)
            {
                return;
            }

            List <ReportLink> links = ReportLink.CreateManager().Load(linkGroup);

            foreach (ReportLink link in links)
            {
                if (!link.IsActive)
                {
                    continue;
                }

                string url = link.Url.Replace("[pxid]", pxid.ToString()).Replace("[data]", data);
                Log.Info("REPORT: url:" + url);

                Report report = new Report(-1, link, pxid, data, DateTime.Now, DateTime.Now);
                report.Url = url;
                Task.Factory.StartNew(report.SendRequest);
                report.Insert();
            }
        }
Example #2
0
        public static void SendLiveReport(string klass, string text)
        {
            ReportLinkGroup group = ReportLinkGroup.CreateManager().Load("live");
            ReportLink      link  = ReportLink.CreateManager().Load(group).FirstOrDefault();

            if (link == null)
            {
                return;
            }

            string url = link.Url.Replace("[data]", text).Replace("[klass]", klass);

            Report report = new Report(-1, link, null, url, DateTime.Now, DateTime.Now);

            report.Url = url;
            Task.Factory.StartNew(report.SendRequest);
            report.Insert();
        }
Example #3
0
 public ReportLink(int id, ReportLinkGroup reportLinkGroup, string url, bool isActive, DateTime updated, DateTime created) : base(id, updated, created, false)
 {
     this._reportLinkGroup = reportLinkGroup;
     this._url             = url;
     this._isActive        = isActive;
 }