protected override void SendAddtionalNotification() { string[] title = { "公司别", "修改人员", "姓名", "部门代号", "部门名称", "单据类别", "主要影响单据", "修改日期", "业务员", "部门", "事业部", "区域别", "产品别", "整机/零件", "纳入服务", "差异金额" }; int[] width = { 80, 80, 80, 80, 120, 120, 120, 80, 70, 70, 70, 70, 70, 80, 80, 80 }; DataTable dt = nc.GetDataTable("tbl"); this.content = this.GetContent(dt, title, width); string[] optstr = new string[] { }; foreach (DataRow item in dt.Rows) { if (optstr.Contains(item["applyUser"].ToString())) { continue; //跳出重复值 } Array.Resize(ref optstr, optstr.Length + 1); optstr.SetValue(item["applyUser"].ToString(), optstr.Length - 1); dt.DefaultView.RowFilter = "applyUser='******'"; NotificationContent msg = new NotificationContent(); var sndDT = dt.DefaultView.ToTable(); this.setTableSum(sndDT); msg.content = this.GetContent(sndDT, title, width); msg.subject = this.subject; String bb = item["applyUser"].ToString().Trim() + "@" + Base.GetMailAccountDomain(); msg.AddTo(item["applyUser"].ToString() + "@" + Base.GetMailAccountDomain()); //msg.AddTo("C1749" + "@" + Base.GetMailAccountDomain()); String deptno = item["appDept"].ToString().Substring(0, 2) + "000"; msg.AddCc(GetManagerOIDByDeptnoFromOA(deptno)); msg.AddCc(GetManagerIdByEmployeeIdFromOA(item["applyUser"].ToString().Trim())); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { string[] title = { "案件代號", "維修單別", "維修單號", "維修序號", "客戶代號", "客戶全名", "產品品號", "產品品名", "產品規格", "送修", "送修部门", "维修人员", "维修部门", "产品序号", "产品别", "区域别", "需核銷", "已核銷", "強制結案", "部門代號", "ERP服務領料單號", "ERP服務退料單號", "ERP借出單號", "ERP歸還單號", "品號", "品名", "實領數量" }; int[] width = { 150, 50, 150, 30, 100, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 50 }; string[] depts = new string[] { }; foreach (DataRow item in this.nc.GetDataTable("CRM_WeiTuiWuLiao").Rows) { if (depts.Contains(item["TC017"].ToString())) { continue; //跳出重复值 } Array.Resize(ref depts, depts.Length + 1); depts.SetValue(item["TC017"].ToString(), depts.Length - 1); this.nc.GetDataTable("CRM_WeiTuiWuLiao").DefaultView.RowFilter = "TC017='" + item["TC017"].ToString() + "'"; NotificationContent msg = new NotificationContent(); msg.content = GetContent(nc.GetDataTable("CRM_WeiTuiWuLiao").DefaultView.ToTable(), title, width); msg.subject = this.subject; msg.AddTo(item["TC017"].ToString() + "@hanbell.com.cn"); msg.AddCc(GetManagerIdByDeptIdFromOA(item["TC017"].ToString().Substring(0, 2)) + "@hanbell.com.cn"); //抄送给部门主管 msg.AddCc("C0201" + "@" + Base.GetMailAccountDomain()); //抄送陈海英 msg.AddCc("C0005" + "@" + Base.GetMailAccountDomain()); //抄送余丽萍 msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { string[] title = { "录入人员", "人员姓名", "责任部门", "部门简称", "区域别", "产品别", "案件编号", "客户代号", "客户简称", "产品序号", "客诉类别", "责任判定", "是否客诉", "收费否", "是否在原厂保固期", "问题描述", "接案日期", "原因分析说明", "结案码", "结案日期" }; int[] width = { 80, 80, 80, 80, 120, 120, 120, 80, 80, 80, 80, 80, 80, 80, 80, 100, 80, 80, 80, 80 }; this.content = GetContent(nc.GetDataTable("tlbGuest"), title, width); string[] optstr = new string[] { }; foreach (DataRow item in this.nc.GetDataTable("tlbGuest").Rows) { if (optstr.Contains(item["CREATOR"].ToString())) { continue; //跳出重复值 } Array.Resize(ref optstr, optstr.Length + 1); optstr.SetValue(item["CREATOR"].ToString(), optstr.Length - 1); this.nc.GetDataTable("tlbGuest").DefaultView.RowFilter = "CREATOR='" + item["CREATOR"].ToString() + "'"; NotificationContent msg = new NotificationContent(); msg.content = GetContent(nc.GetDataTable("tlbGuest").DefaultView.ToTable(), title, width); msg.subject = this.subject; String bb = item["CREATOR"].ToString().Trim() + "@" + Base.GetMailAccountDomain(); msg.AddTo(item["CREATOR"].ToString() + "@" + Base.GetMailAccountDomain()); //msg.AddTo("C1749" + "@" + Base.GetMailAccountDomain()); String deptno = item["BQ017"].ToString().Substring(0, 2) + "000"; msg.AddCc(GetManagerOIDByDeptnoFromOA(deptno) + "@" + Base.GetMailAccountDomain()); msg.AddCc(GetManagerIdByEmployeeIdFromOA(item["CREATOR"].ToString().Trim()) + "@" + Base.GetMailAccountDomain()); msg.AddCc("C0201" + "@" + Base.GetMailAccountDomain()); msg.AddCc("C0005" + "@" + Base.GetMailAccountDomain()); msg.AddNotify(new MailNotify()); msg.Update(); msg.Dispose(); } }
protected override void SendAddtionalNotification() { Hashtable args = new Hashtable(); args = Base.GetParameter(this.ToString(), nc.ToString()); string mailcc; 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(GetMailAddressByEmployeeIdFromOA(row["userno"].ToString())); //抄送直接主管 mailcc = GetManagerIdByEmployeeIdFromOA(row["userno"].ToString()); if (mailcc != null && mailcc.ToString() != "") { msg.AddCc(GetMailAddressByEmployeeIdFromOA(mailcc)); //获取上上级主管,如果是华东晋能龙经理,就抄送给他 mailcc = GetManagerIdByEmployeeIdFromOA(mailcc); if (mailcc != null && mailcc.ToString() == "C0045") { msg.AddCc(GetMailAddressByEmployeeIdFromOA(mailcc)); } } 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 table; string[] p = new string[] { }; NotificationContent msg = new NotificationContent(); string[] title = { "申请单号", "申请日期", "输入日期", "申请部门", "部门名称", "部门名称预算中心", "预算中心", "预算中心名称", "申请人员", "申请人员姓名", "输入人员", "输入人员姓名", "申请内容", "借货交易类别", "单价", "数量", "币别", "汇率", "费用金额", "预算科目", "科目名称" }; int[] width = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 60, 60, 60, 60, 60, 60, 60, 100 }; foreach (DataRow row in nc.GetDataTable("tlbpayment").Rows) { if (!p.Contains(row["apusrno"].ToString())) { Array.Resize(ref p, p.Length + 1); p.SetValue(row["apusrno"].ToString(), p.Length - 1); msg.AddTo(GetMailAddressByEmployeeIdFromOA(row["apusrno"].ToString())); //msg.AddTo(GetMailAddressByEmployeeIdFromOA("C1749")); } if (row["apusrno"].ToString() != "" && row["apusrno"].ToString().Equals("C0002")) { msg.AddCc("*****@*****.**"); //msg.AddCc("*****@*****.**"); } } table = GetHTMLTable(nc.GetDataTable("tlbpayment").DefaultView.ToTable(), title, width); if (nc.GetDataTable("tlbpayment").DefaultView.ToTable().Rows.Count > 0) { table = "以下是跨部门请款明细表,请核对 <br/>" + table; } msg.subject = this.subject; msg.content = GetContentHead() + table + 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("tblprocess1").Rows) { if (row["id"].ToString().Substring(0, 1).Equals("H") || row["id"].ToString().Substring(0, 1).Equals("Q")) { 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("tblprocess1").DefaultView.RowFilter = " id='" + row["id"].ToString() + "'"; tbl = nc.GetDataTable("tblprocess1").DefaultView.ToTable(); tbl.Columns.Remove("deptno"); tbl.Columns.Remove("dept"); table1 = GetHTMLTable(tbl, null, null); nc.GetDataTable("tblprocess1").DefaultView.RowFilter = " id='" + row["id"].ToString() + "' AND delaydays > 2 "; tbl = nc.GetDataTable("tblprocess1").DefaultView.ToTable(); tbl.Columns.Remove("deptno"); tbl.Columns.Remove("dept"); if (tbl.Rows.Count > 0) { table2 = "以下单据已超过2天,请向主管说明原因!<br/>" + GetHTMLTable(tbl, null, null); } else { table2 = "没有超过2天及以上的未签核单据"; } NotificationContent msg = new NotificationContent(); //msg.AddTo("*****@*****.**"); string useradd = GetMailAddressByEmployeeIdFromOA(row["id"].ToString()); if (String.IsNullOrEmpty(useradd)) { continue; } msg.AddTo(useradd); if (tbl.Rows.Count > 0) { //抄送直属主管 managerId = GetManagerIdByEmployeeIdFromOA(row["id"].ToString()); string usermanageradd = GetMailAddressByEmployeeIdFromOA(managerId); if (!String.IsNullOrEmpty(usermanageradd)) { msg.AddCc(usermanageradd); } // msg.AddBcc("*****@*****.**"); } 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(); } }