Beispiel #1
0
        void SendSms(int id)
        {
            var biz    = new DeliveryBiz();
            var status = biz.SendSms(id, currentUser.FullName);

            if (!string.IsNullOrEmpty(status.Error))
            {
                MessageBox.Show(status.Error);
            }
            biz.UpdateSmsStatus(id, status.Status);
        }
Beispiel #2
0
        private void WorkAsync(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            if (flagSendMailOrder)
            {
                var biz    = new OrderBiz();
                var status = biz.SendEmail(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
                biz.UpdateEmailStatus(Convert.ToInt32(e.Argument), status.Status);
            }

            if (flagSendSmsOrder)
            {
                var biz = new OrderBiz();

                string content = biz.GetSmsContent(Convert.ToInt32(e.Argument));
                var    result  = MessageBox.Show(content, string.Empty, MessageBoxButtons.OKCancel);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    var status = biz.SendSms(Convert.ToInt32(e.Argument), currentUser.FullName);
                    if (!string.IsNullOrEmpty(status.Error))
                    {
                        MessageBox.Show(status.Error);
                    }
                    biz.UpdateSmsStatus(Convert.ToInt32(e.Argument), status.Status);
                }
            }

            if (flagSendSmsNotification)
            {
                var    biz     = new OrderBiz();
                string content = biz.GetContentReport(Convert.ToInt32(e.Argument));

                var result = MessageBox.Show(content, string.Empty, MessageBoxButtons.OKCancel);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    var status = biz.SendReport(Convert.ToInt32(e.Argument));

                    if (!string.IsNullOrEmpty(status.Error))
                    {
                        MessageBox.Show(status.Error);
                    }
                    biz.UpdateNotificationStatus(Convert.ToInt32(e.Argument), status.Status);
                }
            }

            if (flagSendMail)
            {
                var biz    = new DeliveryBiz();
                var status = biz.SendEmail(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
            }

            if (flagSendSms)
            {
                var biz    = new DeliveryBiz();
                var status = biz.SendSms(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
            }
        }
Beispiel #3
0
        private void WorkAsync(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            if (flagSendMailOrder)
            {
                var biz = new OrderBiz();
                var status = biz.SendEmail(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
                biz.UpdateEmailStatus(Convert.ToInt32(e.Argument), status.Status);
            }

            if (flagSendSmsOrder)
            {
                var biz = new OrderBiz();

                string content = biz.GetSmsContent(Convert.ToInt32(e.Argument));
                var result = MessageBox.Show(content, string.Empty, MessageBoxButtons.OKCancel);
                if(result == System.Windows.Forms.DialogResult.OK)
                {
                    var status = biz.SendSms(Convert.ToInt32(e.Argument), currentUser.FullName);
                    if (!string.IsNullOrEmpty(status.Error))
                    {
                        MessageBox.Show(status.Error);
                    }
                    biz.UpdateSmsStatus(Convert.ToInt32(e.Argument), status.Status);
                }
            }

            if (flagSendSmsNotification)
            {
                var biz = new OrderBiz();
                string content = biz.GetContentReport(Convert.ToInt32(e.Argument));

                var result = MessageBox.Show(content, string.Empty, MessageBoxButtons.OKCancel);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    var status = biz.SendReport(Convert.ToInt32(e.Argument));

                    if (!string.IsNullOrEmpty(status.Error))
                    {
                        MessageBox.Show(status.Error);
                    }
                    biz.UpdateNotificationStatus(Convert.ToInt32(e.Argument), status.Status);
                }
            }

            if (flagSendMail)
            {
                var biz = new DeliveryBiz();
                var status = biz.SendEmail(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
            }

            if (flagSendSms)
            {
                var biz = new DeliveryBiz();
                var status = biz.SendSms(Convert.ToInt32(e.Argument), currentUser.FullName);
                if (!string.IsNullOrEmpty(status.Error))
                {
                    MessageBox.Show(status.Error);
                }
            }
        }
Beispiel #4
0
 void SendSms(int id)
 {
     var biz = new DeliveryBiz();
     var status = biz.SendSms(id, currentUser.FullName);
     if (!string.IsNullOrEmpty(status.Error))
     {
         MessageBox.Show(status.Error);
     }
     biz.UpdateSmsStatus(id, status.Status);
 }