void btn_Click(object sender, EventArgs e) { string accepters = (Pub1.FindControl("HID_SelectedEmps") as HiddenField).Value;// this.Pub1.GetTextBoxByID("TB_Accepter").Text; accepters = accepters.Trim(); if (string.IsNullOrEmpty(accepters)) { this.Alert("接受人不能为空"); return; } string title = this.Pub1.GetTextBoxByID("TB_Title").Text; if (string.IsNullOrEmpty(title)) { this.Alert("标题不能为空"); return; } string doc = this.Pub1.GetTextBoxByID("TB_Doc").Text; //节点. BP.WF.Node nd = new BP.WF.Node(this.FK_Node); /*检查人员是否有问题.*/ string[] emps = accepters.Split(','); BP.Port.Emp myemp = new BP.Port.Emp(); string errMsg = ""; foreach (string emp in emps) { if (string.IsNullOrEmpty(emp)) { continue; } myemp.No = emp; if (myemp.IsExits == false) { errMsg += "@人员(" + emp + ")拼写错误。"; } } if (string.IsNullOrEmpty(errMsg) == false) { this.Alert(errMsg); return; } //抄送信息. string msg = ""; foreach (string emp in emps) { if (string.IsNullOrEmpty(emp)) { continue; } myemp.No = emp; myemp.Retrieve(); msg += "(" + myemp.No + "," + myemp.Name + ")"; // 根据节点属性的配置写入数据. switch (nd.CCWriteTo) { case BP.WF.CCWriteTo.All: BP.WF.Dev2Interface.Node_CC_WriteTo_CClist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name, title, doc); BP.WF.Dev2Interface.Node_CC_WriteTo_Todolist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name); break; case BP.WF.CCWriteTo.CCList: BP.WF.Dev2Interface.Node_CC_WriteTo_CClist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name, title, doc); break; case BP.WF.CCWriteTo.Todolist: BP.WF.Dev2Interface.Node_CC_WriteTo_Todolist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name); break; default: break; } } //写入日志. BP.WF.Dev2Interface.WriteTrack(nd.FK_Flow, nd.NodeID, this.WorkID, this.FID, "抄送给:" + msg, BP.WF.ActionType.CC, null, null, null); // this.WinCloseWithMsg("抄送成功..."); this.WinClose("1"); }
void btn_Click(object sender, EventArgs e) { var pm = new PushMsg(); pm.Retrieve(PushMsgAttr.FK_Event, this.Event, PushMsgAttr.FK_Node, this.NodeID); if (!string.IsNullOrWhiteSpace(pm.MyPK)) { pm.Delete(); } pm.FK_Event = this.Event; pm.FK_Node = int.Parse(this.NodeID); var ddl = Pub1.GetDDLByID("DDL_" + PushMsgAttr.PushWay); pm.PushWay = ddl.SelectedItemIntVal; pm.PushDoc = string.Empty; switch ((PushWay)pm.PushWay) { case PushWay.ByParas: #region 照系统指定参数 var rb = Pub1.GetRadioBtnByID("RB_0"); if (rb.Checked) { pm.PushDoc = "0"; pm.Tag = Pub1.GetTBByID("TB_" + PushMsgAttr.Tag).Text; } else { rb = Pub1.GetRadioBtnByID("RB_1"); if (rb.Checked) { pm.PushDoc = "1"; } pm.Tag = Pub1.GetDDLByID("DDL_" + PushMsgAttr.Tag).SelectedItemStringVal; } #endregion break; case PushWay.NodeWorker: #region 照指定结点的工作人员 CheckBox cb = null; foreach (var ctrl in Pub1.Controls) { cb = ctrl as CheckBox; if (cb == null || !cb.ID.StartsWith("CB_") || !cb.Checked) { continue; } pm.PushDoc += "@" + cb.ID.Substring(3) + "@"; } #endregion break; case PushWay.SpecDepts: #region 照指定的部门 foreach (var ctrl in Pub1.Controls) { cb = ctrl as CheckBox; if (cb == null || !cb.ID.StartsWith("CB_") || !cb.Checked) { continue; } pm.PushDoc += "@" + cb.ID.Substring(3) + "@"; } #endregion break; case PushWay.SpecEmps: #region 照指定的人员 var hid = Pub1.FindControl("HID_Users") as HiddenField; if (!string.IsNullOrWhiteSpace(hid.Value)) { pm.PushDoc = hid.Value.Split(',').Select(o => "@" + o + "@").Aggregate(string.Empty, (curr, next) => curr + next); } //foreach (var ctrl in Pub1.Controls) //{ // cb = ctrl as CheckBox; // if (cb == null || !cb.ID.StartsWith("CB_E_") || !cb.Checked) continue; // pm.PushDoc += "@" + cb.ID.Substring(5) + "@"; //} #endregion break; case PushWay.SpecSQL: #region 照指定的SQL查询语句 pm.PushDoc = Pub1.GetTBByID("TB_" + PushMsgAttr.PushDoc).Text; #endregion break; case PushWay.SpecStations: #region 照指定的岗位 foreach (var ctrl in Pub1.Controls) { cb = ctrl as CheckBox; if (cb == null || !cb.ID.StartsWith("CB_S_") || !cb.Checked) { continue; } pm.PushDoc += "@" + cb.ID.Substring(5) + "@"; } #endregion break; } pm.Save(); Response.Redirect(string.Format("ActionPush2Spec.aspx?NodeID={0}&MyPK={1}&Event={2}&FK_Flow={3}&tk={4}", NodeID, MyPK, Event, FK_Flow, new Random().NextDouble()), true); }