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.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.Stas); 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.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, 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("未设计的情况。"); } }
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("保存成功.."); }