Exemple #1
0
 private void Limpiar()
 {
     articuloIdNumericUpDown.Value = 0;
     nombreTextBox.Clear();
     inventarioTextBox.Clear();
     GeneralerrorProvider.Clear();
 }
        public bool validar(int error)
        {
            bool paso = false;

            if (error == 1 && personaIdNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(personaIdNumericUpDown, "Llenar Persona ID");
                paso = true;
            }


            if (error == 2 && string.IsNullOrEmpty(nombresTextBox.Text))
            {
                GeneralerrorProvider.SetError(nombresTextBox, "Llenar Nombre");
                paso = false;
            }

            if (error == 2 && string.IsNullOrEmpty(cedulaTextBox.Text))
            {
                GeneralerrorProvider.SetError(cedulaTextBox, "Llenar Cedula");
                paso = true;
            }
            if (error == 2 && string.IsNullOrEmpty(direccionTextBox.Text))
            {
                GeneralerrorProvider.SetError(direccionTextBox, "Llenar Direccion");
                paso = true;
            }

            return(paso);
        }
Exemple #3
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar");
            }
            else
            {
                int id = Convert.ToInt32(articulosIdNumericUpDown.Value);
                RegistrodeArticulos registrodeArticulos = BLL.RegistrodeArticulosBLL.Buscar(id);

                if (registrodeArticulos != null)
                {
                    articulosIdNumericUpDown.Value = registrodeArticulos.ArticulosId;
                    descripcionTextBox.Text        = registrodeArticulos.Descripcion;
                    costoTextBox.Text      = registrodeArticulos.costo.ToString();
                    gananciaTextBox.Text   = registrodeArticulos.Ganancia.ToString();
                    precioTextBox.Text     = registrodeArticulos.precio.ToString();
                    inventarioTextBox.Text = registrodeArticulos.Inventario.ToString();
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GeneralerrorProvider.Clear();
            }
        }
        public bool validar(int error)
        {
            bool paso = false;

            if (error == 1 && grupoidNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(grupoidNumericUpDown, "Llenar Grupo ID");
                paso = true;
            }


            if (error == 2 && string.IsNullOrEmpty(descripcionTextBox.Text))
            {
                GeneralerrorProvider.SetError(descripcionTextBox, "Lllenar Descripcion");
                paso = false;
            }

            if (error == 2 && cantidadNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(cantidadNumericUpDown, "Llenar Cantidad De Estudiantes");
                paso = true;
            }
            if (error == 2 && grupoNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(grupoNumericUpDown, "Llenar Existencia");
                paso = true;
            }

            return(paso);
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Llene la Casilla Grupo ID", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int    id     = Convert.ToInt32(grupoidNumericUpDown.Value);
                Grupos grupos = BLL.GruposBLL.Buscar(id);

                if (grupos != null)
                {
                    grupoidNumericUpDown.Value     = grupos.Grupoid;
                    fechaDateTimePicker.Value      = grupos.Fecha;
                    descripcionTextBox.Text        = grupos.Descripcion;
                    cantidadNumericUpDown.Value    = grupos.Cantidad;
                    grupoNumericUpDown.Value       = grupos.Grupo;
                    integrantesNumericUpDown.Value = grupos.integrantes;
                    GeneralerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No Encontrado", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private bool Validar(int validar)
        {
            bool paso = false;

            if (validar == 1 && GrupoIdnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(GrupoIdnumericUpDown, "Ingrese un ID");
                paso = true;
            }
            if (validar == 2 && descripcionTextBox.Text == String.Empty)
            {
                GeneralerrorProvider.SetError(descripcionTextBox, "digite una  Descripcion");
                paso = true;
            }
            if (validar == 2 && CantidadnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(CantidadnumericUpDown, "Ingrese Cantidad");
                paso = true;
            }
            if (validar == 2 && GDeseadosnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(GDeseadosnumericUpDown, "Ingrese el Precio");
                paso = true;
            }
            return(paso);
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Validar(2))
            {
                MessageBox.Show("LLenar los campos marcados");
                return;
            }

            GeneralerrorProvider.Clear();

            if (GrupoIdnumericUpDown.Value == 0)
            {
                if (BLL.GruposBLL.Guardar(LlenaClase()))
                {
                    MessageBox.Show("Guardado!!", "Exito",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LimpiarCampos();
                }
            }
            else
            {
                if (BLL.GruposBLL.Modificar(LlenaClase()))
                {
                    MessageBox.Show("Guardado!!", "Exito",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LimpiarCampos();
                }
                else
                {
                    MessageBox.Show("No se pudo Guardar!!", "Fallo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            GeneralerrorProvider.Clear();

            if (Validar(1))
            {
                MessageBox.Show("Ingrese un ID");
                return;
            }

            int       id       = Convert.ToInt32(ArticuloIdnumericUpDown.Value);
            Articulos articulo = ArticulosBLL.Buscar(id);

            if (articulo != null)
            {
                DescripciontextBox.Text       = articulo.Descripcion;
                PrecionumericUpDown.Value     = articulo.Precio;
                ExistencianumericUpDown.Value = articulo.Existencia;
                CCnumericUpDown.Value         = articulo.CantCotizada;
                FVdateTimePicker.Text         = articulo.FechaVencimiento.ToString();
            }
            else
            {
                MessageBox.Show("No se encontro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private bool Validar(int error)
        {
            bool paso = false;
            int  num  = 0;

            if (error == 1 && string.IsNullOrEmpty(CriteriotextBox.Text))
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Por Favor, LLenar Casilla!");
                paso = true;
            }
            if (error == 2 && int.TryParse(CriteriotextBox.Text, out num) == false)
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Debe Digitar un Numero");
                paso = true;
            }

            if (error == 3 && int.TryParse(CriteriotextBox.Text, out num) == true)
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Debe Digitar Caracteres");
                paso = true;
            }

            if (error == 4 && int.TryParse(CriteriotextBox.Text, out num) == true)
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Debe usar los Guiones");
                paso = true;
            }

            return(paso);
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int      id       = Convert.ToInt32(clienteIdNumericUpDown.Value);
                Clientes clientes = BLL.ClienteBLL.Buscar(id);

                if (clientes != null)
                {
                    clienteIdNumericUpDown.Value = clientes.ClienteId;
                    nombreTextBox.Text           = clientes.Nombre;
                    cedulaMaskedTextBox.Text     = clientes.Cedula;
                    direccionTextBox.Text        = clientes.Direccion;
                    telefonoMaskedTextBox.Text   = clientes.Telefono;
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GeneralerrorProvider.Clear();
            }
        }
        private bool Validar(int validar)
        {
            bool paso = false;

            if (validar == 1 && ArticuloIdnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(ArticuloIdnumericUpDown, "Ingrese un ID");
                paso = true;
            }
            if (validar == 2 && DescripciontextBox.Text == string.Empty)
            {
                GeneralerrorProvider.SetError(DescripciontextBox, "Ingrese una descripcion");
                paso = true;
            }
            if (validar == 2 && PrecionumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(PrecionumericUpDown, "Ingrese un precio");
                paso = true;
            }
            if (validar == 2 && ExistencianumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(ExistencianumericUpDown, "Ingrese la Existencia del Articulo");
                paso = true;
            }
            if (validar == 2 && CCnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(CCnumericUpDown, "Ingrese la cantidad cotizada");
                paso = true;
            }
            return(paso);
        }
        private void BuscarButton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar");
            }
            else
            {
                int            id             = Convert.ToInt32(libroIdNumericUpDown.Value);
                LibrosBiblicos librosbiblicos = BLL.LibrosBiblicosBLL.Buscar(id);

                if (librosbiblicos != null)
                {
                    libroIdNumericUpDown.Value = librosbiblicos.LibroId;
                    fechaDateTimePicker.Value  = librosbiblicos.Fecha;
                    descripcionTextBox.Text    = librosbiblicos.Descripcion;
                    siglasTextBox.Text         = librosbiblicos.Siglas;
                    tipoTextBox.Text           = librosbiblicos.Tipo;
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GeneralerrorProvider.Clear();
            }
        }
        private bool validar(int error)
        {
            bool errores = false;

            if (error == 1 && libroIdNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(libroIdNumericUpDown, "Llenar  Libros ID");
                errores = true;
            }

            if (error == 2 && string.IsNullOrWhiteSpace(descripcionTextBox.Text))
            {
                GeneralerrorProvider.SetError(descripcionTextBox, "Llene Descripcion");
                errores = true;
            }

            if (error == 2 && string.IsNullOrWhiteSpace(siglasTextBox.Text))
            {
                GeneralerrorProvider.SetError(siglasTextBox, "Llene Siglas");
                errores = true;
            }

            if (error == 2 && string.IsNullOrWhiteSpace(tipoTextBox.Text))
            {
                GeneralerrorProvider.SetError(tipoTextBox, "Llene Tipo");
                errores = true;
            }



            return(errores);
        }
        private bool Validar()
        {
            bool HayErrores = false;

            if (String.IsNullOrWhiteSpace(TelefonomaskedTextBox.Text))
            {
                GeneralerrorProvider.SetError(TelefonomaskedTextBox,
                                              "No debes dejar el telefono vacio");
                HayErrores = true;
            }
            if (String.IsNullOrWhiteSpace(NombretextBox.Text))
            {
                GeneralerrorProvider.SetError(NombretextBox,
                                              "No debes dejar el nombre vacio");
                HayErrores = true;
            }
            if (String.IsNullOrWhiteSpace(DirecciontextBox.Text))
            {
                GeneralerrorProvider.SetError(DirecciontextBox,
                                              "No debes dejar la direccion vacia");
                HayErrores = true;
            }
            if (String.IsNullOrWhiteSpace(CedulamaskedTextBox.Text))
            {
                GeneralerrorProvider.SetError(CedulamaskedTextBox,
                                              "No debes dejar la cedula vacia");
                HayErrores = true;
            }

            return(HayErrores);
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (Validar())
            {
                MessageBox.Show("Favor Llenar Casilla", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int       id        = Convert.ToInt32(articuloIdNumericUpDown.Value);
                Articulos articulos = BLL.ArticulosBLL.Buscar(id);

                if (articulos != null)
                {
                    articuloIdNumericUpDown.Value = articulos.ArticuloId;
                    nombreTextBox.Text            = articulos.Nombre;
                    fechaDateTimePicker.Value     = articulos.Fecha;
                    descripcionTextBox.Text       = articulos.Descripcion;
                    cantidadNumericUpDown.Value   = articulos.Cantidad;
                    precioTextBox.Text            = articulos.Precio.ToString();
                }
                else
                {
                    MessageBox.Show("No fue Encontrado", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GeneralerrorProvider.Clear();
            }
        }
Exemple #16
0
        private bool Validar(int error)
        {
            bool paso = false;
            int  num  = 0;

            if (error == 1 && string.IsNullOrEmpty(CriteriotextBox.Text))
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Por Favor, LLenar Casilla!");
                paso = true;
            }
            if (error == 2 && int.TryParse(CriteriotextBox.Text, out num) == false)
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Debe Digitar un Numero");
                paso = true;
            }

            if (error == 3 && int.TryParse(CriteriotextBox.Text, out num) == true)
            {
                GeneralerrorProvider.SetError(CriteriotextBox, "Debe Digitar Caracteres");
                paso = true;
            }

            if (error == 4 && cobroIdNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(cobroIdNumericUpDown, "Llenar Cobro Id Id");
                paso = true;
            }

            if (error == 5 && int.TryParse(PagosTextBox.Text, out num) == false)
            {
                GeneralerrorProvider.SetError(PagosTextBox, "Debe Digitar numeros");
                paso = true;
            }
            return(paso);
        }
        private bool Validar(int valida)
        {
            bool paso = false;

            if (valida == 1 && TipoId_numericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(TipoId_numericUpDown, "Digite un ID");
                paso = true;
            }
            if (valida == 2 && LibroId_numericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(LibroId_numericUpDown, "Digite un ID");
                paso = true;
            }
            if (valida == 2 && Siglas_textBox.Text == string.Empty)
            {
                GeneralerrorProvider.SetError(Siglas_textBox, "Digite una sigla");
                paso = true;
            }
            if (valida == 2 && Descripcion_textBox.Text == string.Empty)
            {
                GeneralerrorProvider.SetError(Descripcion_textBox, "Digite una Descripcion");
                paso = true;
            }
            return(paso);
        }
Exemple #18
0
        private void Buscarcobrobutton_Click(object sender, EventArgs e)
        {
            Buscarbutton.Enabled = false;
            if (Validar(4))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int   id     = Convert.ToInt32(cobroIdNumericUpDown.Value);
                Pagos cobros = BLL.CobroBLL.Buscar(id);
                PagosTextBox.ReadOnly = false;

                if (cobros != null)
                {
                    LlenaCampos(cobros);
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Limpiar();
                }
                GeneralerrorProvider.Clear();
            }
        }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            GeneralerrorProvider.Clear();
            if (Validar(1))
            {
                MessageBox.Show("Ingrese un ID");
                return;
            }

            int    id    = Convert.ToInt32(GrupoIdnumericUpDown.Value);
            Grupos grupo = BLL.GruposBLL.Buscar(id);

            if (grupo != null)
            {
                GrupoIdnumericUpDown.Value   = grupo.GrupoId;
                descripcionTextBox.Text      = grupo.Descripcion;
                CantidadnumericUpDown.Value  = grupo.Cantidad;
                GDeseadosnumericUpDown.Value = grupo.GruposDeseados;
            }
            else
            {
                MessageBox.Show("No se encontro!", "Fallo",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //


        public bool ValidarGuardar()
        {
            bool Error = false;

            if (String.IsNullOrEmpty(nombreTextBox.Text))
            {
                GeneralerrorProvider.SetError(nombreTextBox, "Llenar Casilla de Nombre");
                Error = true;
            }


            if (String.IsNullOrEmpty(descripcionTextBox.Text))
            {
                GeneralerrorProvider.SetError(descripcionTextBox, "Llenar Casilla de Direccion");
                Error = true;
            }


            if (cantidadNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(cantidadNumericUpDown, "Llenar Casilla de Cantidad");
                Error = true;
            }


            if (String.IsNullOrEmpty(precioTextBox.Text))
            {
                GeneralerrorProvider.SetError(precioTextBox, "Llenar Casilla de Cantidad");
                Error = true;
            }


            return(Error);
        }
Exemple #21
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            GeneralerrorProvider.Clear();

            if (Validar(1))
            {
                MessageBox.Show("Ingrese un ID");
                return;
            }

            int    id     = Convert.ToInt32(IdnumericUpDown.Value);
            Grupos grupos = BLL.GruposBLL.Buscar(id);

            if (grupos != null)
            {
                DescripciontextBox.Text        = grupos.Descripcion;
                FechadateTimePicker.Text       = grupos.Fecha.ToString();
                CantidadnumericUpDown.Value    = grupos.Cantidad;
                GruposnumericUpDown.Value      = grupos.Grupo;
                IntegrantesnumericUpDown.Value = grupos.Integrantes = (grupos.Cantidad / grupos.Grupo);
            }
            else
            {
                MessageBox.Show("No se encontro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #22
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool paso = false;

            if (Validar(2))
            {
                MessageBox.Show("Llenar todos los campos marcados");
                return;
            }

            GeneralerrorProvider.Clear();

            if (IdnumericUpDown.Value == 0)
            {
                paso = BLL.GruposBLL.Guardar(LlenarClases());
            }
            else
            {
                paso = BLL.GruposBLL.Modificar(LlenarClases());
            }

            if (paso)
            {
                MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #23
0
        private bool validar(int error)
        {
            bool errores = false;
            int  num     = 0;

            if (error == 1 && articuloIdNumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(articuloIdNumericUpDown, "Llenar Articulos Id");
                errores = true;
            }


            if (error == 2 && string.IsNullOrEmpty(nombreTextBox.Text))
            {
                GeneralerrorProvider.SetError(nombreTextBox, "Llene Nombre");
                errores = true;
            }

            if (error == 3 && int.TryParse(nombreTextBox.Text, out num) == true)
            {
                GeneralerrorProvider.SetError(nombreTextBox, "Debe Digitar Caracteres");
                errores = true;
            }

            return(errores);
        }
Exemple #24
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (ValidarBE())
            {
                MessageBox.Show("Favor Llenar Casilla", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int      id       = Convert.ToInt32(personaIdNumericUpDown.Value);
                Personas personas = BLL.PersonasBLL.Buscar(id);

                if (personas != null)
                {
                    personaIdNumericUpDown.Value = personas.PersonaId;
                    nombresTextBox.Text          = personas.Nombres;
                    fechaDateTimePicker.Value    = personas.Fecha;
                    cedulaMaskedTextBox.Text     = personas.Cedula;
                    direccionTextBox.Text        = personas.Direccion;
                    telefonoMaskedTextBox.Text   = personas.Telefono;
                    GeneralerrorProvider.Clear();
                }
                else
                {
                    MessageBox.Show("No fue Encontrado", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    GeneralerrorProvider.Clear();
                }
            }
        }
Exemple #25
0
        public bool Validar(int validar)
        {
            bool paso = false;

            if (validar == 1 && IdnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(IdnumericUpDown, "Introduzca un ID");
                paso = true;
            }
            if (validar == 2 && DescripciontextBox.Text == string.Empty)
            {
                GeneralerrorProvider.SetError(DescripciontextBox, "Introduzca el nombre del grupo");
                paso = true;
            }
            if (validar == 1 && CantidadnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(CantidadnumericUpDown, "Introduzca una cantidad de estudiantes");
            }
            if (validar == 1 && GruposnumericUpDown.Value == 0)
            {
                GeneralerrorProvider.SetError(GruposnumericUpDown, "Introduzca la cantidad de grupos");
            }

            return(paso);
        }
Exemple #26
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool     Paso     = false;
            Personas personas = Llenaclase();

            if (Validar())
            {
                MessageBox.Show("Favor Llenar Casilla", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (personaIdNumericUpDown.Value == 0)
                {
                    Paso = BLL.PersonasBLL.Guardar(personas);
                }
                else
                {
                    Paso = BLL.PersonasBLL.Editar(personas);
                }

                if (Paso)
                {
                    MessageBox.Show("Guardar", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No Pudo Guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                GeneralerrorProvider.Clear();
                Limpiar();
            }
        }
Exemple #27
0
        public bool Validar()
        {
            bool Error = false;



            if (String.IsNullOrWhiteSpace(nombresTextBox.Text))
            {
                GeneralerrorProvider.SetError(nombresTextBox, "Llenar Casilla de Nombre");
                Error = true;
            }

            if (String.IsNullOrWhiteSpace(telefonoMaskedTextBox.Text))
            {
                GeneralerrorProvider.SetError(telefonoMaskedTextBox, "Llenar Casilla de Telefono");
                Error = true;
            }

            if (String.IsNullOrWhiteSpace(cedulaMaskedTextBox.Text))
            {
                GeneralerrorProvider.SetError(cedulaMaskedTextBox, "Llenar Casilla de Nombre");
                Error = true;
            }

            if (String.IsNullOrWhiteSpace(direccionTextBox.Text))
            {
                GeneralerrorProvider.SetError(direccionTextBox, "Llenar Casilla de Direccion");
                Error = true;
            }


            return(Error);
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int id = Convert.ToInt32(entradadeActivosIdNumericUpDown.Value);
                EntradadeActivos entrada = BLL.EntradadeActivosBLL.Buscar(id);

                if (entrada != null)
                {
                    entradadeActivosIdNumericUpDown.Value = entrada.EntradadeActivosId;
                    fechaDateTimePicker.Value             = entrada.Fecha;
                    motivoTextBox.Text = entrada.Motivo;
                    sumaTextBox.Text   = entrada.Suma.ToString();
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                GeneralerrorProvider.Clear();
            }
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar Casilla para poder Buscar", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int      id       = Convert.ToInt32(usuariosIdNumericUpDown.Value);
                Usuarios usuarios = BLL.UsuariosBLL.Buscar(id);

                if (usuarios != null)
                {
                    usuariosIdNumericUpDown.Value = usuarios.UsuariosId;
                    nombreTextBox.Text            = usuarios.Nombre;
                    usuarioTextBox.Text           = usuarios.Usuario;
                    contraseñaTextBox.Text        = usuarios.Contraseña;
                    tipodeusuarioComboBox.Text    = usuarios.Tipodeusuario;
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GeneralerrorProvider.Clear();
            }
        }
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool     paso     = false;
            Usuarios usuarios = Llenaclase();
            int      id       = Convert.ToInt32(usuariosIdNumericUpDown.Value);



            if (validar(3))
            {
                MessageBox.Show("Favor Dijite un Nombre", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (validar(4))
            {
                MessageBox.Show("La Contraseña no son Iguales", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                contraseñaTextBox.Clear();
                ConfirmartextBox.Clear();
                return;
            }

            if (validar(2))
            {
                MessageBox.Show("Favor de Llenar las Casillas", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (usuariosIdNumericUpDown.Value == 0)
                {
                    paso = BLL.UsuariosBLL.Guardar(usuarios);
                }
                else
                {
                    var usuario = BLL.UsuariosBLL.Buscar(id);

                    if (usuario != null)
                    {
                        paso = BLL.UsuariosBLL.Editar(usuarios);
                    }
                    else
                    {
                        MessageBox.Show("Id no existe", "Falló",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }


                Limpiar();
                GeneralerrorProvider.Clear();
                if (paso)
                {
                    MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }