Ejemplo n.º 1
0
        private string GenerateNotificationMessage(CampaignNotification cn)
        {
            switch (cn.Event)
            {
            case CampaignNotificationEvent.CampaignStart:
            {
                return("Voting started");
            }

            case CampaignNotificationEvent.CampaignEnd:
            {
                return("Voting ended");
            }

            case CampaignNotificationEvent.Sending:
            {
                return("Mailing started");
            }

            default:
            {
                return("");
            }
            }
        }
Ejemplo n.º 2
0
        private DateTime GetCampaignNotificationTime(CampaignNotification cn)
        {
            switch (cn.Event)
            {
            case CampaignNotificationEvent.CampaignStart:
            {
                return(cn.Campaign.StartTime);
            }

            case CampaignNotificationEvent.CampaignEnd:
            {
                return(cn.Campaign.EndTime);
            }

            case CampaignNotificationEvent.Sending:
            {
                return(cn.Campaign.SendingTime);
            }

            default:
            {
                return(DateTime.Now);
            }
            }
        }
Ejemplo n.º 3
0
        private DateTime Comparer(CampaignNotification notification)
        {
            switch (notification.Event)
            {
            case CampaignNotificationEvent.CampaignStart:
                return(notification.Campaign.StartTime);

            case CampaignNotificationEvent.CampaignEnd:
                return(notification.Campaign.EndTime);

            case CampaignNotificationEvent.Sending:
                return(notification.Campaign.SendingTime);

            default:
                return(DateTime.MinValue);
            }
        }
 public void Init()
 {
     instance = new CampaignNotification();
 }