Exemplo n.º 1
0
        protected void ButtonADDUser_Click(object sender, EventArgs e)
        {
            try
            {
                string  email          = TextBoxEmail.Text;
                string  password       = TextBoxPassword.Text;
                string  firstName      = TextBoxFirstName.Text;
                string  secondName     = TextBoxSecondName.Text;
                string  firstLastName  = TextBoxApellido1.Text;
                string  secondLastName = TextBoxApellido2.Text;
                string  address        = TextBoxAddress.Text;
                string  enabled        = "";
                Boolean enabled2       = CheckBoxEnabled.Checked;
                if (enabled2)
                {
                    enabled = "S";
                }
                else
                {
                    enabled = "N";
                }
                int typeOfUser = int.Parse(RadioButtonList1.SelectedItem.Value);

                switch (typeOfUser)
                {
                case 1:
                    bll.addAdmin(email, firstName, secondName, firstLastName, secondLastName, address, password);
                    break;

                case 2:
                    bll.addCustumer(email, firstName, secondName, firstLastName, secondLastName, address, password);
                    break;

                case 3:
                    bll.addChef(email, firstName, secondName, firstLastName, secondLastName, address, password);
                    break;

                default:
                    break;
                }
                clear();
                alert("Se Agrego " + firstName + " " + firstLastName + " Exitosamente");
                load();
            } catch (Exception ex) {
                alert("ERROR> Falta Informacion por agregar en el formulario, El Email es incorrecto o ya existe");
            }
        }