Esempio n. 1
0
        protected void submitBtn_Click(object sender, EventArgs e)
        {
            bool   stat   = true;
            string name   = nameBox.Text;
            string email  = emailBox.Text;
            string gender = genderBtn.SelectedValue;

            if (!UpdateProfileController.isBoxFilled(name))
            {
                nameValidator.Text = "Name must be filled!";
                stat = false;
            }
            if (!UpdateProfileController.isBoxFilled(email))
            {
                emailValidator.Text = "Email must be fileld!";
                stat = false;
            }
            if (!UpdateProfileController.isBoxFilled(gender))
            {
                genderValidator.Text = "Gender must be choosen!";
                stat = false;
            }
            if (UpdateProfileController.findEmailExist(email))
            {
                warningLbl.Text = "Email already exist!";
            }
            else if (stat)
            {
                UpdateProfileController.requestUpdate(name, email, gender);
                Response.Redirect("./ViewProfile.aspx");
            }
        }