예제 #1
0
        protected void btnAddUser_Click(object sender, EventArgs e)
        {
            // Assuming fields are validated
            bool isAdded = pxy.AddUser(txtFullName.Text, txtEmail.Text, txtPassword.Text);

            if (isAdded)
            {
                txtFullName.Text = "";
                txtEmail.Text    = "";
                txtPassword.Text = "";

                lblAddStatus.Text = "New user has been added.";

                FillControls();
            }
            else
            {
                lblAddStatus.Text = "An error occured. User has not been added.";
            }
        }
        protected void btnAddUser_Click(object sender, EventArgs e)
        {
            if (CheckInput())
            {
                if (pxy.AddUser(txtFullName.Text, txtEmail.Text, txtPassword.Text))
                {
                    txtFullName.Text = "";
                    txtEmail.Text    = "";
                    txtPassword.Text = "";

                    lblAddStatus.Text = "New user has been added.";

                    Response.Redirect("Home.aspx");
                }
                else
                {
                    lblAddStatus.Text = "An error occured. User has not been added.";
                }
            }
            else
            {
                lblAddStatus.Text = "Check your input. Ensure your entered name is not blank, email is valid, and password meets the criteria.";
            }
        }