Exemplo n.º 1
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            int      id = Convert.ToInt32(IDnumericUpDown.Value);
            facturar fa = FActuraBLL.Buscar(id);

            if (fa != null)
            {
                LLenaCampo(fa);
            }
            else
            {
                MessageBox.Show("No se encontro!", "Fallo",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void Guardarbutton_Click(object sender, EventArgs e)
        {
            if (Validar(2))
            {
                MessageBox.Show("Debe Agregar Algun Producto al Grid", "Validación",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                facturar fa   = LLenaclase();
                bool     Paso = false;

                if (IDnumericUpDown.Value == 0)
                {
                    Paso = FActuraBLL.Guardar(fa);
                    errorProvider1.Clear();
                }
                else
                {
                    int id             = Convert.ToInt32(IDnumericUpDown.Value);
                    var mantenimientos = FActuraBLL.Buscar(id);
                    if (mantenimientos != null)
                    {
                        Paso = FActuraBLL.Modificar(fa);
                    }
                    errorProvider1.Clear();
                }

                if (Paso)
                {
                    limpiar();
                    MessageBox.Show("Guardado!!", "Exito",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No se pudo guardar!!", "Fallo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 3
0
 private void Eliminarbutton_Click(object sender, EventArgs e)
 {
     if (Validar(1))
     {
         MessageBox.Show("Favor Llenar Casilla!", "Exito",
                         MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         int id = Convert.ToInt32(IDnumericUpDown.Value);
         if (FActuraBLL.Eliminar(id))
         {
             MessageBox.Show("Eliminado!!", "Exito",
                             MessageBoxButtons.OK, MessageBoxIcon.Information);
             limpiar();
         }
         else
         {
             MessageBox.Show("No se pudo eliminar!!", "Fallo",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemplo n.º 4
0
        private bool Existe()
        {
            facturar f = FActuraBLL.Buscar((int)IDnumericUpDown.Value);

            return(f != null);
        }
Exemplo n.º 5
0
 private void PreciotextBox_TextChanged(object sender, EventArgs e)
 {
     ImportetextBox.Text = FActuraBLL.CalcularImporte(Convert.ToDecimal(PreciotextBox.Text),
                                                      Convert.ToInt32(numericUpDownCantida.Value)).ToString();
 }