Exemplo n.º 1
0
        //Guardar//
        private void GuardarButton_Click(object sender, RoutedEventArgs e)
        {
            {
                if (!Validar())
                {
                    return;
                }

                if (NombreTextbox.Text.Trim() == string.Empty)
                {
                    MessageBox.Show("El campo Nombre esta vacio.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                    NombreTextbox.Focus();
                    return;
                }

                var paso = CiudadesBLL.Guardar(ciudades);
                if (paso)
                {
                    Limpiar();
                    MessageBox.Show("Transaccion Exitosa!", "Exito", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBox.Show("Transaccion Fallida", "Fallo", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 2
0
 protected void Guardar_Click(object sender, EventArgs e)
 {
     Servicios = LLenar();
     if (Servicios.idServicio != 0)
     {
         ServicioBll.Modificar(Servicios);
         Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Modificado !');</script>");
     }
     else
     {
         ServicioBll.Guardar(Servicios);
         Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Guardado !');</script>");
         limpiar();
         NombreTextbox.Focus();
     }
 }
 protected void guardar_Click(object sender, EventArgs e)
 {
     peluquero = llenarCampos();
     if (peluquero.idPeluquero > 0)
     {
         PeluqueroBll.Modificar(peluquero);
         Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Modificado !');</script>");
     }
     else
     {
         PeluqueroBll.Guardar(peluquero);
         Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Guardado !');</script>");
         limpiar();
         NombreTextbox.Focus();
     }
 }
        //=====================================================[ Validar ]=====================================================
        private bool Validar()
        {
            if (NombreTextbox.Text.Trim() == String.Empty)
            {
                MessageBox.Show("El Campo (Nombre) esta vacio.\n\nDescriba el articulo.", "ERROR", MessageBoxButton.OK, MessageBoxImage.Warning);
                NombreTextbox.Focus();
            }

            bool Validado = true;

            if (PrestamoIdTextbox.Text.Length == 0)
            {
                Validado = false;
                MessageBox.Show("Transaccion Errada", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(Validado);
        }
        private bool validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(DireccionTextbox.Text))
            {
                MessageBox.Show("No puede dejar campos vacios");
                DireccionTextbox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(NombreTextbox.Text))
            {
                MessageBox.Show("No puede dejar campos vacios");
                NombreTextbox.Focus();
                paso = false;
            }

            return(paso);
        }
Exemplo n.º 6
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);
        }