示例#1
0
        /// <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(",", "&nbsp;&nbsp;");

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