示例#1
0
        private void LlenarCampos(Estudiante estudiante)
        {
            IDnumericUpDown.Value       = estudiante.EstudianteID;
            MatriculaMaskedTextBox.Text = estudiante.Matricula;
            NombresTextBox.Text         = estudiante.Nombres;
            ApellidosTextBox.Text       = estudiante.Apellidos;
            CedulaMaskedTextBox.Text    = estudiante.Cedula;
            TelefonoMaskedTextBox.Text  = estudiante.Telefono;
            CelularMaskedTextBox.Text   = estudiante.Celular;
            EmailTextBox.Text           = estudiante.Email;
            FechaDateTime.Value         = estudiante.FechaNacimiento;
            if (estudiante.Sexo == 0)
            {
                SexoComboBox.Text = "Femenino";
                SexoComboBox.Show();
            }
            else
            if (estudiante.Sexo == 1)
            {
                SexoComboBox.Text = "Masculino";
                SexoComboBox.Show();
            }

            BalanceTextBox.Text = Convert.ToString(estudiante.Balance);
        }
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(NombreTextBox.Text))
            {
                MyErrorProvider.SetError(NombreTextBox, "El campo Nombre no puede estar vacio");
                NombreTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ApellidoTextBox.Text))
            {
                MyErrorProvider.SetError(ApellidoTextBox, "El campo Apellido no puede estar vacio");
                ApellidoTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CedulaMaskedTextBox.Text))
            {
                MyErrorProvider.SetError(CedulaMaskedTextBox, "El campo Cedula no puede estar vacio");
                CedulaMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(MatriculaMaskedTextBox.Text))
            {
                MyErrorProvider.SetError(MatriculaMaskedTextBox, "El campo Matricula no puede estar vacio");
                MatriculaMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(TelefonoMaskedTextBox.Text))
            {
                MyErrorProvider.SetError(TelefonoMaskedTextBox, "El campo Telefono no puede estar vacio");
                TelefonoMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text))
            {
                MyErrorProvider.SetError(CelularMaskedTextBox, "El campo Celular no puede estar vacio");
                CelularMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(SexoComboBox.Text))
            {
                MyErrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacio");
                SexoComboBox.Focus();
                paso = false;
            }


            return(paso);
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(NombresTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Nombres no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombresTextBox.Focus();
            }

            if (string.IsNullOrEmpty(ApellidosTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Apellidos no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombresTextBox.Focus();
            }

            if (!CedulaValida(CedulaTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Cédula No Valida, Debe introducir solo números !!!\n Introducca la Cédula sin guiones.", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                CedulaTextBox.Focus();
            }


            if (SexoComboBox.SelectedItem == null)
            {
                paso = false;
                MessageBox.Show("El campo Cedula no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                SexoComboBox.Focus();
            }

            if (!NumeroValido(CelularTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Celular No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                CelularTextBox.Focus();
            }

            if (!NumeroValido(TelefonoTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Teléfono No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                TelefonoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(DireccionTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Direccion no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                DireccionTextBox.Focus();
            }

            if (!EmailValido(EmailTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Email No Valido !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                EmailTextBox.Focus();
            }

            if (string.IsNullOrEmpty(NombreUsuarioTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Nombre Usuario no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombreUsuarioTextBox.Focus();
            }

            if (string.IsNullOrEmpty(ContrasenaTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo contraseña Usuario no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombreUsuarioTextBox.Focus();
            }
            return(paso);
        }
        //Campo vacio
        private bool Validar()
        {
            bool esValido = true;

            if (ClienteIdTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("ClienteId está vacio", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                ClienteIdTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (NombresTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Nombres está vacio", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                NombresTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (ApellidosTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Apellidos está vacio", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                ApellidosTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (EmailTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Email está vacio", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                EmailTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (TelefonoTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Telefono está vacia", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                TelefonoTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (CedulaTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Cedula está vacia", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                CedulaTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (DireccionTextBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Direccion está vacia", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                DireccionTextBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            if (SexoComboBox.Text.Length == 0)
            {
                esValido = false;
                GuardarButton.IsEnabled = false;
                MessageBox.Show("Sexo está vacia", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Warning);
                SexoComboBox.Focus();
                GuardarButton.IsEnabled = true;
            }

            return(esValido);
        }
示例#5
0
        private bool Validar()
        {
            bool paso = true;

            if (UsuarioIdTextBox.Text == string.Empty)
            {
                MessageBox.Show("UsuarioId Vacio");
                UsuarioIdTextBox.Focus();
                paso = false;
            }
            else if (NombresTextBox.Text == string.Empty)
            {
                MessageBox.Show("Nombres Vacio");
                NombresTextBox.Focus();
                paso = false;
            }
            else if (TelefonoTextBox.Text == string.Empty)
            {
                MessageBox.Show("Telefono Vacio");
                TelefonoTextBox.Focus();
                paso = false;
            }
            else if (CelularTextBox.Text == string.Empty)
            {
                MessageBox.Show("Celular Vacio");
                CelularTextBox.Focus();
                paso = false;
            }
            else if (EmailTextBox.Text == string.Empty)
            {
                MessageBox.Show("Email Vacio");
                EmailTextBox.Focus();
                paso = false;
            }
            else if (SexoComboBox.SelectedItem == null)
            {
                MessageBox.Show("Sexo Vacio");
                SexoComboBox.Focus();
                paso = false;
            }
            else if (CedulaTextBox.Text == string.Empty)
            {
                MessageBox.Show("Cedula Vacia");
                CedulaTextBox.Focus();
                paso = false;
            }
            else if (DireccionTextBox.Text == string.Empty)
            {
                MessageBox.Show("Direccion Vacio");
                DireccionTextBox.Focus();
                paso = false;
            }
            else if (TipoUsuarioComboBox.SelectedItem == null)
            {
                MessageBox.Show("Tipo de Usuario Vacio");
                TipoUsuarioComboBox.Focus();
                paso = false;
            }

            return(paso);
        }
示例#6
0
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(NombresTextBox.Text))
            {
                MyErrorProvider.SetError(NombresTextBox, "El campo Nombres no puede estar vacío.");
                NombresTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ApellidosTextBox.Text))
            {
                MyErrorProvider.SetError(ApellidosTextBox, "El campo Apellidos no puede estar vacío.");
                ApellidosTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(MatriculaMaskedTextBox.Text.Replace("-", "")))
            {
                MyErrorProvider.SetError(MatriculaMaskedTextBox, "El campo Matrícula no puede estar vacío.");
                MatriculaMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CedulaMaskedTextBox.Text.Replace("-", "")))
            {
                MyErrorProvider.SetError(CedulaMaskedTextBox, "El campo Cédula no puede estar vacío.");
                CedulaMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(TelefonoMaskedTextBox.Text.Replace("-", "")))
            {
                MyErrorProvider.SetError(TelefonoMaskedTextBox, "El campo Teléfono no puede estar vacío.");
                TelefonoMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text.Replace("-", "")))
            {
                MyErrorProvider.SetError(CelularMaskedTextBox, "El campo Celular no puede estar vacío.");
                CelularMaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(FechaNacimientoDateTimePicker.Text))
            {
                MyErrorProvider.SetError(FechaNacimientoDateTimePicker, "El campo Fecha no puede estar vacío.");
                FechaNacimientoDateTimePicker.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(SexoComboBox.Text))
            {
                MyErrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacío.");
                SexoComboBox.Focus();
                paso = false;
            }
            return(paso);
        }
示例#7
0
        private bool Validar()
        {
            bool paso = true;

            MyerrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(MatriculaTextBox.Text))
            {
                MyerrorProvider.SetError(MatriculaTextBox, "El campo Direccion no puede estar vacio");
                MatriculaTextBox.Focus();
                paso = false;
            }

            if (NombreTextbox.Text == string.Empty)
            {
                MyerrorProvider.SetError(NombreTextbox, "El campo Nombre no puede estar vacio");
                NombreTextbox.Focus();
                paso = false;
            }

            if (ApellidoTextbox.Text == string.Empty)
            {
                MyerrorProvider.SetError(ApellidoTextbox, "El campo Nombre no puede estar vacio");
                ApellidoTextbox.Focus();
                paso = false;
            }



            if (string.IsNullOrWhiteSpace(CedulaTextbox.Text.Replace("-", "")))
            {
                MyerrorProvider.SetError(CedulaTextbox, "El campo Cedula no puede estar vacio");
                CedulaTextbox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(TelefonoTextbox.Text.Replace("-", "")))
            {
                MyerrorProvider.SetError(TelefonoTextbox, "El campo Telefono no puede estar vacio");
                TelefonoTextbox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CelularTextbox.Text.Replace("-", "")))
            {
                MyerrorProvider.SetError(CelularTextbox, "El campo Celular no puede estar vacio");
                CelularTextbox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(EmailTextbox.Text))
            {
                MyerrorProvider.SetError(EmailTextbox, "El campo Email no puede estar vacio");
                EmailTextbox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(FechaNacimientoDateTimePicker.Text))
            {
                MyerrorProvider.SetError(FechaNacimientoDateTimePicker, "El campo Fecha de nacimiento no puede estar vacio");
                FechaNacimientoDateTimePicker.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(SexoComboBox.Text))
            {
                MyerrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacio");
                SexoComboBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(BalanceTextBox.Text))
            {
                MyerrorProvider.SetError(BalanceTextBox, "El campo Balance no puede estar vacio");
                BalanceTextBox.Focus();
                paso = false;
            }


            return(paso);
        }
示例#8
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(NombresTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Nombres no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombresTextBox.Focus();
            }

            if (string.IsNullOrEmpty(ApellidosTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Apellidos no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                ApellidosTextBox.Focus();
            }

            if (!CedulaValida(CedulaTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Cédula No Valida, Debe introducir solo números !!!\n Introducca la Cédula sin guiones.", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                CedulaTextBox.Focus();
            }

            if (SexoComboBox.SelectedItem == null)
            {
                paso = false;
                MessageBox.Show("Debe completar el campo sexo", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                SexoComboBox.Focus();
            }
            if (!NumeroValido(CelularTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Celular No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                CelularTextBox.Focus();
            }

            if (!NumeroValido(TelefonoTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Teléfono No Valido, Debe introducir solo números !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                TelefonoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(DireccionTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Direccion no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                DireccionTextBox.Focus();
            }

            if (!EmailValido(EmailTextBox.Text))
            {
                paso = false;
                MessageBox.Show("Email No Valido !!!", "Informacion", MessageBoxButton.OK, MessageBoxImage.Warning);
                EmailTextBox.Focus();
            }

            if (string.IsNullOrEmpty(FechaIngresoDateTimePicker.Text))
            {
                paso = false;
                MessageBox.Show("El campo Fecha Ingreso no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                FechaIngresoDateTimePicker.Focus();
            }

            if (string.IsNullOrEmpty(FechaNacimientoDateTimePicker.Text))
            {
                paso = false;
                MessageBox.Show("El campo fecha nacimiento no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                FechaNacimientoDateTimePicker.Focus();
            }

            return(paso);
        }