Ejemplo n.º 1
0
 protected void btn_regist_Click(object sender, EventArgs e)
 {
     try
     {
         userinfo.UserName = Username.Text.Trim();
         userinfo.Name     = Truename.Text.Trim();
         userinfo.Password = password_confirmation.Text.Trim();
         userinfo.Email    = email.Text.Trim();
         userinfo.Address  = address.Text.Trim();
         userinfo.Datetime = DateTime.Now.ToString();
         int i = Bll_UserInfo.Add_User(userinfo);
         if (i > 0)
         {
             Response.Write(" <script>function window.onload() {alert( 'Regist Sucessfully' ); } </script> ");
         }
         else
         {
             Response.Write(" <script>function window.onload() {alert( 'Regist Failed' ); } </script> ");
         }
     }
     catch (Exception xx)
     {
         Response.Write(" <script>function window.onload() {alert( '" + xx.ToString() + "' ); } </script> ");
     }
 }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     user.UserName = txt_username.Text.Trim();
     user.Password = txt_repwd.Text.Trim();
     user.Email    = txt_email.Text.Trim();
     user.Name     = txt_truename.Text.Trim();
     user.Address  = txt_address.Text.Trim();
     user.Datetime = DateTime.Now.ToString();
     try
     {
         int i = Bll_UserInfo.Add_User(user);
         if (i > 0)
         {
             MessageBox.Show("Added Successfully");
         }
         else
         {
             MessageBox.Show("Added Failed");
         }
     }
     catch
     {
         MessageBox.Show("Added Error,Try again!");
     }
 }
Ejemplo n.º 3
0
 private void btn_confirm_Click(object sender, EventArgs e)
 {
     username = txt_username.Text.Trim();
     try
     {
         user             = Bll_UserInfo.GetUser(username);
         lb_username.Text = user.UserName;
         lb_truename.Text = user.Name;
         lb_email.Text    = user.Email;
         lb_address.Text  = user.Address;
         lb_regdate.Text  = user.Datetime;
     }
     catch
     {
         MessageBox.Show("Query Error!");
     }
 }
Ejemplo n.º 4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         userinfo.UserName = txt_email.Text.Trim();
         userinfo.Password = txt_pwd.Text.Trim();
         int a = Bll_UserInfo.ExistsUsers(userinfo);
         if (a == 1)
         {
             Session["U_ID"] = userinfo.UserName;
             Response.Redirect("Index.aspx");
             Response.Write(" <script>function window.onload() {alert( 'Login Sucessfully' ); } </script> ");
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 5
0
 private void btn_confirm_Click(object sender, EventArgs e)
 {
     username = txt_username.Text.Trim();
     try
     {
         int i = Bll_UserInfo.Delete_User(username);
         if (i > 0)
         {
             MessageBox.Show("Deleted Successfully");
         }
         else
         {
             MessageBox.Show("Deleted Failed");
         }
     }
     catch
     {
         MessageBox.Show("Deleted Error,Try again!");
     }
 }