protected override void SendAddtionalNotification() { Hashtable args = new Hashtable(); args = Base.GetParameter(this.ToString(), nc.ToString()); string mailcc; string managerId; int day1, day2, day3, day4, day5; if (args == null || args.Count != 5) { day1 = 1; day2 = 2; day3 = 3; day4 = 4; day5 = 5; } else { day1 = int.Parse(args["day1"].ToString()); day2 = day1 + int.Parse(args["day2"].ToString()); day3 = day2 + int.Parse(args["day3"].ToString()); day4 = day3 + int.Parse(args["day4"].ToString()); day5 = day4 + int.Parse(args["day5"].ToString()); } string[] title = new string[] { "产品", "区域", "客户代码", "客户简称", "业务", "姓名", "未逾期", "逾期款", "本月到期", "逾期" + day1 + "月", "逾期" + day2 + "月", "逾期" + day3 + "月", "逾期" + day4 + "月", "逾期" + day5 + "月", "超过" + day5 + "月", "账款合计", "本月应收", "逾期应收", "本月总应收" }; int[] width = new int[] { 40, 40, 70, 80, 60, 60, 80, 80, 80, 80, 80, 80, 80, 80, 80, 90, 80, 80, 80 }; string[] p = new string[] { }; foreach (DataRow row in nc.GetDataTable("tblresult").Rows) { if (p.Contains(row["userno"].ToString())) { continue; } Array.Resize(ref p, p.Length + 1); p.SetValue(row["userno"].ToString(), p.Length - 1); nc.GetDataTable("tblresult").DefaultView.RowFilter = " userno='" + row["userno"].ToString() + "'"; NotificationContent msg = new NotificationContent(); //msg.AddTo("*****@*****.**"); //抄送给直属主管 //msg.AddTo(row["userno"].ToString() + "@" + Base.GetMailAccountDomain()); //mailcc = GetManagerIdByEmployeeIdFromOA(row["userno"].ToString()); //if (mailcc.ToString() != "") //{ // mailcc = mailcc + "@" + Base.GetMailAccountDomain(); // msg.AddCc(mailcc); //} msg.AddTo(GetMailAddressByEmployeeIdFromOA(row["userno"].ToString())); managerId = GetManagerIdByEmployeeIdFromOA(row["userno"].ToString()); if (managerId != null && managerId.ToString() != "" && !managerId.ToString().Equals("C0002") && !managerId.ToString().Equals("C0616")) { msg.AddCc(GetMailAddressByEmployeeIdFromOA(managerId)); } msg.subject = this.subject; msg.content = GetContent(nc.GetDataTable("tblresult").DefaultView.ToTable(), title, width); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { string table1; string[] p = new string[] { }; string[] d = new string[] { }; NotificationContent msg = new NotificationContent(); foreach (DataRow row in nc.GetDataTable("tbresult").Rows) { if (!p.Contains(row["userno"].ToString())) { Array.Resize(ref p, p.Length + 1); p.SetValue(row["userno"].ToString(), p.Length - 1); //string userno = row["userno"].ToString(); msg.AddTo(GetMailAddressByEmployeeIdFromOA(row["userno"].ToString())); } } table1 = GetHTMLTable(nc.GetDataTable("tbresult").DefaultView.ToTable(), null, null); if (nc.GetDataTable("tbresult").DefaultView.ToTable().Rows.Count > 0) { table1 = "以下已点收GB 物料 ,请技术人员配合检验 <br/>" + table1; } msg.AddCc("*****@*****.**"); msg.AddCc("*****@*****.**"); msg.AddCc("*****@*****.**"); msg.AddCc("*****@*****.**"); msg.AddBcc("*****@*****.**"); msg.subject = this.subject; msg.content = GetContentHead() + table1 + GetContentFooter(); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); }
protected override void SendAddtionalNotification() { string deptid; string managerId; string table1; string[] p = new string[] { }; foreach (DataRow row in nc.GetDataTable("tbprivatecar").Rows) { deptid = row["hdn_dept"].ToString().Substring(0, 2) + "000"; if (p.Contains(deptid)) { continue; } //if (row["id"].ToString().Substring(0, 1).Equals("H") || row["id"].ToString().Substring(0, 1).Equals("Q") || row["id"].ToString().Substring(0, 1).Equals("V")) continue; Array.Resize(ref p, p.Length + 1); p.SetValue(deptid, p.Length - 1); nc.GetDataTable("tbprivatecar").DefaultView.RowFilter = "hdn_dept like'" + row["hdn_dept"].ToString().Substring(0, 2) + "%'"; table1 = GetHTMLTable(nc.GetDataTable("tbprivatecar").DefaultView.ToTable(), null, null); if (nc.GetDataTable("tbprivatecar").DefaultView.ToTable().Rows.Count > 0) { table1 = "以下各部门私车公用人员每月私车公用的汇总表<br/>" + table1; } NotificationContent msg = new NotificationContent(); //发送给部门主管(大部门) managerId = GetManagerIdByDeptidFromOA(deptid); if (managerId == null || managerId == "") { table1 = "未找到单据 , 部门:" + deptid; msg.AddTo(GetMailAddressByEmployeeIdFromOA("C1491")); continue; } else if (managerId.ToString() != "") { msg.AddTo(GetMailAddressByEmployeeIdFromOA(managerId)); //msg.AddTo(GetMailAddressByEmployeeIdFromOA("C1491")); } msg.subject = this.subject; msg.content = GetContentHead() + table1 + GetContentFooter(); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { string table1; string[] p = new string[] { }; foreach (DataRow row in nc.GetDataTable("tbresult").Rows) { if (p.Contains(row["userno"].ToString())) { continue; } //if (row["id"].ToString().Substring(0, 1).Equals("H") || row["id"].ToString().Substring(0, 1).Equals("Q") || row["id"].ToString().Substring(0, 1).Equals("V")) continue; Array.Resize(ref p, p.Length + 1); p.SetValue(row["userno"].ToString(), p.Length - 1); nc.GetDataTable("tbresult").DefaultView.RowFilter = " userno ='" + row["userno"].ToString() + "'"; table1 = GetHTMLTable(nc.GetDataTable("tbresult").DefaultView.ToTable(), null, null); if (nc.GetDataTable("tbresult").DefaultView.ToTable().Rows.Count > 0) { table1 = "以下采购单未交货明细汇总表<br/>" + table1; } NotificationContent msg = new NotificationContent(); //string userno = row["userno"].ToString(); msg.AddTo(GetMailAddressByEmployeeIdFromOA(row["userno"].ToString())); //msg.AddCc(GetMailAddressByEmployeeIdFromOA(row["buyer"].ToString())); //string str1 = "</br>" + userno; //msg.AddCc(GetMailAddressByEmployeeIdFromOA("C1491")); msg.subject = this.subject; msg.content = GetContentHead() + table1 + GetContentFooter(); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { string managerId; string table1, table2; string[] p = new string[] { }; DataTable tbl; foreach (DataRow row in nc.GetDataTable("tblprocess").Rows) { if (row["id"].ToString().Substring(0, 1).Equals("H") || row["id"].ToString().Substring(0, 1).Equals("Q") || row["id"].ToString().Substring(0, 1).Equals("V") || row["id"].ToString().Substring(0, 1).Equals("Y") || row["id"].ToString().Substring(0, 1).Equals("R")) { continue; } if (p.Contains(row["id"].ToString())) { continue; } Array.Resize(ref p, p.Length + 1); p.SetValue(row["id"].ToString(), p.Length - 1); nc.GetDataTable("tblprocess").DefaultView.RowFilter = " id='" + row["id"].ToString() + "'"; tbl = nc.GetDataTable("tblprocess").DefaultView.ToTable(); tbl.Columns.Remove("deptno"); tbl.Columns.Remove("dept"); table1 = GetHTMLTable(tbl, null, null); nc.GetDataTable("tblprocess").DefaultView.RowFilter = " id='" + row["id"].ToString() + "' AND delaydays > 5 "; tbl = nc.GetDataTable("tblprocess").DefaultView.ToTable(); tbl.Columns.Remove("deptno"); tbl.Columns.Remove("dept"); if (tbl.Rows.Count > 0) { table2 = "以下单据已超过5天,请向柯副董说明原因!<br/>" + GetHTMLTable(tbl, null, null); } else { table2 = "没有超过5天及以上的未签核单据"; } NotificationContent msg = new NotificationContent(); //msg.AddTo("*****@*****.**"); msg.AddTo(GetMailAddressByEmployeeIdFromOA(row["id"].ToString())); if (nc.GetDataTable("tblprocess").DefaultView.ToTable().Rows.Count > 0) { //抄送直属主管 managerId = GetManagerIdByEmployeeIdFromOA(row["id"].ToString()); if (managerId != null && managerId.ToString() != "" && !managerId.ToString().Equals("C0002") && !managerId.ToString().Equals("C0616")) { msg.AddCc(GetMailAddressByEmployeeIdFromOA(managerId)); } if (!row["id"].ToString().Substring(0, 1).Equals("0") && !row["id"].ToString().Equals("C0002")) { msg.AddCc("*****@*****.**"); } } msg.subject = row["deptno"].ToString() + row["dept"].ToString() + "_" + this.subject; msg.content = GetContentHead() + table1 + "<br/><br/><br/>" + table2 + GetContentFooter(); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }