private DispatchedMessageInfo GetDispatchedInfo(MessageItem message, VisitData visitData, PlanData planData)
        {
            MessageStateInfo      messageStateInfo = this.GetMessageStateInfo(message);
            DispatchedMessageInfo info3            = new DispatchedMessageInfo();

            info3.ID             = messageStateInfo.ID;
            info3.Name           = messageStateInfo.Name;
            info3.State          = messageStateInfo.Status;
            info3.Date           = messageStateInfo.Updated;
            info3.Sent           = messageStateInfo.Sent;
            info3.NumSubscribers = messageStateInfo.NumSubscribers;
            info3.MessageState   = messageStateInfo.MessageState;
            DispatchedMessageInfo info2 = info3;
            int emailCount = -1;

            if (planData != null)
            {
                PlanStatistics planStatistics = AnalyticsFactory.Instance.GetPlanStatistics(planData);
                info2.OpenRate  = planStatistics.GetOpenRate();
                info2.ClickRate = planStatistics.GetClickRate();
                emailCount      = planStatistics.GetActual();
            }
            if (visitData != null)
            {
                info2.ValuePerVisit = visitData.ValuePerVisit;
                if (emailCount > -1)
                {
                    VisitStatistics visitStatistics = AnalyticsFactory.Instance.GetVisitStatistics(visitData);
                    info2.ValuePerEmail  = visitStatistics.GetValuePerEmail(emailCount);
                    info2.VisitsPerEmail = visitStatistics.GetVisitPerEmail(emailCount);
                }
            }
            return(info2);
        }
示例#2
0
        private TrickleInfo GetTrickleInfo(MessageItem message, VisitData visitData, PlanData planData)
        {
            MessageStateInfo messageStateInfo = this.GetMessageStateInfo(message);
            TrickleInfo      info3            = new TrickleInfo();

            info3.ID     = messageStateInfo.ID;
            info3.Name   = messageStateInfo.Name;
            info3.HasAbn = messageStateInfo.HasAbn;
            TrickleInfo info2      = info3;
            int         emailCount = -1;

            if (planData != null)
            {
                PlanStatistics planStatistics = this.analyticsFactory.GetPlanStatistics(planData);
                info2.OpenRate   = planStatistics.GetOpenRate();
                info2.Recipients = planStatistics.GetTotal();
                emailCount       = planStatistics.GetActual();
            }
            if (visitData != null)
            {
                info2.ValuePerVisit = visitData.ValuePerVisit;
                if (emailCount > -1)
                {
                    info2.ValuePerEmail = this.analyticsFactory.GetVisitStatistics(visitData).GetValuePerEmail(emailCount);
                }
            }
            return(info2);
        }