Ejemplo n.º 1
0
        /// <summary>
        /// 取回审批
        /// </summary>
        public void TackBackCheck()
        {
            GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID);

            /* 判断是否有取回审批的权限。*/
            this.Pub2.AddEasyUiPanelInfoBegin("取回审批");
            string sql    = "SELECT NodeID FROM WF_Node WHERE CheckNodes LIKE '%" + gwf.FK_Node + "%'";
            int    myNode = DBAccess.RunSQLReturnValInt(sql, 0);

            if (myNode != 0)
            {
                GetTask gt = new GetTask(myNode);
                if (gt.Can_I_Do_It() == true)
                {
                    this.Pub2.Add("功能执行:<a href=\"javascript:Takeback('" + WorkID + "','" + FK_Flow + "','" + gwf.FK_Node + "','" + myNode + "')\" >点击执行取回审批流程</a>。");
                    this.Pub2.AddBR("说明:如果被成功取回,ccflow就会把停留在别人工作节点上的工作发送到您的待办列表里。");
                }
            }
            else
            {
                this.Pub2.Add("您没有此权限.");
            }
            this.Pub2.AddEasyUiPanelInfoEnd();
            Pub2.AddBR();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取可操作状态信息
        /// </summary>
        /// <returns></returns>
        public string OP_GetStatus()
        {
            GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID);

            Hashtable ht = new Hashtable();

            string json = "{";
            bool   isCan;

            #region 文件打印的权限判断,这里为天业集团做的特殊判断,现实的应用中,都可以打印.
            bool CanPackUp = false;
            if (SystemConfig.CustomerNo == "TianYe")
            {
                bool isAdmin = false;
                if (BP.Web.WebUser.No == "admin")
                {
                    isAdmin = true;
                }

                //  if (BP.Web.WebUser.No == "admin" || BP.Web.WebUser.IsAdmin == true)

                // 判断是否可以打印.
                //string sql = "SELECT NDFrom,NDFromT,EmpFrom FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE WorkID=" + this.WorkID + " AND (EmpFrom='" + BP.Web.WebUser.No + "' OR  EmpTo='" + BP.Web.WebUser.No + "')  ";
                string    sql = "SELECT Distinct NDFrom, EmpFrom FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE WorkID=" + this.WorkID;
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                foreach (DataRow dr in dt.Rows)
                {
                    //判断节点是否启用了按钮?
                    int    nodeid = int.Parse(dr[0].ToString());
                    BtnLab btn    = new BtnLab(nodeid);
                    if (btn.PrintPDFEnable == true || btn.PrintZipEnable == true)
                    {
                        string empFrom = dr[1].ToString();
                        if (isAdmin == true || BP.Web.WebUser.No == empFrom || gwf.Starter == WebUser.No)
                        {
                            CanPackUp = true;
                            break;
                        }
                    }
                }
            }
            else
            {
                CanPackUp = true;
            }
            #endregion 文件打印的权限判断,这里为天业集团做的特殊判断,现实的应用中,都可以打印.

            ht.Add("CanPackUp", CanPackUp.ToString().ToLower());

            //是否可以打印.
            switch (gwf.WFState)
            {
            case WFState.Runing:     /* 运行时*/
                /*删除流程.*/
                isCan = BP.WF.Dev2Interface.Flow_IsCanDeleteFlowInstance(this.FK_Flow, this.WorkID, WebUser.No);

                ht.Add("CanFlowOverByCoercion", isCan.ToString().ToLower());

                /*取回审批*/
                isCan = false;
                string para   = "";
                string sql    = "SELECT NodeID FROM WF_Node WHERE CheckNodes LIKE '%" + gwf.FK_Node + "%'";
                int    myNode = DBAccess.RunSQLReturnValInt(sql, 0);

                if (myNode != 0)
                {
                    GetTask gt = new GetTask(myNode);
                    if (gt.Can_I_Do_It())
                    {
                        isCan = true;

                        ht.Add("TackBackFromNode", gwf.FK_Node);
                        ht.Add("TackBackToNode", myNode);
                    }
                }

                ht.Add("CanTackBack", isCan.ToString().ToLower());



                /*撤销发送*/
                GenerWorkerLists workerlists = new GenerWorkerLists();
                QueryObject      info        = new QueryObject(workerlists);
                info.AddWhere(GenerWorkerListAttr.FK_Emp, WebUser.No);
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.IsPass, "1");
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.IsEnable, "1");
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.WorkID, this.WorkID);
                isCan = info.DoQuery() > 0;
                ht.Add("CanUnSend", isCan.ToString().ToLower());
                break;

            case WFState.Complete:   // 完成.
            case WFState.Delete:     // 逻辑删除..
                /*恢复使用流程*/
                isCan = WebUser.No == "admin";
                ht.Add("CanRollBack", isCan.ToString().ToLower());
                //判断是否可以打印.
                break;

            case WFState.HungUp:     // 挂起.
                /*撤销挂起*/
                isCan = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(FK_Flow, FK_Node, WorkID, WebUser.No);

                ht.Add("CanUnHungUp", isCan.ToString().ToLower());
                break;

            default:
                break;
            }

            return(BP.Tools.Json.ToJson(ht));

            //return json + "}";
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取可操作状态信息
        /// </summary>
        /// <returns></returns>
        public string OP_GetStatus()
        {
            GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID);

            Hashtable ht = new Hashtable();

            string json = "{";
            bool   isCan;

            #region 文件打印的权限判断,这里为天业集团做的特殊判断,现实的应用中,都可以打印.
            bool CanPackUp = true;
            if (SystemConfig.CustomerNo == "TianYe" && WebUser.No != "admin")
            {
                CanPackUp = IsCanPrintSpecForTianYe(gwf);
            }
            #endregion 文件打印的权限判断,这里为天业集团做的特殊判断,现实的应用中,都可以打印.

            ht.Add("CanPackUp", CanPackUp.ToString().ToLower());

            //是否可以打印.
            switch (gwf.WFState)
            {
            case WFState.Runing:     /* 运行时*/
                /*删除流程.*/
                isCan = BP.WF.Dev2Interface.Flow_IsCanDeleteFlowInstance(this.FK_Flow, this.WorkID, WebUser.No);

                ht.Add("CanFlowOverByCoercion", isCan.ToString().ToLower());

                /*取回审批*/
                isCan = false;
                string para   = "";
                string sql    = "SELECT NodeID FROM WF_Node WHERE CheckNodes LIKE '%" + gwf.FK_Node + "%'";
                int    myNode = DBAccess.RunSQLReturnValInt(sql, 0);

                if (myNode != 0)
                {
                    GetTask gt = new GetTask(myNode);
                    if (gt.Can_I_Do_It())
                    {
                        isCan = true;

                        ht.Add("TackBackFromNode", gwf.FK_Node);
                        ht.Add("TackBackToNode", myNode);
                    }
                }
                ht.Add("CanTackBack", isCan.ToString().ToLower());

                /*撤销发送*/
                GenerWorkerLists workerlists = new GenerWorkerLists();
                QueryObject      info        = new QueryObject(workerlists);
                info.AddWhere(GenerWorkerListAttr.FK_Emp, WebUser.No);
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.IsPass, "1");
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.IsEnable, "1");
                info.addAnd();
                info.AddWhere(GenerWorkerListAttr.WorkID, this.WorkID);
                isCan = info.DoQuery() > 0;
                ht.Add("CanUnSend", isCan.ToString().ToLower());
                break;

            case WFState.Complete:     // 完成.
            case WFState.Delete:       // 逻辑删除..
                /*恢复使用流程*/
                isCan = WebUser.No == "admin";
                ht.Add("CanRollBack", isCan.ToString().ToLower());

                ht.Add("Rollback", "1");


                //判断是否可以打印.
                break;

            case WFState.HungUp:     // 挂起.
                /*撤销挂起*/
                isCan = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(WorkID, WebUser.No);

                ht.Add("CanUnHungUp", isCan.ToString().ToLower());
                break;

            default:
                break;
            }

            return(BP.Tools.Json.ToJson(ht));

            //return json + "}";
        }