crud de importe en proceso
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user