public string OP_DelFlow()
        {
            WorkFlow wf = new WorkFlow(FK_Flow, WorkID);

            wf.DoDeleteWorkFlowByReal(true);
            return("流程已经被删除!");
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "DelIt")
            {
                try
                {
                    WorkFlow wf = new WorkFlow(this.FK_Flow, this.WorkID);
                    wf.DoDeleteWorkFlowByReal(true);
                }
                catch (Exception ex)
                {
                    this.Response.Write(ex.Message);

                    BP.Sys.PubClass.Alert(ex.Message);
                }
                return;
            }

            Flow fl = new Flow(this.FK_Flow);

            GenerWorkFlows gwfs = new GenerWorkFlows();

            gwfs.Retrieve(GenerWorkFlowAttr.FK_Flow, this.FK_Flow, GenerWorkFlowAttr.FK_Dept);
            this.Pub1.AddTable("width='100%'");
            this.Pub1.AddCaptionLeft(fl.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("部门");
            this.Pub1.AddTDTitle("发起人");
            this.Pub1.AddTDTitle("发起时间");
            this.Pub1.AddTDTitle("当前停留节点");
            this.Pub1.AddTDTitle("标题");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            int idx = 0;

            foreach (GenerWorkFlow item in gwfs)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(item.DeptName);
                this.Pub1.AddTD(item.StarterName);
                this.Pub1.AddTD(item.RDT);
                this.Pub1.AddTD(item.NodeName);
                this.Pub1.AddTDB(item.Title);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinOpen('/WF/WorkOpt/OneWork/ChartTrack.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "','ds'); \" >轨迹图</a>-");
                this.Pub1.Add("<a href=\"javascript:WinOpen('./../WFRpt.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "','ds'); \" >报告</a>-");
                this.Pub1.Add("[<a href=\"javascript:DelIt('" + item.FK_Flow + "','" + item.WorkID + "');\"><img src='/WF/Img/Btn/Delete.gif' border=0/>删除</a>]");
                this.Pub1.Add("[<a href=\"javascript:FlowShift('" + item.FK_Flow + "','" + item.WorkID + "');\">移交</a>]");
                this.Pub1.Add("[<a href=\"javascript:FlowSkip('" + item.FK_Flow + "','" + item.WorkID + "');\">跳转</a>]");
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
        /// <summary>
        /// 删除后,需要把工作者列表也要删除.
        /// </summary>
        protected override void afterDelete()
        {
            // . clear bad worker .
            DBAccess.RunSQLReturnTable("DELETE FROM WF_GenerWorkerlist WHERE WorkID in  ( select WorkID from WF_GenerWorkerlist WHERE WorkID not in (select WorkID from WF_GenerWorkFlow) )");

            WorkFlow wf = new WorkFlow(new Flow(this.FK_Flow), this.WorkID, this.FID);

            wf.DoDeleteWorkFlowByReal(true); /* 删除下面的工作。*/
            base.afterDelete();
        }
Exemple #4
0
 void Btn_Del_Click(object sender, EventArgs e)
 {
     try
     {
         WorkFlow wf14 = new WorkFlow(this.FK_Flow, this.WorkID);
         wf14.DoDeleteWorkFlowByReal(true);
         this.Alert("执行成功.");
         this.WinClose();
     }
     catch (Exception ex)
     {
         this.WinCloseWithMsg(ex.Message);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         WorkFlow wf      = new WorkFlow(this.FK_Flow, this.WorkID);
         string   delInfo = wf.DoDeleteWorkFlowByReal(true);
         this.Pub1.Add(delInfo);
     }
     catch (Exception ex)
     {
         this.Response.Write(ex.Message);
         this.Alert(ex.Message);
     }
 }
        /// <summary>
        /// 执行修复
        /// </summary>
        /// <returns></returns>
        public string DoRepare()
        {
            if (this.DoSelfTestInfo() == "没有发现异常。")
            {
                return("没有发现异常。");
            }

            string    sql = "SELECT FK_Node FROM WF_GenerWorkerlist WHERE WORKID='" + this.WorkID + "' ORDER BY FK_Node desc";
            DataTable dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count == 0)
            {
                /*如果是开始工作节点,就删除它。*/
                WorkFlow wf = new WorkFlow(new Flow(this.FK_Flow), this.WorkID, this.FID);
                wf.DoDeleteWorkFlowByReal(true);
                return("此流程是因为发起工作失败被系统删除。");
            }

            int FK_Node = int.Parse(dt.Rows[0][0].ToString());

            Node nd = new Node(FK_Node);

            if (nd.IsStartNode)
            {
                /*如果是开始工作节点,就删除它。*/
                WorkFlow wf = new WorkFlow(new Flow(this.FK_Flow), this.WorkID, this.FID);
                wf.DoDeleteWorkFlowByReal(true);
                return("此流程是因为发起工作失败被系统删除。");
            }

            this.FK_Node  = nd.NodeID;
            this.NodeName = nd.Name;
            this.Update();

            string           str = "";
            GenerWorkerLists wls = new GenerWorkerLists();

            wls.Retrieve(GenerWorkerListAttr.FK_Node, FK_Node, GenerWorkerListAttr.WorkID, this.WorkID);
            foreach (GenerWorkerList wl in wls)
            {
                str += wl.FK_Emp + wl.FK_EmpText + ",";
            }

            return("此流程是因为[" + nd.Name + "]工作发送失败被回滚到当前位置,请转告[" + str + "]流程修复成功。");
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //add by dgq 不要在这里做转,影响其他地方使用
            //this.Response.Redirect("/WF/Comm/Search.aspx?EnsName=BP.WF.Data.Monitors", true);
            //return;

            if (this.DoType == "DelIt")
            {
                try
                {
                    WorkFlow wf = new WorkFlow(this.FK_Flow, this.WorkID);
                    wf.DoDeleteWorkFlowByReal(true);
                }
                catch (Exception ex)
                {
                    this.Response.Write(ex.Message);
                    this.Alert(ex.Message);
                }
                return;
            }

            Pub3.Add("<div style='width:100%; padding: 2px; height: auto;background-color:#E0ECFF; line-height:30px'>");

            Pub3.Add("部门:");
            var tb = new TB();

            tb.ID   = "TB_Dept";
            tb.Text = DeptsText;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            var hid = new HiddenField();

            hid.ID    = "Hid_Dept";
            hid.Value = Depts;
            Pub3.Add(hid);

            Pub3.Add("<a class='easyui-linkbutton' href=\"javascript:openSelectDept('" + hid.ClientID + "','" + tb.ClientID + "')\" data-options=\"iconCls:'icon-department',plain:true\" title='选择部门'> </a>&nbsp;&nbsp;");

            Pub3.Add("发起人:");
            tb      = new TB();
            tb.ID   = "TB_FQR";
            tb.Text = EmpsText;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            hid       = new HiddenField();
            hid.ID    = "Hid_FQR";
            hid.Value = Emps;
            Pub3.Add(hid);

            Pub3.Add("<a class='easyui-linkbutton' href=\"javascript:openSelectEmp('" + hid.ClientID + "','" + tb.ClientID + "')\" data-options=\"iconCls:'icon-user',plain:true\" title='选择发起人'> </a>&nbsp;&nbsp;");

            Pub3.Add("发起日期:");
            tb      = new TB();
            tb.ID   = "TB_DateFrom";
            tb.Text = DateFrom;
            tb.Style.Add("width", "80px");
            tb.Attributes["onfocus"] = "WdatePicker();";
            Pub3.Add(tb);

            Pub3.AddSpace(1);
            Pub3.Add("到");
            Pub3.AddSpace(1);

            tb      = new TB();
            tb.ID   = "TB_DateTo";
            tb.Text = DateTo;
            tb.Style.Add("width", "80px");
            tb.Attributes["onfocus"] = "WdatePicker();";
            Pub3.Add(tb);
            Pub3.AddSpace(2);

            Pub3.Add("关键字:");
            tb      = new TB();
            tb.ID   = "TB_KeyWords";
            tb.Text = Keywords;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            var lbtn = new LinkBtn(false, NamesOfBtn.Search, "查询");

            lbtn.Click += new EventHandler(lbtn_Click);

            Pub3.AddSpace(1);
            Pub3.Add(lbtn);

            Pub3.AddDivEnd();

            if (IsSearch)
            {
                BindSearch();
            }
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "DeleteFlow":
                string fk_flow = this.Request.QueryString["FK_Flow"];
                Int64  workid  = Int64.Parse(this.Request.QueryString["WorkID"]);
                try
                {
                    WorkFlow wf = new WorkFlow(new Flow(fk_flow), workid);
                    wf.DoDeleteWorkFlowByReal(true);
                }
                catch
                {
                }
                this.Session["info"] = "流程删除成功";
                break;

            case "UnShift":
                try
                {
                    WorkFlow mwf = new WorkFlow(this.FK_Flow, this.WorkID);
                    string   str = mwf.DoUnShift();
                    this.Session["info"] = str;
                }
                catch (Exception ex)
                {
                    this.Session["info"] = "@执行撤消失败。@失败信息" + ex.Message;
                }
                break;

            case "UnSend":
                try
                {
                    string str = BP.WF.Dev2Interface.Flow_DoUnSend(this.FK_Flow, this.WorkID);
                    this.Session["info"] = str;
                }
                catch (Exception ex)
                {
                    this.Session["info"] = "@执行撤消失败。@失败信息" + ex.Message;
                }
                break;

            default:
                break;
            }

            string s = this.Session["info"] as string;

            this.Session["info"] = null;
            if (s == null)
            {
                s = this.Application["info" + WebUser.No] as string;
            }

            if (s == null)
            {
                s = BP.WF.Glo.SessionMsg;
            }

            s = s.Replace("@@", "@");

            if (s.Substring(s.Length - 1) == "@")
            {
                s = s.Substring(0, s.Length - 1);
            }

            s = s.Replace("@", "<BR><BR><img src='Img/dot.png' align='middle' width='8px' />&nbsp;");

            this.Add("<div style='width:500px;text-align:left;font-size:14px'>");
            if (WebUser.IsWap)
            {
                this.AddFieldSet("<a href=Home.aspx ><img src='" + BP.WF.Glo.CCFlowAppPath + "/WF/Img/Home.gif' border=0/>Home</a> - 操作提示", s);
            }
            else
            {
                this.AddFieldSet("<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/info.png' align='middle' />操作提示", s);
            }

            this.Add("<br><br></div>");
            return;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 功能执行
            try
            {
                switch (this.DoType)
                {
                case "Del":
                    WorkFlow wf = new WorkFlow(FK_Flow, WorkID);
                    wf.DoDeleteWorkFlowByReal(true);
                    this.WinCloseWithMsg("流程已经被删除.");
                    break;

                case "HungUp":
                    WorkFlow wf1 = new WorkFlow(FK_Flow, WorkID);
                    //wf1.DoHungUp(HungUpWa;
                    this.WinCloseWithMsg("流程已经被挂起.");
                    break;

                case "UnHungUp":
                    WorkFlow wf2 = new WorkFlow(FK_Flow, WorkID);
                    //  wf2.DoUnHungUp();
                    this.WinCloseWithMsg("流程已经被解除挂起.");
                    break;

                case "ComeBack":
                    WorkFlow wf3 = new WorkFlow(FK_Flow, WorkID);
                    wf3.DoComeBackWorkFlow("无");
                    this.WinCloseWithMsg("流程已经被回复启用.");
                    break;

                case "Takeback":     /*取回审批.*/
                    break;

                case "UnSend":
                    // 转化成编号.
                    string message = BP.WF.Dev2Interface.Flow_DoUnSend(FK_Flow, WorkID);

                    Response.Clear();
                    Response.Write(message);
                    Response.End();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Alert("执行功能:" + DoType + ",出现错误:" + ex.Message);
            }
            #endregion

            int     wfState     = BP.DA.DBAccess.RunSQLReturnValInt("SELECT WFState FROM WF_GenerWorkFlow WHERE WorkID=" + WorkID, 1);
            WFState wfstateEnum = (WFState)wfState;
            //this.Pub2.AddH3("您可执行的操作<hr>");
            switch (wfstateEnum)
            {
            case WFState.Runing:           /* 运行时*/
                this.FlowOverByCoercion(); /*删除流程.*/
                this.TackBackCheck();      /*取回审批*/
                this.Hurry();              /*催办*/
                this.UnSend();             /*撤销发送*/
                break;

            case WFState.Complete:   // 完成.
            case WFState.Delete:     // 逻辑删除..
                this.RollBack();     /*恢复使用流程*/
                break;

            case WFState.HungUp:     // 挂起.
                this.AddUnHungUp();  /*撤销挂起*/
                break;

            default:
                break;
            }
        }
Exemple #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Response.AddHeader("P3P", "CP=CAO PSA OUR");
            Response.AddHeader("Cache-Control", "no-store");
            Response.AddHeader("Expires", "0");
            Response.AddHeader("Pragma", "no-cache");
            string url = this.Request.RawUrl;

            if (url.Contains("DTT=") == false)
            {
                //this.Response.Redirect(url + "&DTT=" + DateTime.Now.ToString("mmDDhhmmss"), true);
                //return;
            }

            try
            {
                switch (this.ActionType)
                {
                case "Focus":     //把任务放入任务池.
                    BP.WF.Dev2Interface.Flow_Focus(Int64.Parse(this.Request.QueryString["WorkID"]));
                    this.WinClose("ss");
                    break;

                case "PutOne":     //把任务放入任务池.
                    Int64 workid42 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolPutOne(workid42);
                    this.WinClose("ss");
                    break;

                case "DoAppTask":     // 申请任务.
                    Int64 workid2 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolTakebackOne(workid2);
                    this.WinClose("ss");
                    return;

                case "DoOpenCC":
                    string fk_flow1 = this.Request.QueryString["FK_Flow"];
                    string fk_node1 = this.Request.QueryString["FK_Node"];
                    string workid1  = this.Request.QueryString["WorkID"];
                    string fid1     = this.Request.QueryString["FID"];
                    string Sta      = this.Request.QueryString["Sta"];
                    if (Sta == "0")
                    {
                        BP.WF.Template.CCList cc1 = new BP.WF.Template.CCList();
                        cc1.MyPK = this.Request.QueryString["MyPK"];
                        cc1.Retrieve();
                        cc1.HisSta = CCSta.Read;
                        cc1.Update();
                    }
                    this.Response.Redirect("./WorkOpt/OneWork/Track.aspx?FK_Flow=" + fk_flow1 + "&FK_Node=" + fk_node1 + "&WorkID=" + workid1 + "&FID=" + fid1, false);
                    return;

                case "DelCC":     //删除抄送.
                    CCList cc = new CCList();
                    cc.MyPK = this.MyPK;
                    cc.Retrieve();
                    cc.HisSta = CCSta.Del;
                    cc.Update();
                    this.WinClose();
                    break;

                case "DelSubFlow":     //删除进程。
                    try
                    {
                        BP.WF.Dev2Interface.Flow_DeleteSubThread(this.FK_Flow, this.WorkID, "手工删除");
                        this.WinClose();
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                    }
                    break;

                case "DownBill":
                    Bill b = new Bill(this.MyPK);
                    b.DoOpen();
                    break;

                case "DelDtl":
                    GEDtls dtls = new GEDtls(this.EnsName);
                    GEDtl  dtl  = (GEDtl)dtls.GetNewEntity;
                    dtl.OID = this.RefOID;
                    if (dtl.RetrieveFromDBSources() == 0)
                    {
                        this.WinClose();
                        break;
                    }
                    FrmEvents fes = new FrmEvents(this.EnsName);     //获得事件.

                    // 处理删除前事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelBefore, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    dtl.Delete();

                    // 处理删除后事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelAfter, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    this.WinClose();
                    break;

                case "EmpDoUp":
                    BP.WF.Port.WFEmp ep = new BP.WF.Port.WFEmp(this.RefNo);
                    ep.DoUp();

                    BP.WF.Port.WFEmps emps111 = new BP.WF.Port.WFEmps();
                    //  emps111.RemoveCash();
                    emps111.RetrieveAll();
                    this.WinClose();
                    break;

                case "EmpDoDown":
                    BP.WF.Port.WFEmp ep1 = new BP.WF.Port.WFEmp(this.RefNo);
                    ep1.DoDown();

                    BP.WF.Port.WFEmps emps11441 = new BP.WF.Port.WFEmps();
                    //  emps11441.RemoveCash();
                    emps11441.RetrieveAll();
                    this.WinClose();
                    break;

                case "Track":     //通过一个串来打开一个工作.
                    string   mySid  = this.Request.QueryString["SID"];
                    string[] mystrs = mySid.Split('_');

                    Int64  myWorkID = int.Parse(mystrs[1]);
                    string fk_emp   = mystrs[0];
                    int    fk_node  = int.Parse(mystrs[2]);
                    Node   mynd     = new Node();
                    mynd.NodeID = fk_node;
                    mynd.RetrieveFromDBSources();

                    string fk_flow = mynd.FK_Flow;
                    string myurl   = "./WorkOpt/OneWork/Track.aspx?FK_Node=" + mynd.NodeID + "&WorkID=" + myWorkID + "&FK_Flow=" + fk_flow;
                    Web.WebUser.SignInOfGener(new BP.Port.Emp(fk_emp), true);
                    this.Response.Write("<script> window.location.href='" + myurl + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + myurl + "'>点这里进入。</a>");
                    return;

                case "OF":     //通过一个串来打开一个工作.
                    string          sid  = this.Request.QueryString["SID"];
                    string[]        strs = sid.Split('_');
                    GenerWorkerList wl   = new GenerWorkerList();
                    int             i    = wl.Retrieve(GenerWorkerListAttr.FK_Emp, strs[0],
                                                       GenerWorkerListAttr.WorkID, strs[1],
                                                       GenerWorkerListAttr.FK_Node, strs[2]);
                    if (i == 0)
                    {
                        this.Response.Write("<h2>提示</h2>此工作已经被别人处理或者此流程已删除。");
                        return;
                    }

                    BP.Port.Emp empOF = new BP.Port.Emp(wl.FK_Emp);
                    Web.WebUser.SignInOfGener(empOF, true);
                    string u = "MyFlow.aspx?FK_Flow=" + wl.FK_Flow + "&WorkID=" + wl.WorkID + "&FK_Node=" + wl.FK_Node + "&FID=" + wl.FID;
                    this.Response.Write("<script> window.location.href='" + u + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + u + "'>点这里进入。</a>");
                    return;

                case "ExitAuth":
                    BP.Port.Emp emp = new BP.Port.Emp(this.FK_Emp);
                    //首先退出,再进行登录
                    BP.Web.WebUser.Exit();
                    BP.Web.WebUser.SignInOfGenerLang(emp, WebUser.SysLang);
                    this.WinClose();
                    return;

                case "LogAs":
                    BP.WF.Port.WFEmp wfemp = new BP.WF.Port.WFEmp(this.FK_Emp);
                    if (wfemp.AuthorIsOK == false)
                    {
                        this.WinCloseWithMsg("授权失败");
                        return;
                    }
                    BP.Port.Emp emp1 = new BP.Port.Emp(this.FK_Emp);
                    BP.Web.WebUser.SignInOfGener(emp1, WebUser.SysLang, WebUser.No, true, false);
                    this.WinClose();
                    return;

                case "TakeBack":     // 取消授权。
                    BP.WF.Port.WFEmp myau = new BP.WF.Port.WFEmp(WebUser.No);
                    BP.DA.Log.DefaultLogWriteLineInfo("取消授权:" + WebUser.No + "取消了对(" + myau.Author + ")的授权。");
                    myau.Author    = "";
                    myau.AuthorWay = 0;
                    myau.Update();
                    this.WinClose();
                    return;

                case "AutoTo":     // 执行授权。
                    BP.WF.Port.WFEmp au = new BP.WF.Port.WFEmp();
                    au.No = WebUser.No;
                    au.RetrieveFromDBSources();
                    au.AuthorDate = BP.DA.DataType.CurrentData;
                    au.Author     = this.FK_Emp;
                    au.AuthorWay  = 1;
                    au.Save();
                    BP.DA.Log.DefaultLogWriteLineInfo("执行授权:" + WebUser.No + "执行了对(" + au.Author + ")的授权。");
                    this.WinClose();
                    return;

                case "UnSend":     //执行撤消发送。
                    this.Response.Redirect("./WorkOpt/UnSend.aspx?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow, false);
                    return;

                case "SetBillState":
                    break;

                case "WorkRpt":
                    Bill bk1 = new Bill(this.Request.QueryString["OID"]);
                    Node nd  = new Node(bk1.FK_Node);
                    this.Response.Redirect("WFRpt.aspx?WorkID=" + bk1.WorkID + "&FID=" + bk1.FID + "&FK_Flow=" + nd.FK_Flow + "&NodeId=" + bk1.FK_Node, false);
                    //this.WinOpen();
                    //this.WinClose();
                    break;

                case "PrintBill":
                    //Bill bk2 = new Bill(this.Request.QueryString["OID"]);
                    //Node nd2 = new Node(bk2.FK_Node);
                    //this.Response.Redirect("NodeRefFunc.aspx?NodeId=" + bk2.FK_Node + "&FlowNo=" + nd2.FK_Flow + "&NodeRefFuncOID=" + bk2.FK_NodeRefFunc + "&WorkFlowID=" + bk2.WorkID);
                    ////this.WinClose();
                    break;

                //删除流程中第一个节点的数据,包括待办工作
                case "DeleteFlow":
                    string fk_flowDel = this.Request.QueryString["FK_Flow"];
                    Int64  workid     = Int64.Parse(this.Request.QueryString["WorkID"]);
                    //调用DoDeleteWorkFlowByReal方法
                    WorkFlow wf = new WorkFlow(new Flow(fk_flowDel), workid);
                    wf.DoDeleteWorkFlowByReal(true);
                    //  Glo.ToMsg("流程删除成功");
                    BP.WF.Glo.ToMsg("流程删除成功");



                    //this.ToWFMsgPage("流程删除成功");
                    break;

                default:
                    throw new Exception("ActionType error" + this.ActionType);
                }
            }
            catch (Exception ex)
            {
                this.ToErrorPage("执行其间如下异常:<BR>" + ex.Message);
            }
        }
Exemple #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "DeleteFlow":
                string fk_flow = this.Request.QueryString["FK_Flow"];
                Int64  workid  = Int64.Parse(this.Request.QueryString["WorkID"]);
                try
                {
                    WorkFlow wf = new WorkFlow(new Flow(fk_flow), workid);
                    wf.DoDeleteWorkFlowByReal(true);
                }
                catch
                {
                }
                this.Session["info"] = "流程删除成功";
                break;

            case "UnShift":
                try
                {
                    WorkFlow mwf = new WorkFlow(this.FK_Flow, this.WorkID);
                    string   str = mwf.DoUnShift();
                    this.Session["info"] = str;
                }
                catch (Exception ex)
                {
                    this.Session["info"] = "@执行撤消失败。@失败信息" + ex.Message;
                }
                break;

            case "UnSend":
                try
                {
                    string str = BP.WF.Dev2Interface.Flow_DoUnSend(this.FK_Flow, this.WorkID);
                    this.Session["info"] = str;
                }
                catch (Exception ex)
                {
                    this.Session["info"] = "@执行撤消失败。@失败信息" + ex.Message;
                }
                break;

            default:
                break;
            }


            string s = this.Session["info"] as string;

            this.Session["info"] = null;
            if (s == null)
            {
                s = this.Application["info" + WebUser.No] as string;
            }

            if (s == null)
            {
                s = Glo.SessionMsg;
            }

            if (s != null)
            {
                if (this.PageID.Contains("Small"))
                {
                    this.Add("<br/>");
                    this.Add("<br/>");
                }

                s = s.Replace("@@", "@");
                s = s.Replace("@", "<BR>@");
                this.Add("<div style='width:500px;text-align:center'>");
                if (WebUser.IsWap)
                {
                    this.AddFieldSet("<a href=Home.aspx ><img src='/WF/Img/Home.gif' border=0/>Home</a> - 操作提示", s);
                }
                else
                {
                    this.AddFieldSet("操作提示", s);
                }

                this.Add("<br><br></div>");
                return;
            }

            //  string sql = "SELECT * FROM WF_EmpWorks WHERE FK_Emp='" + BP.Web.WebUser.No + "'  AND FK_Flow='" + this.FK_Flow + "' ORDER BY WorkID ";
            DataTable dt = BP.WF.Dev2Interface.DB_GenerEmpWorksOfDataTable();// BP.DA.DBAccess.RunSQLReturnTable(sql);

            int colspan = 9;

            this.AddTable(" style='border=1px;align=center;width=80%;height:450px;");
            this.AddCaption("待办工作");
            this.AddTR();
            this.AddTDTitle("ID");
            this.AddTDTitle("流程");
            this.AddTDTitle("节点");
            this.AddTDTitle("标题");
            this.AddTDTitle("发起");
            this.AddTDTitle("发起日期");
            this.AddTDTitle("接受日期");
            this.AddTDTitle("期限");
            this.AddTDTitle("状态");
            this.AddTREnd();

            int      i   = 0;
            bool     is1 = false;
            DateTime cdt = DateTime.Now;

            foreach (DataRow dr in dt.Rows)
            {
                string sdt = dr["SDT"] as string;
                is1 = this.AddTR(is1); // ("onmouseover='TROver(this)' onmouseout='TROut(this)' onclick=\"\" ");
                i++;
                this.AddTDIdx(i);
                this.AddTD(dr["FlowName"].ToString());
                this.AddTD(dr["NodeName"].ToString());
                this.AddTD("<a href=\"MyFlow.aspx?FK_Flow=" + dr["FK_Flow"] + "&FID=" + dr["FID"] + "&WorkID=" + dr["WorkID"] + "\" >" + dr["Title"].ToString());
                this.AddTD(dr["Starter"].ToString());
                this.AddTD(dr["RDT"].ToString());
                this.AddTD(dr["ADT"].ToString());
                this.AddTD(dr["SDT"].ToString());
                DateTime mysdt = DataType.ParseSysDate2DateTime(sdt);
                if (cdt >= mysdt)
                {
                    this.AddTD("<font color=red>逾期</font>");
                }
                else
                {
                    this.AddTD("正常");
                }
                this.AddTREnd();
            }
            this.AddTRSum();
            this.AddTD("colspan=" + colspan, "&nbsp;");
            this.AddTREnd();
            this.AddTableEnd();
        }
Exemple #12
0
        private void SetState()
        {
            try
            {
                this.Btn_ComeBackFlow.Enabled       = false;
                this.Btn_DeleteFlowByFlag.Enabled   = false;
                this.Btn_DeleteWFByRealReal.Enabled = false;
                this.Btn_StopWorkFlow.Enabled       = false;
                Int64 workId = Int64.Parse(this.Request.QueryString["WorkID"]);
                //int nodeId=int.Parse(this.Request.QueryString["WorkID"]);
                string flowNo = this.Request.QueryString["FK_Flow"];
                if (workId == 0)
                {
                    this.Alert("@您没有选择流程,操作无效。", false);
                    this.WinClose();
                    return;
                }
                WorkFlow wf = new WorkFlow(new Flow(flowNo), workId);
                if (wf.IsComplete)
                {
                    this.Alert("@流程已经完成,操作无效。", false);
                    this.WinClose();
                    return;
                }
                GenerWorkFlow gwf = new GenerWorkFlow();
                //workId,flowNo
                gwf.WorkID  = workId;
                gwf.FK_Flow = flowNo;
                if (gwf.IsExits == false)
                {
                    wf.DoDeleteWorkFlowByReal(true);
                    throw new Exception("系统出现错误,请与管理员联系:错误原因是当前的流程[" + flowNo + " id=" + workId + "],没有完成,但是流程表里已经不存在这此信息,此流程已经成为无效的流程,可能是测试信息,系统已经删除它。");
                }
                else
                {
                    gwf.Retrieve();
                }

                if (gwf.WFState == WFState.Complete)
                {
                    this.Alert("@流程已经完成,不能够对此操作.", false);
                    this.WinClose();
                    return;
                }
                else if (gwf.WFState == 0)
                {
                    this.Btn_DeleteFlowByFlag.Enabled = true;
                    this.Btn_StopWorkFlow.Enabled     = true;
                }
                else
                {
                    throw new Exception("error ");
                }
                this.Label1.Text = "当前流程状态:" + gwf.WFState;

                Flow fl = new Flow(gwf.FK_Flow);
                //显示日志信息
                StartWork sw = (StartWork)fl.HisStartNode.HisWork;
                sw.OID = workId;
                if (sw.IsExits == false)
                {
                    gwf.Delete();
                    throw new Exception("@开始节点已经物理删除.流程出现错误, 此条流程已经失效, 请你关闭窗口返回系统,刷新记录.");
                }
                sw.Retrieve();


                // 判断流程能不能够删除的权限.

                /*
                 * 如果是  4 涉税审批流程.
                 * 就让征收科室来处理,
                 * 否则让mdg 处理.
                 * */
                if (fl.FK_FlowSort == "4")
                {
                    /* 法征科 */
                    if (WebUser.FK_Dept == "000003")
                    {
                        this.Btn_DeleteWFByRealReal.Enabled = true;
                    }
                }
                else
                {
                    if (WebUser.FK_Dept == "000001")
                    {
                        this.Btn_DeleteWFByRealReal.Enabled = true;
                    }
                }
                //this.UCWFRpt1.BindDataV2(wf);
            }
            catch (Exception ex)
            {
                this.Alert(ex);
                this.WinClose();
            }
        }
Exemple #13
0
        private void Btn_Click_Click(object sender, System.EventArgs e)
        {
            string msg = "";

            try
            {
                Int64         workId = Int64.Parse(this.Request.QueryString["WorkID"]);
                GenerWorkFlow gwf = new GenerWorkFlow(workId);
                WorkFlow      wf = new WorkFlow(new Flow(gwf.FK_Flow), workId);
                BP.Web.Controls.ToolbarBtn btn = (BP.Web.Controls.ToolbarBtn)sender;
                string title, docs;
                switch (btn.ID)
                {
                case "Btn_StopWorkFlow":
                    msg = "@终止流程出现错误.:";
                    //	wf.DoStopWorkFlow(this.TB1.Text);
                    // 发送消息到相关人员。
                    title = "强制终止[" + gwf.Title + "]流程通知";
                    docs  = this.TB1.Text;
                    //WFPubClass.SendMsg( new WorkNodes(gwf.HisFlow,workId),title,docs);

                    this.ResponseWriteBlueMsg("@强制终止流程成功.并发送系统消息到流程上的相关人员。");
                    break;

                case "Btn_DeleteFlowByFlag":
                    msg = "@逻辑删除流程出现错误.:";
//						wf.DoDeleteWorkFlowByFlag(this.TB1.Text);
                    // 发送消息到相关人员。
                    title = "逻辑删除[" + gwf.Title + "]流程通知";
                    docs  = this.TB1.Text;
                    //	WFPubClass.SendMsg( new WorkNodes(gwf.HisFlow,workId),title,docs);
                    this.ResponseWriteBlueMsg("@逻辑删除流程成功,并发送系统消息到流程上的相关人员.");
                    break;

                case "Btn_ComeBackFlow":
                    msg = "@恢复使用流程出现错误.:";
                    wf.DoComeBackWrokFlow(this.TB1.Text);

                    // 发送消息到相关人员。
                    title = "恢复使用流程[" + gwf.Title + "]流程通知";
                    docs  = this.TB1.Text;
                    //WFPubClass.SendMsg( new WorkNodes(gwf.HisFlow,workId),title,docs);
                    this.ResponseWriteBlueMsg("@恢复使用流程成功,并发送系统消息到流程上的相关人员");
                    break;

                case "Btn_DeleteWFByRealReal":
                    msg = "@物理删除流程出现错误.:";
                    wf.DoDeleteWorkFlowByReal(true);
                    // 发送消息到相关人员。
                    title = "物理删除[" + gwf.Title + "]流程通知";
                    docs  = this.TB1.Text;


                    this.ResponseWriteBlueMsg("@物理删除流程成功...");
                    this.WinClose();
                    break;

                case "Btn_Close":
                    this.WinClose();
                    return;

                default:
                    break;
                }
                this.SetState();
            }
            catch (Exception ex)
            {
                BP.DA.Log.DefaultLogWriteLine(BP.DA.LogType.Error, msg + ex.Message);
                this.ResponseWriteRedMsg(msg + ex.Message);
            }
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            workid    = this.Request.QueryString["WorkID"];
            fk_Flow   = this.Request.QueryString["FK_Flow"];
            fk_Node   = this.Request.QueryString["FK_Node"];
            doType    = this.Request.QueryString["DoType"];
            workIDint = Int64.Parse(workid);

            #region 功能执行
            try
            {
                switch (this.Request.QueryString["DoType"])
                {
                case "Del":
                    WorkFlow wf = new WorkFlow(fk_Flow, workIDint);
                    wf.DoDeleteWorkFlowByReal(true);
                    this.WinCloseWithMsg("流程已经被删除.");
                    break;

                case "HungUp":
                    WorkFlow wf1 = new WorkFlow(fk_Flow, workIDint);
                    //wf1.DoHungUp(HungUpWa;
                    this.WinCloseWithMsg("流程已经被挂起.");
                    break;

                case "UnHungUp":
                    WorkFlow wf2 = new WorkFlow(fk_Flow, workIDint);
                    //  wf2.DoUnHungUp();
                    this.WinCloseWithMsg("流程已经被解除挂起.");
                    break;

                case "ComeBack":
                    WorkFlow wf3 = new WorkFlow(fk_Flow, workIDint);
                    wf3.DoComeBackWrokFlow("无");
                    this.WinCloseWithMsg("流程已经被回复启用.");
                    break;

                case "Takeback": /*取回审批.*/
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Alert("执行功能:" + doType + ",出现错误:" + ex.Message);
            }
            #endregion

            int     wfState     = BP.DA.DBAccess.RunSQLReturnValInt("SELECT WFState FROM WF_GenerWorkFlow WHERE WorkID=" + workid, 1);
            WFState wfstateEnum = (WFState)wfState;
            this.Pub2.AddH3("您可执行的操作<hr>");
            switch (wfstateEnum)
            {
            case WFState.Runing:           /* 运行时*/
                this.FlowOverByCoercion(); /*删除流程.*/
                this.TackBackCheck();      /*取回审批*/
                this.Hurry();              /*催办*/
                this.UnSend();             /*撤销发送*/
                break;

            case WFState.Complete: // 完成.
            case WFState.Delete:   // 逻辑删除..
                this.RollBack();   /*恢复使用流程*/
                break;

            case WFState.HungUp:    // 挂起.
                this.AddUnHungUp(); /*撤销挂起*/
                break;

            default:
                break;
            }
        }