/// <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("保存成功.."); }
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_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, "保存成功!"); }
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("保存成功.."); }