Esempio n. 1
0
        /// <summary>
        /// dd
        /// </summary>
        public void BindLB()
        {
            // 当前用的员工权限。
            this.Clear();

            GenerWorkerLists wls = new GenerWorkerLists(this.WorkID, this.NodeID, true);
            string           sql = "SELECT * FROM WF_RememberMe WHERE FK_Emp='" + WebUser.No + "' AND FK_Node=" + this.NodeID;
            DataTable        dt  = DBAccess.RunSQLReturnTable(sql);

            if (WebUser.IsWap)
            {
                this.AddFieldSet("<a href='./WAP/Home.aspx' ><img src='/WF/Img/Home.gif' border=0/>主页</a> - 工作分配");
            }
            else
            {
                this.AddFieldSet("工作分配");
            }

            if (dt.Rows.Count == 0)
            {
                throw new Exception("@系统错误..." + sql);
            }

            string[] objs = dt.Rows[0]["Objs"].ToString().Split('@');
            string[] emps = dt.Rows[0]["Emps"].ToString().Split('@');

            string ids = "";

            this.AddUL();
            foreach (string fk_emp in emps)
            {
                if (fk_emp == null || fk_emp == "")
                {
                    continue;
                }

                Emp      emp = new Emp(fk_emp);
                CheckBox cb  = new CheckBox();
                cb.ID = "CB_" + fk_emp;
                ids  += "," + cb.ID;

                if (Glo.IsShowUserNoOnly)
                {
                    cb.Text = emp.No;
                }
                else
                {
                    cb.Text = emp.No + "  , " + emp.Name;
                }

                GenerWorkerList wl = wls.GetEntityByKey(GenerWorkerListAttr.FK_Emp, fk_emp) as GenerWorkerList;
                if (wl == null)
                {
                    cb.Checked = false;
                }
                else
                {
                    cb.Checked = wl.IsEnable;
                }
                this.Add("<li>");
                this.Add(cb);
                this.Add("</li>");
                //this.AddBR();
            }
            this.AddULEnd();

            this.AddHR();
            Btn btn = new Btn();

            btn.ID     = "Btn_Do";
            btn.Text   = "  确定  ";
            btn.Click += new EventHandler(BPToolBar1_ButtonClick);
            this.Add(btn);

            CheckBox cbx = new CheckBox();

            cbx.ID      = "seleall";
            cbx.Text    = "选择全部";
            cbx.Checked = true;
            cbx.Attributes["onclick"] = "SetSelected(this,'" + ids + "')";
            this.Add(cbx);
            //this.Add("<input type=button value='取消' onclick='window.close();'  />");
            this.Add("<br><br>帮助:系统会记住本次的工作指定,下次您在发送时间它会自动把工作投递给您本次指定的人。");
            this.AddFieldSetEnd();
        }
Esempio n. 2
0
        public void Confirm()
        {
            GenerWorkerLists wls = new GenerWorkerLists(this.WorkID, this.NodeID, true);
            string           sql = "SELECT * FROM WF_RememberMe WHERE FK_Emp='" + WebUser.No + "' AND FK_Node=" + this.NodeID;
            DataTable        dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count == 0)
            {
                throw new Exception("@system error.....");
            }

            try
            {
                string[] objs    = dt.Rows[0]["Objs"].ToString().Split('@');
                string[] empStrs = dt.Rows[0]["Emps"].ToString().Split('@');

                ArrayList        al      = new ArrayList();
                GenerWorkerLists wlSeles = new GenerWorkerLists();

                foreach (string fk_emp in empStrs)
                {
                    if (fk_emp == null || fk_emp == "")
                    {
                        continue;
                    }

                    CheckBox cb = this.GetCBByID("CB_" + fk_emp);
                    if (cb == null)
                    {
                        BP.DA.Log.DebugWriteWarning("不应该查询不到:" + fk_emp);
                        continue;
                    }

                    if (cb.Checked == false)
                    {
                        continue;
                    }

                    GenerWorkerList wl = wls.GetEntityByKey(GenerWorkerListAttr.FK_Emp, fk_emp) as GenerWorkerList;
                    al.Add(cb.ID.Substring(3));
                    wlSeles.AddEntity(wl);
                }

                if (al.Count == 0)
                {
                    this.Alert("当前工作中你没有分配给任何人,此工作将不能被其他人所执行!");
                    return;
                }

                if (this.IsFHL)
                {
                    /* 处理分合流 */
                    this.DealWithFHLFlow(al, wlSeles);
                }
                else
                {
                    this.DealWithPanelFlow(al, wlSeles);
                }

                // 保存记忆功能。
                RememberMe rm = new RememberMe();
                rm.FK_Emp  = BP.Web.WebUser.No;
                rm.FK_Node = NodeID;
                rm.Objs    = "@";
                rm.ObjsExt = "";

                foreach (GenerWorkerList mywl in wlSeles)
                {
                    rm.Objs    += mywl.FK_Emp + "@";
                    rm.ObjsExt += mywl.FK_EmpText + "&nbsp;&nbsp;";
                }

                rm.Emps    = "@";
                rm.EmpsExt = "";

                foreach (GenerWorkerList wl in wls)
                {
                    rm.Emps += wl.FK_Emp + "@";

                    if (rm.Objs.IndexOf(wl.FK_Emp) != -1)
                    {
                        rm.EmpsExt += "<font color=green>(" + wl.FK_Emp + ")" + wl.FK_EmpText + "</font>&nbsp;&nbsp;";
                    }
                    else
                    {
                        rm.EmpsExt += "<strike>(" + wl.FK_Emp + ")" + wl.FK_EmpText + "</strike>&nbsp;&nbsp;";
                    }
                }

                rm.FK_Emp = BP.Web.WebUser.No;
                rm.Update();


                if (WebUser.IsWap)
                {
                    this.Clear();
                    this.AddFieldSet("提示信息");
                    this.Add("<br>&nbsp;&nbsp;任务分配成功,特别提示:当下一次流程发送时系统会按照您设置的路径进行智能投递。");
                    this.AddUL();
                    this.AddLi("<a href='./WAP/Home.aspx' ><img src='/WF/Img/Home.gif' border=0/>主页</a>");
                    this.AddLi("<a href='./WAP/Start.aspx' ><img src='/WF/Img/Start.gif' border=0/>发起</a>");
                    this.AddLi("<a href='./WAP/Runing.aspx' ><img src='/WF/Img/Runing.gif' border=0/>待办</a>");
                    this.AddULEnd();
                    this.AddFieldSetEnd();
                }
                else
                {
                    this.WinCloseWithMsg("任务分配成功。");
                }
            }
            catch (Exception ex)
            {
                this.Response.Write(ex.Message);
                Log.DebugWriteWarning(ex.Message);
                this.Alert("任务分配出错:" + ex.Message);
            }
        }