This commit is contained in:
2024-05-09 16:19:20 +08:00
parent 662829cff8
commit 42cb326102
17 changed files with 367 additions and 2024 deletions
+31 -11
View File
@@ -180,7 +180,7 @@ namespace FineUIPro.Web.SES
protected void btnEmail_Click(object sender, EventArgs e)
{
List<Model.View_EMC_Punishment> pList = (from x in Funs.DB.View_EMC_Punishment
where x.Flag == "1"
where x.Flag == "1" && x.EmailIsSend == "否" && x.BYCRU != null && x.BYCRU.ToLower() != "none"
&& (x.PunishDate.Value.Year + x.PunishDate.Value.Month) == (DateTime.Now.Year + DateTime.Now.Month)
select x).ToList();
if (pList.Count()>0)
@@ -255,10 +255,16 @@ namespace FineUIPro.Web.SES
string mailSubject = TemplateHelper.BulidByFile2(EmailName, myCol1);
result = MailHelper.SendPunishMail(pops, pops.EmailYx, mailTo, mailSubject, mailBody, mailAttch, mailCode, mailPriority, mailCC, pList, out resultMessage);
// 发送成功后写入表中
if (result == true)
{
//p.EmailIsSend = true;
//Funs.DB.SubmitChanges();
foreach (var p in pList)
{
var punish = BLL.PunishmentService.GetPunishmentById(p.PunishmentId);
punish.EmailIsSend = true;
Funs.DB.SubmitChanges();
}
ShowNotify("Email sent successfully!", MessageBoxIcon.Success);
}
else
@@ -494,26 +500,40 @@ namespace FineUIPro.Web.SES
if (reportModel.GetRow(i).GetCell(15) == null) reportModel.GetRow(i).CreateCell(15);
reportModel.GetRow(i).GetCell(15).SetCellValue(Grid1.Rows[i - 1].Values[16].ToString());
reportModel.GetRow(i).GetCell(15).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Violation Inspector
// BYC Resp Manager
if (reportModel.GetRow(i).GetCell(16) == null) reportModel.GetRow(i).CreateCell(16);
reportModel.GetRow(i).GetCell(16).SetCellValue(Grid1.Rows[i - 1].Values[17].ToString());
reportModel.GetRow(i).GetCell(16).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Inspection Department
// Violation Inspector
if (reportModel.GetRow(i).GetCell(17) == null) reportModel.GetRow(i).CreateCell(17);
reportModel.GetRow(i).GetCell(17).SetCellValue(Grid1.Rows[i - 1].Values[18].ToString());
reportModel.GetRow(i).GetCell(17).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge SES No.
// Inspection Department
if (reportModel.GetRow(i).GetCell(18) == null) reportModel.GetRow(i).CreateCell(18);
reportModel.GetRow(i).GetCell(18).SetCellValue(Grid1.Rows[i - 1].Values[19].ToString());
reportModel.GetRow(i).GetCell(18).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge Completion Date
// Backcharge SES No.
if (reportModel.GetRow(i).GetCell(19) == null) reportModel.GetRow(i).CreateCell(19);
if (Grid1.Rows[i - 1].Values[20] != null && Grid1.Rows[i - 1].Values[20].ToString() != "")
reportModel.GetRow(i).GetCell(19).SetCellValue(Grid1.Rows[i - 1].Values[20].ToString());
reportModel.GetRow(i).GetCell(19).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge Completion Date
if (reportModel.GetRow(i).GetCell(20) == null) reportModel.GetRow(i).CreateCell(20);
if (Grid1.Rows[i - 1].Values[21] != null && Grid1.Rows[i - 1].Values[21].ToString() != "")
{
DateTime cdate = Convert.ToDateTime(Grid1.Rows[i - 1].Values[20]);
reportModel.GetRow(i).GetCell(19).SetCellValue(cdate.ToString("yyyy/MM/dd"));
reportModel.GetRow(i).GetCell(19).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
DateTime cdate = Convert.ToDateTime(Grid1.Rows[i - 1].Values[21]);
reportModel.GetRow(i).GetCell(20).SetCellValue(cdate.ToString("yyyy/MM/dd"));
reportModel.GetRow(i).GetCell(20).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
}
// Violation Related SES
if (reportModel.GetRow(i).GetCell(21) == null) reportModel.GetRow(i).CreateCell(21);
reportModel.GetRow(i).GetCell(21).SetCellValue(Grid1.Rows[i - 1].Values[22].ToString());
reportModel.GetRow(i).GetCell(21).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// If send mail
if (reportModel.GetRow(i).GetCell(22) == null) reportModel.GetRow(i).CreateCell(22);
reportModel.GetRow(i).GetCell(22).SetCellValue(Grid1.Rows[i - 1].Values[23].ToString());
reportModel.GetRow(i).GetCell(22).CellStyle.SetFont(cs_content_Font);
#endregion
}