Exemplo n.º 1
0
        public void StepNext()
        {
            if (TaskList.Count > 0 && currentIndex < TaskList.Count)
            {
                Alading.Entity.ConsumerVisit currentObject = TaskList[currentIndex];

                EmailMessage message = BuildEmailMessage(
                    currentObject.Subject,
                    currentObject.Content,
                    Configuration.SmtpAccount,
                    currentObject.Receiver);

                int  tryCount = 0;
                bool result   = false;

                while (tryCount < Configuration.RetryCount)
                {
                    result = this.SnedEmail(message, server);

                    if (result)
                    {
                        break;
                    }

                    tryCount++;
                    System.Threading.Thread.Sleep(Configuration.RetryInterval);
                }

                if (result)
                {
                    success++;
                }
                currentObject.Status = result ? "已发送" : "发送失败";
                Alading.Business.ConsumerVisitService.UpdateConsumerVisit(currentObject);

                currentIndex++;
            }
        }
Exemplo n.º 2
0
 private void gvEmailList_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     int[] rows = gvEmailList.GetSelectedRows();
     selectedEmail = emailList[rows[0]];
     FillEmailInfo();
 }