예제 #1
0
        //返回頁面地址給iframe的src
        public string Address()
        {
            if (url.Length > 1)
            {
                string userId = (base.Request.QueryString["UserId"] == null) ? "" : base.Request.QueryString["UserId"].ToString().Trim();
                string moduleCode = (base.Request.QueryString["ModuleCode"] == null) ? "" : base.Request.QueryString["ModuleCode"].ToString().Trim();

                //從人事端口登錄時,取得其傳出的UserId,填充Session,防止在部份電腦中出現頁面跳出的問題。
                if (!string.IsNullOrEmpty(userId))
                {
                    PersonBll personBll = new PersonBll();
                    List<PersonModel> user = personBll.GetPersonUserId(userId);
                    if (user == null || user.Count < 1)
                    {
                        Response.Redirect("http://10.138.4.205:100");
                    }
                    else
                    {
                        Session[GlobalData.UserInfoSessionKey] = user[0];//填充用戶Session
                    }
                }
                //url = url.Substring(1) + "?ModuleCode="+moduleCode;
                url = url.Substring(1) + "?UserId=" + userId + "&ModuleCode=" + moduleCode;
                //url = url + "?UserId=ADMIN";
            }
            return url;
        }
예제 #2
0
        //替換工號
        protected void btn_replace_Click(object sender, EventArgs e)
        {
            string[] info = ddlDocnoType.SelectedValuesToString(",").Split(new char[] { ',' });
            string y = tb_y_empno.Text.Trim();
            string n = tb_n_newpno.Text.Trim();
            PersonBll person = new PersonBll();
            List<PersonModel> listperson = person.GetPersonUserId(y);
            List<PersonModel> listperson1 = person.GetPersonUserId(n);
            if (!(listperson != null && listperson.Count > 0))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('" + Message.YempnonotExit + "');</script>");
                return;
            }
            if (!(listperson1 != null && listperson1.Count > 0))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('" + Message.NempnonoExit + "');</script>");
                return;
            }

            if (workflowset.ReplaceAllEmpno(info, y, n, listperson1[0].Cname, listperson1[0].Mail, workflowset.GetManager(n)))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('" + Message.ReplaceOK + "');</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('" + Message.DeleteFailed + "');</script>");
            }
        }