//批量退回 void btnDelete_Return_Click(object sender, EventArgs e) { string sql = "SELECT Title,RDT,ADT,SDT,FID,WorkID,Starter FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "'"; DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql); BP.WF.Node nd = new BP.WF.Node(this.FK_Node); string msg = ""; foreach (DataRow dr in dt.Rows) { Int64 workid = Int64.Parse(dr["WorkID"].ToString()); Int64 fid = Int64.Parse(dr["FID"].ToString()); CheckBox cb = this.Pub1.GetCBByID("CB_" + workid); if (cb == null || cb.Checked == false) { continue; } msg += "@对工作(" + dr["Title"] + ")处理情况如下。<br>"; BP.WF.SendReturnObjs objs = null;// BP.WF.Dev2Interface.Node_ReturnWork(nd.FK_Flow, workid,fid,this.FK_Node,"批量退回"); msg += objs.ToMsgOfHtml(); msg += "<hr>"; } if (msg == "") { this.Alert("您没有选择工作."); } else { this.Pub1.Clear(); msg += "<a href='Batch.aspx'>返回...</a>"; this.Pub1.AddMsgOfInfo("批量处理信息", msg); } }
//发送 void btn_Send_Click(object sender, EventArgs e) { //string sql = "SELECT Title,RDT,ADT,SDT,FID,WorkID,Starter FROM WF_EmpWorks WHERE FK_Emp='" + WebUser.No + "'"; string sql = string.Format("SELECT Title,RDT,ADT,SDT,FID,WorkID,Starter FROM WF_EmpWorks WHERE FK_Emp='{0}' and FK_Node='{1}'", WebUser.No, this.FK_Node); DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql); BP.WF.Node nd = new BP.WF.Node(this.FK_Node); string[] strs = nd.BatchParas.Split(','); MapAttrs attrs = new MapAttrs(this.FK_MapData); string msg = ""; int idx = -1; string workids = null; if (nd.BatchParas_IsSelfUrl == true) { workids = ""; } foreach (DataRow dr in dt.Rows) { idx++; if (idx == nd.BatchListCount) { break; } Int64 workid = Int64.Parse(dr["WorkID"].ToString()); CheckBox cb = this.Pub1.GetCBByID("CB_" + workid); if (cb == null || cb.Checked == false) { continue; } // 如果是自定义的,就记录workids, 让其转到 if (nd.BatchParas_IsSelfUrl == true) { workids += "," + workid; continue; } Hashtable ht = new Hashtable(); #region 给属性赋值. bool isChange = false; foreach (string str in strs) { if (string.IsNullOrEmpty(str)) { continue; } foreach (MapAttr attr in attrs) { if (str != attr.KeyOfEn) { continue; } if (attr.LGType == FieldTypeS.Normal) { TB tb = this.Pub1.GetTBByID("TB_" + attr.KeyOfEn + "_" + workid); if (tb != null) { if (tb.Text != attr.DefVal) { isChange = true; } ht.Add(str, tb.Text); continue; } cb = this.Pub1.GetCBByID("CB_" + attr.KeyOfEn + "_" + workid); if (cb != null) { if (cb.Checked != attr.DefValOfBool) { isChange = true; } if (cb.Checked) { ht.Add(str, 1); } else { ht.Add(str, 0); } continue; } } else { DDL ddl = this.Pub1.GetDDLByID("DDL_" + attr.KeyOfEn + "_" + workid); if (ddl != null) { if (ddl.SelectedItemStringVal != attr.DefVal) { isChange = true; } if (attr.LGType == FieldTypeS.Enum) { ht.Add(str, ddl.SelectedItemIntVal); } else { ht.Add(str, ddl.SelectedItemStringVal); } continue; } } } } #endregion 给属性赋值. msg += "<fieldset>"; msg += "<legend>@对工作(" + dr["Title"] + ")处理情况如下。</legend>"; BP.WF.SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork(nd.FK_Flow, workid, ht); msg += objs.ToMsgOfHtml(); msg += "</fieldset>"; } if (nd.BatchParas_IsSelfUrl == true) { if (workids == "") { this.Alert("您没有选择工作."); } else { this.Response.Redirect("BatchSelfDeal.aspx?FK_Node=" + this.FK_Node + "&FK_Flow=" + nd.FK_Flow + "&WorkIDs=" + workids, true); } return; } if (msg == "") { this.Alert("您没有选择工作."); } else { this.Pub1.Clear(); msg += "<a href='Batch.aspx'>返回...</a>"; this.Pub1.AddMsgOfInfo("批量处理信息", msg); } }