Ejemplo n.º 1
0
        private void PauseBtn_MouseDown(object sender, MouseButtonEventArgs e)
        {
            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure you want to pause/resume the campaign?", "Confirmation", System.Windows.MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                if (Status.Text != "Active")
                {
                    CampaignManagement campaignManagement = new CampaignManagement(UserId, DateTime.Today, CampaignId: CampId, CampaignStatus: "Active");
                    campaignManagement.ProcessSuccess += Success;
                    campaignManagement.ProcessFail    += Failed;
                    campaignManagement.Update();
                    PauseBtn.DisplayText = "Resume";
                    PauseBtn.ImgSource   = new BitmapImage(
                        new Uri("pack://application:,,,/Mailarn;component/icos/play.png"));
                }
                else
                {
                    CampaignManagement campaignManagement = new CampaignManagement(UserId, DateTime.Today, CampaignId: CampId, CampaignStatus: "Paused");
                    campaignManagement.ProcessSuccess += Success;
                    campaignManagement.ProcessFail    += Failed;
                    campaignManagement.Update();
                    PauseBtn.DisplayText = "Pause";
                    PauseBtn.ImgSource   = new BitmapImage(
                        new Uri("pack://application:,,,/Mailarn;component/icos/pause.png"));
                }
            }
            else
            {
                //Nothing
            }
        }
Ejemplo n.º 2
0
        private void AddCampBtn_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Random rand = new Random();

            if (CampId == 0)
            {
                CampId = rand.Next(100, 999);
            }
            string[]           tmpnameid          = TemplatesTb.Text.Split(new string[] { "XX" }, StringSplitOptions.None);
            string             test               = tmpnameid[0];
            CampaignManagement campaignManagement = new CampaignManagement(UserId, CampDate.DisplayDate, CampaignNameTb.Text, CampId, CampaignDtlsTb.Text, "Active", ListTb.Text, SubjectTb.Text, SenderMailtb.Text, Convert.ToInt32(tmpnameid[0]), tmpnameid[1]);

            campaignManagement.ProcessSuccess += Success;
            campaignManagement.ProcessFail    += Failed;
            if (AddCampBtn.DisplayText != "Update")
            {
                campaignManagement.Add();
            }
            else
            {
                campaignManagement.Update();
            }
        }