Beispiel #1
0
        public void Bind1_1_ShowFlowNodeEmp(Flow fl)
        {
            Node nd = new Node(int.Parse(this.FK_Node));

            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft("<a href='BPR.aspx?FK_Flow=" + this.FK_Flow + "'>返回</a> - " + fl.Name + "-" + nd.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("Idx");
            this.Pub1.AddTDTitle("操作员");
            this.Pub1.AddTDTitle("执行数量");
            this.Pub1.AddTREnd();

            string sql = "SELECT DISTINCT Rec FROM ND" + nd.NodeID;

            BP.WF.Port.WFEmps emps = new BP.WF.Port.WFEmps();
            emps.RetrieveInSQL(sql);

            int   idx = 0;
            bool  is1 = false;
            float val = 0;

            foreach (BP.WF.Port.WFEmp emp in emps)
            {
                idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD("<a href=\"javascript:WinOpen('BPR.aspx?FK_Flow=" + this.FK_Flow + "&FK_Emp=" + emp.No + "&FK_Node=" + this.FK_Node + "')\">" + emp.Name);
                val = DBAccess.RunSQLReturnValFloat("SELECT COUNT(WorkID) FROM ND" + nd.NodeID + " WHERE Rec='" + emp.No + "'");
                this.Pub1.AddTDNum("<a href='BPR.aspx?FK_Flow=" + this.FK_Flow + "&FK_Emp=" + emp.No + "&FK_Node=" + this.FK_Node + "'>" + val + "</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
        public void GenerAllImg()
        {
            BP.WF.Port.WFEmps empWFs = new BP.WF.Port.WFEmps();
            empWFs.RetrieveAll();

            foreach (BP.WF.Port.WFEmp emp in empWFs)
            {
                if (System.IO.File.Exists(BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\" + emp.No + ".JPG") ||
                    System.IO.File.Exists(BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\" + emp.Name + ".JPG"))
                {
                    continue;
                }

                try
                {
                    string path   = BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\T.JPG";
                    string pathMe = BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\" + emp.No + ".JPG";
                    File.Copy(BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\Templete.JPG",
                              path, true);


                    string fontName          = "宋体";
                    System.Drawing.Image img = System.Drawing.Image.FromFile(path);
                    Font     font            = new Font(fontName, 15);
                    Graphics g = Graphics.FromImage(img);
                    System.Drawing.SolidBrush   drawBrush  = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
                    System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(StringFormatFlags.DirectionVertical);//文本
                    g.DrawString(emp.Name, font, drawBrush, 3, 3);

                    try
                    {
                        File.Delete(pathMe);
                    }
                    catch
                    {
                    }
                    img.Save(pathMe);
                    img.Dispose();
                    g.Dispose();

                    File.Copy(pathMe,
                              BP.Sys.SystemConfig.PathOfDataUser + "\\Siganture\\" + emp.Name + ".JPG", true);
                }
                catch
                {
                }
            }
        }
Beispiel #3
0
        public void BindWap()
        {
            this.AddTable("align=center");
            this.AddTR();
            this.AddTD("colspan=4 align=left class=FDesc", "<a href='Home.aspx'><img src='/WF/Img/Home.gif' border=0/>Home</a> - 成员");
            this.AddTREnd();

            BP.Port.Depts depts = new BP.Port.Depts();
            depts.RetrieveAllFromDBSource();

            BP.WF.Port.WFEmps emps = new BP.WF.Port.WFEmps();
            emps.RetrieveAllFromDBSource();

            // BP.WF.Port.WFEmp.DTSData();

            int idx = 0;

            foreach (BP.Port.Dept dept in depts)
            {
                this.AddTRSum();
                this.AddTD("colspan=4", dept.Name);
                this.AddTREnd();
                foreach (BP.WF.Port.WFEmp emp in emps)
                {
                    if (emp.FK_Dept != dept.No)
                    {
                        continue;
                    }

                    idx++;
                    this.AddTR();
                    this.AddTD(idx);
                    this.AddTD(emp.Name);
                    this.AddTD(emp.Tel);
                    this.AddTD(emp.Stas);
                    this.AddTREnd();
                }
            }
            this.AddTableEnd();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "Empleyes";
            if (WebUser.IsWap)
            {
                this.BindWap();
                return;
            }

            string    sql = "SELECT a.No,a.Name, b.Name as DeptName FROM Port_Emp a, Port_Dept b WHERE a.FK_Dept=b.No ORDER BY a.FK_Dept ";
            DataTable dt  = BP.DA.DBAccess.RunSQLReturnTable(sql);

            BP.WF.Port.WFEmps emps = new BP.WF.Port.WFEmps();
            if (this.DoType != null)
            {
                emps.RetrieveAllFromDBSource();
            }
            else
            {
                emps.RetrieveAllFromDBSource();
            }

            this.Pub1.AddTable("width=100% align=left");
            this.Pub1.AddCaptionMsg("通讯录");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("部门");
            this.Pub1.AddTDTitle("人员");
            this.Pub1.AddTDTitle("Tel");
            this.Pub1.AddTDTitle("Email");
            this.Pub1.AddTDTitle("岗位"); // <a href=Emps.aspx?DoType=1>刷新</a> ");
            this.Pub1.AddTDTitle("签名");
            if (WebUser.No == "admin")
            {
                this.Pub1.AddTDTitle("顺序");
            }

            if (this.DoType != null)
            {
                BP.WF.Port.WFEmp.DTSData();
                this.GenerAllImg();
            }
            this.Pub1.AddTREnd();

            string keys     = DateTime.Now.ToString("MMddhhmmss");
            string deptName = null;
            int    idx      = 0;

            EmpStations ess = new EmpStations();

            ess.RetrieveAll();

            foreach (DataRow dr in dt.Rows)
            {
                string fk_emp = dr["No"].ToString();
                if (fk_emp == "admin")
                {
                    continue;
                }

                idx++;
                if (dr["DeptName"].ToString() != deptName)
                {
                    deptName = dr["DeptName"].ToString();
                    this.Pub1.AddTRSum();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(deptName);
                }
                else
                {
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD();
                }

                this.Pub1.AddTD(fk_emp + "-" + dr["Name"]);

                BP.WF.Port.WFEmp emp = emps.GetEntityByKey(fk_emp) as BP.WF.Port.WFEmp;
                if (emp != null)
                {
                    //this.Pub1.AddTD(emp.TelHtml);
                    //this.Pub1.AddTD(emp.EmailHtml);

                    this.Pub1.AddTD();
                    this.Pub1.AddTD();

                    string stas = "";
                    foreach (EmpStation es in ess)
                    {
                        if (es.FK_Emp != emp.No)
                        {
                            continue;
                        }
                        stas += es.FK_StationT + ",";
                    }
                    this.Pub1.AddTD(stas);
                }
                else
                {
                    this.Pub1.AddTD("");
                    this.Pub1.AddTD("");
                    this.Pub1.AddTD("");
                    //break;
                }

                this.Pub1.AddTD("<img src='../DataUser/Siganture/" + fk_emp + ".jpg' border=1 onerror=\"this.src='../DataUser/Siganture/UnName.jpg'\"/>");
                if (WebUser.No == "admin" && emp != null)
                {
                    this.Pub1.AddTD("<a href=\"javascript:DoUp('" + emp.No + "','" + keys + "')\" ><img src='Img/Btn/Up.gif' border=0 /></a>-<a href=\"javascript:DoDown('" + emp.No + "','" + keys + "')\" ><img src='Img/Btn/Down.gif' border=0 /></a>");
                }
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Beispiel #5
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);
            }
        }