Пример #1
0
 protected void Btn_Cancel_Click(object sender, EventArgs e)
 {
     TB_UserName.Focus();
     TB_UserName.Text  = "";
     TB_Telephone.Text = "";
     TB_Email.Text     = "";
 }
Пример #2
0
 private void CheckUserNamePassword()
 {
     if (TB_UserName.Text == "rppp" && TB_Password.Text == "7353")
     {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         MessageBox.Show("Invalid User Name or Password.. Contact the Great Gazoo");
         TB_UserName.Text = "";
         TB_UserName.Focus();
         TB_Password.Text = "";
     }
 }
Пример #3
0
        protected void Btn_save_Click(object sender, EventArgs e)
        {
            //if (TB_UserName.Text == "")
            //{
            //    Response.Write("<script>alert('用户姓名不能为空')</script>");
            //    TB_UserName.Focus();
            //    return;
            //}

            sr_User users     = new sr_User();
            string  UserID    = Session["UserID"].ToString();
            string  UserName  = TB_UserName.Text.ToString().Trim();
            string  Sex       = DropDL_Sex.SelectedValue;
            string  Unit      = TB_Unit.SelectedValue;
            string  Education = DropDL_Degree.SelectedValue;
            string  ZhiCheng  = TB_ZhiCheng.SelectedValue;

            string Telephone = TB_Telephone.Text.ToString().Trim();
            string InOffice  = DropDL_Job.SelectedIndex.ToString();//...
            string Email     = TB_Email.Text.ToString().Trim();

            if (users.UpdateGeRenXinXi(UserName, Sex, Unit, Education, ZhiCheng, Telephone, InOffice, Email, UserID))
            {
                Response.Write("<script>alert('信息更新成功')</script>");
            }
            else
            {
                Response.Write("<script>alert('信息更新失败')</script>");
                return;
            }
            TB_UserName.Focus();
            TB_UserName.Text  = "";
            TB_Telephone.Text = "";
            TB_Email.Text     = "";

            Session["UserName"] = users.GetUserName(Session["UserID"].ToString()); //更新完信息后再将UserName保存到session
        }