Beispiel #1
0
        private void Limpiar()
        {
            vehiculosIdNumericUpDown.Value = 0;
            descripcionTextBox.Clear();
            mantenimientoTextBox.Clear();

            GenaralerrorProvider.Clear();
        }
Beispiel #2
0
        private void Limpiar()
        {
            tallerIdNumericUpDown.Value = 0;
            nombreTextBox.Clear();


            GenaralerrorProvider.Clear();
        }
        private void Limpiar()
        {
            entradaIdNumericUpDown.Value = 0;
            cantidadNumericUpDown.Value  = 0;


            GenaralerrorProvider.Clear();
        }
Beispiel #4
0
        private bool validar(int error)
        {
            bool errores = false;

            if (error == 1 && tallerIdNumericUpDown.Value == 0)
            {
                GenaralerrorProvider.SetError(tallerIdNumericUpDown, "Llenar taller Id");
                errores = true;
            }

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


            return(errores);
        }
        private bool validar(int error)
        {
            bool errores = false;

            if (error == 1 && entradaIdNumericUpDown.Value == 0)
            {
                GenaralerrorProvider.SetError(entradaIdNumericUpDown, "Llenar Entrada Id");
                errores = true;
            }

            if (error == 2 && cantidadNumericUpDown.Value == 0)
            {
                GenaralerrorProvider.SetError(cantidadNumericUpDown, "Llene Nombre");
                errores = true;
            }


            return(errores);
        }
Beispiel #6
0
        private bool validar(int error)
        {
            bool errores = false;

            if (error == 1 && vehiculosIdNumericUpDown.Value == 0)
            {
                GenaralerrorProvider.SetError(vehiculosIdNumericUpDown, "Llenar Persona Id");
                errores = true;
            }

            if (error == 2 && string.IsNullOrEmpty(descripcionTextBox.Text))
            {
                GenaralerrorProvider.SetError(descripcionTextBox, "Llene Mantenimiento");
                errores = true;
            }



            return(errores);
        }
Beispiel #7
0
        private void Guardarbutton_Click_1(object sender, EventArgs e)
        {
            bool      paso      = false;
            Vehiculos vehiculos = Llenaclase();



            if (validar(2))
            {
                MessageBox.Show("Favor de Llenar las Casillas");
            }
            else
            {
                int id = Convert.ToInt32(vehiculosIdNumericUpDown.Value);
                if (id == 0)
                {
                    paso = BLL.VehiculosBLL.Guardar(vehiculos);
                }
                else
                {
                    var C = BLL.VehiculosBLL.Buscar(id);

                    if (C != null)
                    {
                        paso = BLL.VehiculosBLL.Editar(vehiculos);
                    }
                }


                Limpiar();
                GenaralerrorProvider.Clear();
                if (paso)
                {
                    MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Beispiel #8
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            bool     paso     = false;
            Talleres talleres = Llenaclase();


            if (validar(2))
            {
                MessageBox.Show("Favor de Llenar las Casillas");
            }
            else
            {
                if (tallerIdNumericUpDown.Value == 0)
                {
                    paso = BLL.TalleresBLL.Guardar(talleres);
                }
                else
                {
                    var V = BLL.TalleresBLL.Buscar(Convert.ToInt32(tallerIdNumericUpDown.Value));

                    if (V != null)
                    {
                        paso = BLL.TalleresBLL.Editar(talleres);
                    }
                }



                Limpiar();
                GenaralerrorProvider.Clear();
                if (paso)
                {
                    MessageBox.Show("Guardado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No pudo Guardar!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Beispiel #9
0
        private void Eliminarbutton_Click_1(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar (Vehiculos Id) para poder Eliminar");
            }
            else
            {
                int id = Convert.ToInt32(vehiculosIdNumericUpDown.Value);

                if (BLL.VehiculosBLL.Eliminar(id))
                {
                    MessageBox.Show("Eliminado!", "Exitoso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("No Pudo Eliminar!", "Fallido!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GenaralerrorProvider.Clear();
            }
        }
Beispiel #10
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar (Talleres Id) para poder Buscar");
            }
            else
            {
                int      id       = Convert.ToInt32(tallerIdNumericUpDown.Value);
                Talleres talleres = BLL.TalleresBLL.Buscar(id);

                if (talleres != null)
                {
                    tallerIdNumericUpDown.Value = talleres.TallerId;
                    nombreTextBox.Text          = talleres.Nombre;
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GenaralerrorProvider.Clear();
            }
        }
Beispiel #11
0
        private void Buscarbutton_Click_1(object sender, EventArgs e)
        {
            if (validar(1))
            {
                MessageBox.Show("Favor de Llenar (Vehiculo Id) para poder Buscar");
            }
            else
            {
                int       id        = Convert.ToInt32(vehiculosIdNumericUpDown.Value);
                Vehiculos vehiculos = BLL.VehiculosBLL.Buscar(id);

                if (vehiculos != null)
                {
                    vehiculosIdNumericUpDown.Value = vehiculos.VehiculosId;
                    descripcionTextBox.Text        = vehiculos.Descripcion;
                    mantenimientoTextBox.Text      = vehiculos.Mantenimiento.ToString();
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GenaralerrorProvider.Clear();
            }
        }
        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(entradaIdNumericUpDown.Value);
                RegistroEntradaDeArticulos registroEntradaDeArticulos = BLL.RegistroEntradaDeArticulosBLL.Buscar(id);

                if (registroEntradaDeArticulos != null)
                {
                    entradaIdNumericUpDown.Value    = registroEntradaDeArticulos.EntradaId;
                    articulosComboBox.SelectedValue = registroEntradaDeArticulos.ArticuloId;
                    cantidadNumericUpDown.Value     = registroEntradaDeArticulos.Cantidad;
                }
                else
                {
                    MessageBox.Show("No Fue Encontrado!", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                GenaralerrorProvider.Clear();
            }
        }