Пример #1
0
        protected void btnReg_Click(object sender, EventArgs e)
        {
            //DTO.User us = new DTO.User(-1, CGloble.getText(txtName), CGloble.getText(txtUname), CGloble.getText(txtPass), 1, false, CGloble.getText(txtEmail), CGloble.getText(txtAddress), CGloble.getText(txtPhone));
            try
            {
                BUS_Users objUser = new BUS_Users();

                objUser.FullName = txtName.Text;
                objUser.UserName = txtUname.Text;
                objUser.Password = txtPass.Text;
                objUser.Email    = txtEmail.Text;
                // objUser.Adress = txtAddress.Text;
                objUser.Phone       = txtPhone.Text;
                objUser.DateOfBirth = dteDateOfBirth.Date;
                objUser.Class       = txtClass.Text;

                if (objUser.Insert() > 0)
                {
                    HELPER.Client.Alert(this, "Đăng ký thành công!");
                    Response.Redirect("~/Pages/Controler/Login_User.aspx", false);
                }
                else
                {
                    HELPER.Client.Alert(this, "Đăng ký thất bại! Hãy kiểm tra lại dữ liệu bạn nhập vào!");
                    txtPass.Text = "";
                }
            }
            catch (Exception ex)
            {
                HELPER.Client.Alert(this, "Đăng ký thất bại! Hãy kiểm tra lại dữ liệu bạn nhập vào!");
            }
        }