protected void Page_Load(object sender, EventArgs e)
        {
            HungUp hu = new HungUp();

            hu.MyPK = this.WorkID + "_" + this.FK_Node;
            int i = hu.RetrieveFromDBSources();

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = this.WorkID;
            if (gwf.RetrieveFromDBSources() == 0)
            {
                this.Pub1.AddFieldSet("错误", "当前是开始节点,或者工作不存在.");
                return;
            }

            this.Pub1.AddFieldSet("对工作<b>(" + gwf.Title + ")</b>挂起方式");
            RadioButton rb = new RadioButton();

            rb.GroupName = "s";
            rb.Text      = "永久挂起";
            rb.ID        = "RB_HungWay0";
            if (hu.HungUpWay == 0)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddBR();

            rb           = new RadioButton();
            rb.GroupName = "s";
            rb.Text      = "在指定的日期自动解除挂起.<br>";
            rb.ID        = "RB_HungWay1";
            if (hu.HungUpWay == HungUpWay.SpecDataRel)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }
            this.Pub1.Add(rb);

            this.Pub1.Add("&nbsp;&nbsp;&nbsp;&nbsp;解除流程挂起的日期:");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ReadOnly = false;
            tb.ID       = "TB_RelData";
            if (hu.DTOfUnHungUpPlan.Length == 0)
            {
                DateTime dt = DateTime.Now.AddDays(7);
                hu.DTOfUnHungUpPlan = dt.ToString(DataType.SysDataTimeFormat);
            }
            tb.Attributes["onfocus"] = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});";
            tb.Text = hu.DTOfUnHungUpPlan;
            this.Pub1.Add(tb);

            this.Pub1.AddBR();
            this.Pub1.Add("挂起原因(可以为空):");

            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_Note";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 70;
            tb.Height   = 50;
            this.Pub1.Add(tb);
            this.Pub1.AddFieldSetEnd();

            this.Pub1.Add("&nbsp;&nbsp;&nbsp;&nbsp;");
            Button btn = new Button();

            btn.ID = "Btn_OK";

            if (gwf.WFState == WFState.HungUp)
            {
                btn.Text = " 取消挂起 ";
            }
            else
            {
                btn.Text = " 挂起 ";
            }

            btn.Click += new EventHandler(btn_Click);
            btn.Attributes["onclick"] = " return confirm('您确定要执行吗?');";
            this.Pub1.Add(btn);

            btn        = new Button();
            btn.ID     = "Btn_Cancel";
            btn.Text   = " 返回 ";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HungUp hu = new HungUp();

            hu.MyPK = this.WorkID + "_" + this.FK_Node;
            int i = hu.RetrieveFromDBSources();

            GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID);

            this.Pub1.AddFieldSet("对工作<b>(" + gwf.Title + ")</b>挂起方式");
            RadioButton rb = new RadioButton();

            rb.GroupName = "s";
            rb.Text      = "永久挂起";
            rb.ID        = "RB_HungWay0";
            if (hu.HungUpWay == 0)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }

            this.Pub1.Add(rb);
            this.Pub1.AddBR();

            rb           = new RadioButton();
            rb.GroupName = "s";
            rb.Text      = "在指定的日期自动解除挂起.";
            rb.ID        = "RB_HungWay1";
            if (hu.HungUpWay == HungUpWay.SpecDataRel)
            {
                rb.Checked = true;
            }
            else
            {
                rb.Checked = false;
            }
            this.Pub1.Add(rb);
            this.Pub1.AddBR();

            this.Pub1.Add("&nbsp;&nbsp;&nbsp;&nbsp;解除流程挂起的日期:");
            BP.Web.Controls.TB tb = new BP.Web.Controls.TB();
            tb.ShowType = BP.Web.Controls.TBType.DateTime;
            tb.ID       = "TB_RelData";
            if (hu.DTOfUnHungUpPlan.Length == 0)
            {
                DateTime dt = DateTime.Now.AddDays(7);
                hu.DTOfUnHungUpPlan = dt.ToString(DataType.SysDataTimeFormat);
            }
            tb.Text = hu.DTOfUnHungUpPlan;
            this.Pub1.Add(tb);
            this.Pub1.AddFieldSetEnd();

            this.Pub1.AddFieldSet("挂起原因:");
            tb          = new BP.Web.Controls.TB();
            tb.ID       = "TB_Note";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Columns  = 70;
            tb.Height   = 50;
            this.Pub1.Add(tb);
            this.Pub1.AddFieldSetEnd();

            this.Pub1.Add("&nbsp;&nbsp;&nbsp;&nbsp;");
            Button btn = new Button();

            btn.ID = "Btn_OK";

            if (gwf.WFState == WFState.HungUp)
            {
                btn.Text = " 取消挂起 ";
            }
            else
            {
                btn.Text = " 挂起 ";
            }

            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);

            btn        = new Button();
            btn.ID     = "Btn_Cancel";
            btn.Text   = " 关闭 ";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
        }
예제 #3
0
        /// <summary>
        /// 测试案例说明:
        /// 1, 此流程针对于最简单的分合流程进行, zhanghaicheng发起,zhoushengyu,zhangyifan,两个人处理子线程,
        ///    zhanghaicheng 接受子线程汇总数据.
        /// 2, 测试方法体分成三大部分. 发起,子线程处理,合流点执行,分别对应: Step1(), Step2_1(), Step2_2(),Step3() 方法。
        /// 3,针对发送测试,不涉及到其它的功能.
        /// </summary>
        public override void Do()
        {
            HungUp huEn = new HungUp();

            huEn.CheckPhysicsTable();

            this.fk_flow = "023";
            fl           = new Flow("023");
            string sUser = "******";

            BP.WF.Dev2Interface.Port_Login(sUser);

            //创建.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fl.No);

            //执行发送.
            SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork(fl.No, workID);

            //让他登陆。
            BP.WF.Dev2Interface.Port_Login(objs.VarAcceptersID);

            //执行挂起。
            BP.WF.Dev2Interface.Node_HungUpWork(fl.No, workID, 0, null, "hungup test");

            #region 检查执行挂起的预期结果.
            GenerWorkFlow gwf = new GenerWorkFlow(this.workID);
            if (gwf.WFState != WFState.HungUp)
            {
                throw new Exception("@应当是挂起的状态,现在是:" + gwf.WFStateText);
            }

            GenerWorkerLists gwls = new GenerWorkerLists(workID, this.fk_flow);
            foreach (GenerWorkerList gwl in gwls)
            {
                if (gwl.FK_Node == fl.StartNodeID)
                {
                    continue;
                }

                if (gwl.DTOfHungUp.Length < 10)
                {
                    throw new Exception("@挂起日期没有写入");
                }

                if (DataType.IsNullOrEmpty(gwl.DTOfUnHungUp) == false)
                {
                    throw new Exception("@解除挂起日期应当为空,现在是:" + gwl.DTOfUnHungUp);
                }

                if (gwl.HungUpTimes != 1)
                {
                    throw new Exception("@挂起次数应当为1");
                }
            }

            HungUp hu = new HungUp();
            hu.MyPK = "2302_" + this.workID;
            if (hu.RetrieveFromDBSources() == 0)
            {
                throw new Exception("@没有找到 HungUp 数据。");
            }

            #endregion 检查执行挂起的预期结果

            //解除挂起。
            BP.WF.Dev2Interface.Node_UnHungUpWork(fl.No, workID, "un hungup test");

            #region 检查接触执行挂起的预期结果.
            gwf = new GenerWorkFlow(this.workID);
            if (gwf.WFState != WFState.Runing)
            {
                throw new Exception("@应当是挂起的状态,现在是:" + gwf.WFStateText);
            }
            #endregion 检查接触执行挂起的预期结果

            //执行多次挂起于解除挂起.
            BP.WF.Dev2Interface.Node_HungUpWork(fl.No, workID, 0, null, "hungup test");
            BP.WF.Dev2Interface.Node_UnHungUpWork(fl.No, workID, "un hungup test");
        }