Beispiel #1
0
 /// <summary>
 /// 发送待办任务
 /// </summary>
 public static void SendDoTask()
 {
     try
     {
         lock (lockObject)
         {
             Log.WriteLog("调用开始SendDoTask()时间:" + DateTime.Now);
             SendMailRTXDAL dal = new SendMailRTXDAL();
             DataTable dt = dal.GetDoTaskList();
             foreach (DataRow dr in dt.Rows)
             {
                 string strRTXAccount = string.Empty;
                 string strEmail = string.Empty;
                 dal.UpDateDoTaskStatus(dr["DOTASKID"].ToString());//修改待办的邮件RTX的状态改为已经发送 1
                 SendIM(dr);
                 UserInfo.GetUserInfo(dr["RECEIVEUSERID"].ToString(), ref strEmail, ref strRTXAccount);
                 SendEmail(dr, strEmail);//发送邮件
                 //SendRTX(dr, strRTXAccount);//发送RTX
             }
             SendDoTaskMessage();//发送待办消息
         }
     }
     catch(Exception ex)
     {
         Log.WriteLog("发送待办任务主入口SendDoTask()方法出错" + ex.Message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 发送待办消息
 /// </summary>
 private static void SendDoTaskMessage()
 {
     try
     {
         SendMailRTXDAL dal = new SendMailRTXDAL();
         DataTable dt = dal.GetDoTaskMessageList();
         foreach (DataRow dr in dt.Rows)
         {
             string strRTXAccount = string.Empty;
             string strEmail = string.Empty;
             dal.UpDateDoTaskMessageStatus(dr["DOTASKMESSAGEID"].ToString());//修改待办消息的邮件RTX的状态改为已经发送 1
             SendIM(dr);
             UserInfo.GetUserInfo(dr["RECEIVEUSERID"].ToString(), ref strEmail, ref strRTXAccount);
             SendEmail(dr, strEmail);//发送邮件
             //SendRTX(dr, strRTXAccount);//发送RTX                  
         }
     }
     catch (Exception ex)
     {
         Log.WriteLog("发送待办消息主入口SendDoTaskMessage()方法出错" + ex.Message);
     }
 }