crud de importe en proceso

This commit is contained in:
Carlos Sandoval
2024-06-30 11:19:46 -06:00
parent 3a1c75967a
commit 8009e38291
21 changed files with 733 additions and 50 deletions
+28
View File
@@ -13,6 +13,7 @@ using System.Windows.Forms;
using compabetov2.admin;
using compabetov2.database;
using compabetov2.database.modelos;
using compabetov2.Ventas;
namespace compabetov2.database
{
@@ -1981,6 +1982,33 @@ namespace compabetov2.database
}
}
public static bool insertarImporteDAO(ImporteModel importe)
{
var db_conexion = new Conexion();
try
{
SQLiteConnection conexion = db_conexion.get_connection();
conexion.Open();
string sql = "INSERT INTO importe (tipo, precioImporte, img) VALUES(@tipo, @precioImporte, @img); ";
SQLiteCommand command = new SQLiteCommand(sql, conexion);
command.Parameters.AddWithValue("@tipo",importe.tipo);
command.Parameters.AddWithValue("@precioImporte", importe.precioImporte);
command.Parameters.AddWithValue("@img",importe.img);
command.ExecuteNonQuery();
return true;
}
catch (SQLiteException ex)
{
MessageBox.Show(ex.Message);
return false;
}
}
private static void crearDB()
{
var db_conexion = new Conexion();