Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e) //寫入目前使用者姓名
        {                                                    //登入檢查
            Label1.Text = User.Identity.Name.ToString();
            if (!IsPostBack)
            {
                if (User.Identity.IsAuthenticated)
                {
                    // 正確登入
                }
                else
                {
                    string strJS = "alert('瀏覽此頁面需先登入');location.href = ('JuicWMS2.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", strJS, true);
                    // 違法登入!!!!
                }
                JuicDao dao = new JuicDao("MENU");

                var Userdata = dao.GetUserdata(User.Identity.Name.ToString());

                if (Userdata.Rows.Count != 0)
                {
                    //TextBox4.Text = Userdata.Rows[0]["tel1"].ToString();
                    TextBox5.Text = Userdata.Rows[0]["mtel"].ToString();
                    TextBox6.Text = Userdata.Rows[0]["addr1"].ToString();
                    //TextBox7.Text = Userdata.Rows[0]["addr2"].ToString();
                    Label4.Text    = Userdata.Rows[0]["addr2"].ToString();
                    TextBox8.Text  = Userdata.Rows[0]["attn"].ToString();
                    TextBox9.Text  = Userdata.Rows[0]["rela_tel"].ToString();
                    TextBox10.Text = Userdata.Rows[0]["rela_addr"].ToString();
                    TextBox11.Text = Userdata.Rows[0]["rela"].ToString();
                    TextBox4.Text  = Userdata.Rows[0]["tel1"].ToString();
                }

                var CheckUserdata = dao.CheckUserdata(User.Identity.Name.ToString());
                if (CheckUserdata.Rows.Count != 0)
                {
                    Label2.Visible = true;
                    Label3.Visible = true;
                }

                var Bkcomment = dao.Bkcomment(User.Identity.Name.ToString());
                if (Bkcomment.Rows.Count != 0)
                {
                    if (Bkcomment.Rows[0]["hrbkcomment"].ToString() != "")
                    {
                        Label5.Text = "先前個人資料修改被退件,請重新申請,退件理由:" + Bkcomment.Rows[0]["hrbkcomment"].ToString();
                    }
                }
            }
            //-------------------------------------------------------------------------------------
        }