確認歸檔流程

This commit is contained in:
cesar liu 2022-08-24 09:47:17 +08:00
parent b3b1f1a5b5
commit 70e76c6160

View File

@ -102,6 +102,11 @@ namespace solarApp
//
}
/// <summary>
/// timer 觸發
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
//每日歸檔
@ -122,7 +127,7 @@ namespace solarApp
autoTask = true;
lbMsgTitle.Text = "異常處理 " + DateTime.Now.ToString() + " timer start";
btSyncErr.PerformClick();
lbMsgTitle.Text = "異常處理 done" + DateTime.Now.ToString() ;
lbMsgTitle.Text = "異常處理 done" + DateTime.Now.ToString();
autoTask = false;
}
@ -308,6 +313,8 @@ namespace solarApp
invSvc.report_invDay(item.SiteID.Substring(0, 9), day.ToString("yyyy-MM-dd"));
}
}
#region
sensorSvc.isFirst = true;
foreach (var item in site_list)
{
@ -318,6 +325,7 @@ namespace solarApp
sensorSvc.isFirst = false;
}
}
#endregion
lbMsgTitle.Text = System.DateTime.Now.ToString() + " 完成!";
}
@ -579,8 +587,12 @@ namespace solarApp
MyMail.SubjectEncoding = System.Text.Encoding.UTF8;//郵件標題編碼
MyMail.BodyEncoding = System.Text.Encoding.UTF8; //郵件內容編碼
MyMail.IsBodyHtml = true; //是否使用html格式
var kkk = $"FIC 太陽能電站管理系統通知 <{tbUserName.Text.Trim()}>";
MyMail.From = new System.Net.Mail.MailAddress(kkk); //寄件人
if (tbUserName.Text.Trim().Length > 0)
{
var kkk = $"FIC 太陽能電站管理系統通知 <{tbUserName.Text.Trim()}>";
MyMail.From = new System.Net.Mail.MailAddress(tbUserName.Text.Trim()); //寄件人
}
foreach (var email in recipientEmails)
{
MyMail.To.Add(email); //設定收件者Email
@ -611,7 +623,8 @@ namespace solarApp
if (CanDoSend)
{
SMTPConfig smtp = new SMTPConfig(); ;
smtp.Host = "smtp.gmail.com";
//smtp.Host = "smtp.gmail.com";
smtp.Host = "msa.hinet.net";
//smtp.UserName = "ficgreen01@gmail.com";
//smtp.Password = "qwe2015qwe";
//smtp.UserName = "ficgreen02@gmail.com";
@ -620,8 +633,13 @@ namespace solarApp
//smtp.Password = "wswgnluvoodfexrb";
//smtp.EnableSsl = true;
//smtp.Port = 587;
smtp.UserName = tbUserName.Text;
smtp.Password = tbPassword.Text;
if (tbUserName.Text.Trim().Length > 0)
{
smtp.UserName = tbUserName.Text;
smtp.Password = tbPassword.Text;
}
//smtp.UserName = tbUserName.Text;
//smtp.Password = tbPassword.Text;
if (rbSSL.Checked)
{
smtp.EnableSsl = true;