Example #1
0
        private bool validar()
        {
            if (Nombre.Text.Length == 0)
            {
                MessageBox.Show("El Campo nombre esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Nombre.Focus();
                return(false);
            }

            if (Apellido.Text.Length == 0)
            {
                MessageBox.Show("El Campo Apellido esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Apellido.Focus();
                return(false);
            }

            if (PaisID.Text.Length == 0 || PaisID.SelectedValue == null)
            {
                MessageBox.Show("El Campo Pais esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                PaisID.Focus();
                return(false);
            }

            if (ProvinciaID.Text.Length == 0 || ProvinciaID.SelectedValue == null)
            {
                MessageBox.Show("El Campo Provincia esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ProvinciaID.Focus();
                return(false);
            }

            if (PerfilID.Text.Length == 0 || PerfilID.SelectedValue == null)
            {
                MessageBox.Show("El Campo Prefil esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                PerfilID.Focus();
                return(false);
            }

            if (User.Text.Length == 0)
            {
                MessageBox.Show("El Campo Usuario esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                User.Focus();
                return(false);
            }

            if (PassWord.Text.Length == 0)
            {
                MessageBox.Show("El Campo Contraseña esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                PassWord.Focus();
                return(false);
            }
            if (CofPassWord.Text.Length == 0)
            {
                MessageBox.Show("El Campo Confirmar Contraseña esta vacio", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                CofPassWord.Focus();
                return(false);
            }

            if (CofPassWord.Text != PassWord.Text)
            {
                MessageBox.Show("La Contraseña no coinciden favor confirme", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                PassWord.Focus();
                return(false);
            }

            return(true);
        }