Example #1
0
        protected void GuardarButton_Click(object sender, EventArgs e)
        {
            Facturas factura = new Facturas();

            ObtenerValores(factura);
            if (FacturaIdTextBox.Text == "")
            {
                if (VehiculoDropDownList.Text != "")
                {
                    if (factura.Insertar())
                    {
                        Limpiar();
                        Validaciones.ShowToastr(this, "Exito", "Insertado correctamente!", "success");
                    }
                    else
                    {
                        Validaciones.ShowToastr(this, "Error", "Error al insertar", "error");
                    }
                }
                else
                {
                    Validaciones.ShowToastr(this, "Advertencia", "Debe llenar todos los campos", "warning");
                }
            }
            else
            {
                if (VehiculoDropDownList.Text != "")
                {
                    if (factura.Editar())
                    {
                        Limpiar();
                        Validaciones.ShowToastr(this, "Exito", "Modificado correctamente!", "success");
                    }
                    else
                    {
                        Validaciones.ShowToastr(this, "Error", "Error al modificar", "error");
                    }
                }
                else
                {
                    Validaciones.ShowToastr(this, "Advertencia", "Debe llenar todos los campos", "warning");
                }
            }
        }
Example #2
0
 private void GuardarButton_Click(object sender, EventArgs e)
 {
     ObtenerValores();
     if (idTextBox.Text == "")
     {
         if (entradaComboBox.Text.Equals("") && totalReparacionTextBox.Text != "" && totalFacturaTextBox.Text != "" && montoAPagarTextBox.Text != "")
         {
             if (factura.Insertar())
             {
                 Limpiar();
                 MensajeOk("Insertado correctamente");
             }
             else
             {
                 MensajeError("Error al insertar");
             }
         }
         else
         {
             MessageBox.Show("Debe llenar todos los campos", "Error al insertar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
     else
     {
         if (entradaComboBox.Text.Equals("") && totalReparacionTextBox.Text != "" && totalFacturaTextBox.Text != "" && montoAPagarTextBox.Text != "")
         {
             if (factura.Editar())
             {
                 Limpiar();
                 MensajeOk("Modificado correctamente");
             }
             else
             {
                 MensajeError("Error al modificar");
             }
         }
         else
         {
             MessageBox.Show("Debe llenar todos los campos", "Error al modificar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }