void btn_Click(object sender, EventArgs e) { var btn = sender as LinkBtn; if (btn.ID == NamesOfBtn.Delete) { #region songhonggang (2014-06-15) 修改点击删除的时候删除条件 Cond deleteCond = new Cond(); deleteCond.Delete(CondAttr.NodeID, this.FK_MainNode, CondAttr.ToNodeID, this.ToNodeID, CondAttr.CondType, (int)this.HisCondType); #endregion this.Response.Redirect(this.Request.RawUrl, true); return; } string sql = this.GetTextBoxByID("TB_SQL").Text; if (string.IsNullOrEmpty(sql)) { this.Alert("请填写sql语句."); return; } Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.FK_MainNode, CondAttr.ToNodeID, this.ToNodeID, CondAttr.CondType, (int)this.HisCondType); cond.MyPK = this.GenerMyPK; cond.HisDataFrom = ConnDataFrom.SQL; cond.NodeID = this.FK_MainNode; cond.FK_Node = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.OperatorValue = sql; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.Insert(); EasyUiHelper.AddEasyUiMessager(this, "保存成功!"); //switch (this.HisCondType) //{ // case CondType.Flow: // case CondType.Node: // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true); // return; // case CondType.Dir: // cond.ToNodeID = this.ToNodeID; // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); // return; // default: // throw new Exception("未设计的情况。"); //} }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondBySQL_Save() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQL.ToString(); string sql = this.GetRequestVal("TB_Docs"); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condTypeEnum + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + toNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.SQL); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, fk_mainNode, CondAttr.ToNodeID, toNodeID, CondAttr.CondType, (int)condTypeEnum); cond.MyPK = mypk; cond.HisDataFrom = ConnDataFrom.SQL; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Node = this.GetRequestValInt("FK_MainNode"); cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.FK_Flow = this.FK_Flow; cond.OperatorValue = sql; cond.Note = this.GetRequestVal("TB_Note"); //备注. cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; cond.Insert(); return("保存成功.."); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondBySQLTemplate_Save() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQLTemplate.ToString(); string sql = this.GetRequestVal("TB_Docs"); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, fk_mainNode, CondAttr.ToNodeID, toNodeID, CondAttr.CondType, (int)condTypeEnum); cond.MyPK = mypk; cond.HisDataFrom = ConnDataFrom.SQLTemplate; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Node = this.GetRequestValInt("FK_MainNode"); cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.FK_Flow = this.FK_Flow; cond.OperatorValue = sql; cond.Note = this.GetRequestVal("TB_Note"); //备注. cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; cond.Insert(); return("保存成功.."); }
void btn_Click(object sender, EventArgs e) { string exp = this.GetTextBoxByID("TB_Para").Text; if (string.IsNullOrEmpty(exp)) { this.Alert("请按格式填写表达式."); return; } exp = exp.Trim(); string[] strs = exp.Split(' '); if (strs.Length != 3) { this.Alert("表达式格式错误,请参考格式要求"); return; } Cond cond = new Cond(); cond.Delete(CondAttr.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.Paras); Button btn = sender as Button; if (btn.ID == "Btn_Del") { this.Response.Redirect(this.Request.RawUrl, true); return; } cond.MyPK = this.GenerMyPK; cond.HisDataFrom = ConnDataFrom.Paras; cond.NodeID = this.FK_MainNode; cond.FK_Node = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.OperatorValue = exp; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.FK_Node = this.FK_Node; cond.Insert(); this.Alert("保存成功"); //switch (this.HisCondType) //{ // case CondType.Flow: // case CondType.Node: // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true); // return; // case CondType.Dir: // cond.ToNodeID = this.ToNodeID; // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); // return; // default: // throw new Exception("未设计的情况。"); //} }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondByStation_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType HisCondType = CondType.Dir; Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, FK_MainNode, CondAttr.ToNodeID, ToNodeID, CondAttr.CondType, (int)HisCondType); string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString(); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)HisCondType + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + ToNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.Stas); // 删除岗位条件. cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = ToNodeID; cond.Insert(); } string val = this.GetRequestVal("emps").Replace(",", "@"); string valT = this.GetRequestVal("orgEmps").Replace(",", " "); cond.OperatorValue = val; //cond.OperatorValueT = valT; cond.SetPara("OrgEmps", valT); cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功.."); }
void btn_Click(object sender, EventArgs e) { Cond cond = new Cond(); cond.Delete(CondAttr.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.SQL); Button btn = sender as Button; if (btn.ID == "Btn_Del") { this.Response.Redirect(this.Request.RawUrl, true); return; } string sql = this.GetTextBoxByID("TB_SQL").Text; if (string.IsNullOrEmpty(sql)) { this.Alert("请填写sql语句."); return; } cond.MyPK = this.GenerMyPK; cond.HisDataFrom = ConnDataFrom.SQL; cond.NodeID = this.FK_MainNode; cond.FK_Node = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.OperatorValue = sql; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.Insert(); this.Alert("保存成功"); //switch (this.HisCondType) //{ // case CondType.Flow: // case CondType.Node: // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true); // return; // case CondType.Dir: // cond.ToNodeID = this.ToNodeID; // cond.Update(); // this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); // return; // default: // throw new Exception("未设计的情况。"); //} }
public string CondByDept_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType condType = (CondType)this.GetRequestValInt("CondType"); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.GetRequestValInt("FK_MainNode"), CondAttr.ToNodeID, this.GetRequestValInt("ToNodeID"), CondAttr.CondType, (int)condType); string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString(); cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Depts; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.Insert(); } string val = this.GetRequestVal("depts").Replace(",", "@"); cond.OperatorValue = val; cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Depts; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功!!"); }
public string CondByDept_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType condType = (CondType)this.GetRequestValInt("CondType"); Cond cond = new Cond(); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condType + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + this.GetRequestValInt("ToNodeID") + ") AND DataFrom!=" + (int)ConnDataFrom.Depts); string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString(); cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Depts; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.Insert(); } string val = this.GetRequestVal("depts").Replace(",", "@"); cond.OperatorValue = val; cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Depts; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功!!"); }
void btn_Click(object sender, EventArgs e) { string exp = this.GetTextBoxByID("TB_Para").Text; if (string.IsNullOrEmpty(exp)) { this.Alert("请按格式填写表达式."); return; } exp = exp.Trim(); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.FK_MainNode, CondAttr.ToNodeID, this.ToNodeID, CondAttr.CondType, (int)this.HisCondType); var btn = sender as LinkBtn; if (btn.ID == NamesOfBtn.Delete) { this.Response.Redirect(this.Request.RawUrl, true); return; } cond.MyPK = this.GenerMyPK; cond.HisDataFrom = ConnDataFrom.Url; cond.NodeID = this.FK_MainNode; cond.FK_Node = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.OperatorValue = exp; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.FK_Node = this.FK_Node; cond.Insert(); EasyUiHelper.AddEasyUiMessager(this, "保存成功!"); }
void btn_Save_Click(object sender, EventArgs e) { //Button btn = sender as Button; var btn = sender as LinkBtn; if (btn.ID == NamesOfBtn.Delete) { DBAccess.RunSQL("DELETE FROM WF_Cond WHERE ToNodeID=" + this.ToNodeID + " AND DataFrom=" + (int)ConnDataFrom.Form); this.Response.Redirect(this.Request.RawUrl, true); return; } if (this.GetOperVal == "" || this.GetOperVal == null) { this.Alert("您没有设置条件,请在值文本框中输入值。"); return; } DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (" + CondAttr.NodeID + "=" + this.FK_Node + " AND ToNodeID=" + this.ToNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.Form); Cond cond = new Cond(); cond.HisDataFrom = ConnDataFrom.Form; cond.NodeID = this.FK_MainNode; cond.ToNodeID = this.FK_MainNode; cond.FK_Attr = this.FK_Attr; cond.FK_Node = this.DDL_Node.SelectedItemIntVal; cond.FK_Operator = this.DDL_Oper.SelectedItemStringVal; cond.OperatorValue = this.GetOperVal; cond.OperatorValueT = this.GetOperValText; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; if (btn.ID == "Btn_SaveAnd") { cond.CondOrAnd = CondOrAnd.ByAnd; } else { cond.CondOrAnd = CondOrAnd.ByOr; } #region 方向条件,全部更新. Conds conds = new Conds(); QueryObject qo = new QueryObject(conds); qo.AddWhere(CondAttr.NodeID, this.FK_MainNode); qo.addAnd(); qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form); qo.addAnd(); qo.AddWhere(CondAttr.CondType, (int)this.HisCondType); if (this.ToNodeID != 0) { qo.addAnd(); qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID); } int num = qo.DoQuery(); foreach (Cond item in conds) { item.CondOrAnd = cond.CondOrAnd; item.Update(); } #endregion /* 执行同步*/ string sqls = "UPDATE WF_Node SET IsCCFlow=0"; sqls += "@UPDATE WF_Node SET IsCCFlow=1 WHERE NodeID IN (SELECT NODEID FROM WF_Cond a WHERE a.NodeID= NodeID AND CondType=1 )"; BP.DA.DBAccess.RunSQLs(sqls); string sql = "UPDATE WF_Cond SET DataFrom=" + (int)ConnDataFrom.Form + " WHERE NodeID=" + cond.NodeID + " AND FK_Node=" + cond.FK_Node + " AND ToNodeID=" + this.ToNodeID; switch (this.HisCondType) { case CondType.Flow: case CondType.Node: // case CondType.FLRole: cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); this.Response.Redirect("Cond.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); break; case CondType.Dir: // cond.MyPK = cond.NodeID +"_"+ this.Request.QueryString["ToNodeID"]+"_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = this.ToNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); this.Response.Redirect("Cond.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); break; default: throw new Exception("未设计的情况。"); } EasyUiHelper.AddEasyUiMessager(this, "保存成功!"); }
void btn_Save_Click(object sender, EventArgs e) { Cond cond = new Cond(); cond.Delete(CondAttr.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.Depts); Button btn = sender as Button; if (btn.ID == "Btn_Del") { this.Response.Redirect(this.Request.RawUrl, true); return; } cond.MyPK = this.GenerMyPK; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Depts; cond.NodeID = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.Insert(); } string val = ""; Depts sts = new Depts(); sts.RetrieveAllFromDBSource(); foreach (Dept st in sts) { if (this.Pub1.IsExit("CB_" + st.No) == false) { continue; } if (this.Pub1.GetCBByID("CB_" + st.No).Checked) { val += "@" + st.No; } } if (val == "") { cond.Delete(); return; } val += "@"; cond.OperatorValue = val; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.FK_Node = this.FK_Node; switch (this.HisCondType) { case CondType.Flow: case CondType.Node: cond.Update(); this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true); return; case CondType.Dir: cond.ToNodeID = this.ToNodeID; cond.Update(); this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; default: throw new Exception("未设计的情况。"); } }
void btn_Save_Click(object sender, EventArgs e) { Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.FK_MainNode, CondAttr.ToNodeID, this.ToNodeID, CondAttr.CondType, (int)this.HisCondType); var btn = sender as LinkBtn; if (btn.ID == NamesOfBtn.Delete) { this.Response.Redirect(this.Request.RawUrl, true); return; } // 删除岗位条件. cond.MyPK = this.GenerMyPK; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.Insert(); } string val = ""; Stations sts = new Stations(); sts.RetrieveAllFromDBSource(); foreach (Station st in sts) { if (this.Pub1.IsExit("CB_" + st.No) == false) { continue; } if (this.Pub1.GetCBByID("CB_" + st.No).Checked) { val += "@" + st.No; } } if (val == "") { cond.Delete(); return; } val += "@"; cond.OperatorValue = val; cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.FK_Node = this.FK_MainNode; #region //获取“指定的操作员”设置,added by liuxc,2015-10-7 cond.SpecOperWay = (SpecOperWay)Pub1.GetDDLByID("DDL_" + CondAttr.SpecOperWay).SelectedItemIntVal; if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = Pub1.GetTBByID("TB_" + CondAttr.SpecOperPara).Text; } else { cond.SpecOperPara = string.Empty; } #endregion switch (this.HisCondType) { case CondType.Flow: case CondType.Node: cond.Update(); this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; case CondType.Dir: cond.ToNodeID = this.ToNodeID; cond.Update(); this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; case CondType.SubFlow: cond.ToNodeID = this.ToNodeID; cond.Update(); this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; default: throw new Exception("未设计的情况。"); } }
void btn_Save_Click(object sender, EventArgs e) { Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.FK_MainNode, CondAttr.ToNodeID, this.ToNodeID, CondAttr.CondType, (int)this.HisCondType); var btn = sender as LinkBtn; if (btn.ID == NamesOfBtn.Delete) { this.Response.Redirect(this.Request.RawUrl, true); return; } // 删除岗位条件. cond.MyPK = this.GenerMyPK; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = this.FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.ToNodeID; cond.Insert(); } string val = ""; Stations sts = new Stations(); sts.RetrieveAllFromDBSource(); foreach (Station st in sts) { if (this.Pub1.IsExit("CB_" + st.No) == false) { continue; } if (this.Pub1.GetCBByID("CB_" + st.No).Checked) { val += "@" + st.No; } } if (val == "") { cond.Delete(); return; } val += "@"; cond.OperatorValue = val; cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; cond.FK_Node = this.FK_MainNode; switch (this.HisCondType) { case CondType.Flow: case CondType.Node: cond.Update(); this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; case CondType.Dir: cond.ToNodeID = this.ToNodeID; cond.Update(); this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; default: throw new Exception("未设计的情况。"); } EasyUiHelper.AddEasyUiMessager(this, "保存成功!"); }
void btn_Save_Click(object sender, EventArgs e) { Button btn = sender as Button; if (btn.ID == "Btn_Del") { DBAccess.RunSQL("DELETE WF_Cond WHERE ToNodeID=" + this.ToNodeID + " AND DataFrom=" + (int)ConnDataFrom.Form); this.Response.Redirect(this.Request.RawUrl, true); return; } if (this.GetOperVal == "" || this.GetOperVal == null) { this.Alert("您没有设置条件,请在值文本框中输入值。"); return; } Cond cond = new Cond(); cond.HisDataFrom = ConnDataFrom.Form; cond.NodeID = this.FK_MainNode; cond.FK_Attr = this.FK_Attr; cond.FK_Node = this.DDL_Node.SelectedItemIntVal; cond.FK_Operator = this.DDL_Oper.SelectedItemStringVal; cond.OperatorValue = this.GetOperVal; cond.OperatorValueT = this.GetOperValText; cond.FK_Flow = this.FK_Flow; cond.HisCondType = this.HisCondType; // 2012-09-01 去掉了 or 的混淆概念. // cond.HisConnJudgeWay = ConnJudgeWay.ByAnd; //try //{ // cond.HisConnJudgeWay = (ConnJudgeWay)this.DDL_ConnJudgeWay.SelectedItemIntVal; //} //catch //{ //} /* 执行同步*/ string sqls = "UPDATE WF_Node SET IsCCFlow=0"; sqls += "@UPDATE WF_Node SET IsCCFlow=1 WHERE NodeID IN (SELECT NODEID FROM WF_Cond a WHERE a.NodeID= NodeID AND CondType=1 )"; BP.DA.DBAccess.RunSQLs(sqls); string sql = "UPDATE WF_Cond SET DataFrom=" + (int)ConnDataFrom.Form + " WHERE NodeID=" + cond.NodeID + " AND FK_Node=" + cond.FK_Node + " AND ToNodeID=" + this.ToNodeID; switch (this.HisCondType) { case CondType.Flow: case CondType.Node: // case CondType.FLRole: cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); this.Response.Redirect("Cond.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true); return; case CondType.Dir: // cond.MyPK = cond.NodeID +"_"+ this.Request.QueryString["ToNodeID"]+"_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = this.ToNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); this.Response.Redirect("Cond.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true); return; default: throw new Exception("未设计的情况。"); } }
public string StandAloneFrm_Save() { string frmID = this.GetRequestVal("FrmID"); //定义变量. string field = this.GetRequestVal("DDL_Fields"); field = frmID + "_" + field; int toNodeID = this.GetRequestValInt("ToNodeID"); int fk_Node = this.GetRequestValInt("FK_Node"); string oper = this.GetRequestVal("DDL_Operator"); string operVal = this.GetRequestVal("OperVal"); //节点,子线城,还是其他 CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condTypeEnum + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + toNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.NodeForm); Cond cond = new Cond(); cond.HisDataFrom = ConnDataFrom.StandAloneFrm; cond.NodeID = fk_Node; cond.ToNodeID = toNodeID; cond.FK_Node = this.FK_Node; cond.FK_Operator = oper; cond.OperatorValue = operVal; //操作值. cond.FK_Attr = field; //字段属性. // cond.OperatorValueT = ""; // this.GetOperValText; cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; ; //保存类型. if (this.GetRequestVal("SaveType").Equals("AND") == true) { cond.CondOrAnd = CondOrAnd.ByAnd; } else { cond.CondOrAnd = CondOrAnd.ByOr; } #region 方向条件,全部更新. Conds conds = new Conds(); QueryObject qo = new QueryObject(conds); qo.AddWhere(CondAttr.NodeID, this.FK_Node); qo.addAnd(); qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.StandAloneFrm); qo.addAnd(); qo.AddWhere(CondAttr.CondType, (int)condTypeEnum); if (toNodeID != 0) { qo.addAnd(); qo.AddWhere(CondAttr.ToNodeID, toNodeID); } int num = qo.DoQuery(); foreach (Cond item in conds) { item.CondOrAnd = cond.CondOrAnd; item.Update(); } #endregion /* 执行同步*/ string sqls = "UPDATE WF_Node SET IsCCFlow=0"; sqls += "@UPDATE WF_Node SET IsCCFlow=1 WHERE NodeID IN (SELECT NODEID FROM WF_Cond a WHERE a.NodeID= NodeID AND CondType=1 )"; BP.DA.DBAccess.RunSQLs(sqls); string sql = "UPDATE WF_Cond SET DataFrom=" + (int)ConnDataFrom.StandAloneFrm + " WHERE NodeID=" + cond.NodeID + " AND FK_Node=" + cond.FK_Node + " AND ToNodeID=" + toNodeID; switch (condTypeEnum) { case CondType.Flow: case CondType.Node: cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; case CondType.Dir: // cond.MyPK = cond.NodeID +"_"+ this.Request.QueryString["ToNodeID"]+"_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = toNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; case CondType.SubFlow: //启动子流程. cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = toNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; default: throw new Exception("未设计的情况。" + condTypeEnum.ToString()); } return("保存成功!!"); }
public string CondStation_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType HisCondType = CondType.Dir; Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, FK_MainNode, CondAttr.ToNodeID, ToNodeID, CondAttr.CondType, (int)HisCondType); string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString(); // 删除岗位条件. cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = ToNodeID; cond.Insert(); } string val = ""; Stations sts = new Stations(); sts.RetrieveAllFromDBSource(); foreach (Station st in sts) { if (this.GetRequestVal("CB_" + st.No) != "1") { continue; } val += "@" + st.No; } val += "@"; cond.OperatorValue = val; cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; #region //获取“指定的操作员”设置,added by liuxc,2015-10-7 cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_" + CondAttr.SpecOperWay); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_" + CondAttr.SpecOperPara); } else { cond.SpecOperPara = string.Empty; } #endregion cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功.."); }