示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!YZAuthHelper.IsAuthenticated)
        {
            FormsAuthentication.RedirectToLoginPage();
            return;
        }

        int    tid = Int32.Parse(this.Request["tid"]);
        string formFile;

        using (BPMConnection cn = new BPMConnection())
        {
            cn.WebOpen();
            formFile = BPMProcess.GetDefaultReadForm(cn, tid);
        }

        if (String.IsNullOrEmpty(formFile))
        {
            throw new Exception(Resources.YZStrings.Aspx_Read_MissForm);
        }
        else
        {
            YZUrlBuilder urlBuilder = YZUtility.GetFormRedirectUrl(this.Page, formFile);
            this.Response.Redirect(urlBuilder.ToString(), true);
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AspxHelper.IsAuthenticated)
        {
            FormsAuthentication.RedirectToLoginPage();
        }

        int tid = Int32.Parse(this.Request["tid"]);

        string formFile;

        using (BPMConnection cn = new BPMConnection())
        {
            cn.WebOpen(this.Page);

            string token = Request.QueryString["token"];
            if (String.IsNullOrEmpty(token))
            {
                if (!SecurityManager.CheckTaskAccessPermision(cn, tid, BPMPermision.TaskRead, cn.UID))
                {
                    throw new BPMException(BPMExceptionType.PermDeniedReadForm);
                }
            }
            else
            {
                if (!AspxHelper.CheckTaskAccessToken(tid, token) &&
                    !SecurityManager.CheckTaskAccessPermision(cn, tid, BPMPermision.TaskRead, cn.UID))
                {
                    throw new BPMException(BPMExceptionType.PermDeniedReadForm);
                }
            }

            formFile = BPMProcess.GetDefaultReadForm(cn, tid);
        }

        if (String.IsNullOrEmpty(formFile))
        {
            throw new Exception(Resources.BPMResource.Read_MissForm);
        }
        else
        {
            if (formFile.IndexOf('?') != -1)
            {
                this.Server.Transfer(this.ResolveClientUrl("../XForm/") + formFile + "&" + this.Request.QueryString.ToString(), false);
            }
            else
            {
                this.Server.Transfer(this.ResolveClientUrl("../XForm/") + formFile + "?" + this.Request.QueryString.ToString(), false);
            }

            this.Response.End();
        }
    }