Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
            {
                #region approval page

                if (!string.IsNullOrEmpty(Request.QueryString["SN"]))
                {
                    ProcessSN = Request.QueryString["SN"];
                    string formID       = string.Empty;
                    string activityName = string.Empty;
                    string processID    = string.Empty;
                    string approveXML   = string.Empty;     //取得审批XML
                    //FBA to AD
                    //WorkflowHelper.GetProcessInfo(MUID, Password, ProcessSN, ref processID, ref activityName);
                    //任务占用提示 edit by lee
                    try
                    {
                        //WorkflowHelper.GetProcessInfo(ProcessSN, ref formID, ref processID, ref activityName, ref approveXML);//,StaffNo);
                        WorkflowHelper.GetSCFProcessInfo(ProcessSN, ref formID, ref processID, ref activityName, ref approveXML);
                        FormID = formID;
                        //ProcessID = processID;
                        string FName = FormID.Substring(0, 3);
                        ActivityName = activityName;
                        ActivityXml  = approveXML;
                    }
                    catch (Exception ex)
                    {
                        //is not allowed to open the worklist item with
                        if (ex.Message.Contains("26030"))
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "try{ymPrompt=top.ymPrompt}catch(e){} ymPrompt.alert({ message: '此任务已被他人处理或占用,您已无法处理!', title: '任务提示', handler:function() {window.location.href='/WorkSpace/MyWorklist.aspx ';}});", true);
                            return;
                        }
                        else
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "try{ymPrompt=top.ymPrompt}catch(e){} ymPrompt.alert({ message: '此任务已被他人处理或被占用!', title: '任务提示', handler:function() {window.location.href='/WorkSpace/MyWorklist.aspx ';}});", true);
                            return;
                        }
                    }

                    //if (ActivityPageName(FName) != GetPageName())
                    //    throw new Exception("00001 You have no permission to open this process.");
                }
                #endregion

                #region HR C&B
                if (!string.IsNullOrEmpty(Request.QueryString["FormID"]))
                {
                    FormID = Request.QueryString["FormID"];
                }
                #endregion


                #region draft page
                if (!string.IsNullOrEmpty(Request.QueryString["FormID"]) && IsDraftPage)
                {
                    FormID = Request.QueryString["FormID"];
                }
                #endregion
            }
            base.OnLoad(e);
        }