diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json
index 23762ee..dc00168 100644
--- a/.vs/VSWorkspaceState.json
+++ b/.vs/VSWorkspaceState.json
@@ -2,8 +2,7 @@
"ExpandedNodes": [
"",
"\\database",
- "\\database\\modelos",
- "\\Resources"
+ "\\database\\modelos"
],
"SelectedNode": "\\.sln",
"PreviewInSolutionExplorer": false
diff --git a/.vs/compabetoOG/v17/.wsuo b/.vs/compabetoOG/v17/.wsuo
index 9c83720..ff4e67f 100644
Binary files a/.vs/compabetoOG/v17/.wsuo and b/.vs/compabetoOG/v17/.wsuo differ
diff --git a/.vs/compabetov2.csproj.dtbcache.json b/.vs/compabetov2.csproj.dtbcache.json
index 125822e..76dff4e 100644
--- a/.vs/compabetov2.csproj.dtbcache.json
+++ b/.vs/compabetov2.csproj.dtbcache.json
@@ -1 +1 @@
-{"RootPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG","ProjectFileName":"compabetov2.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Form1.cs"},{"SourceFile":"Form1.Designer.cs"},{"SourceFile":"MenuPrincipal.cs"},{"SourceFile":"MenuPrincipal.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\bin\\Debug\\compabetov2.exe","OutputItemRelativePath":"compabetov2.exe"},{"OutputItemFullPath":"C:\\Users\\carsu\\Source\\Repos\\compabetoOG\\bin\\Debug\\compabetov2.pdb","OutputItemRelativePath":"compabetov2.pdb"}],"CopyToOutputEntries":[]}
\ No newline at end of file
+{"RootPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG","ProjectFileName":"compabetov2.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"cuentas.cs"},{"SourceFile":"cuentas.Designer.cs"},{"SourceFile":"database\\conexion.cs"},{"SourceFile":"database\\DAO.cs"},{"SourceFile":"database\\modelos\\Categoria.cs"},{"SourceFile":"database\\modelos\\Producto.cs"},{"SourceFile":"database\\modelos\\usuario.cs"},{"SourceFile":"database\\service.cs"},{"SourceFile":"inventario.cs"},{"SourceFile":"inventario.Designer.cs"},{"SourceFile":"login.cs"},{"SourceFile":"login.Designer.cs"},{"SourceFile":"MenuPrincipal.cs"},{"SourceFile":"MenuPrincipal.Designer.cs"},{"SourceFile":"mermas.cs"},{"SourceFile":"mermas.Designer.cs"},{"SourceFile":"personal.cs"},{"SourceFile":"personal.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"vender.cs"},{"SourceFile":"vender.Designer.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\EntityFramework.6.4.4\\lib\\net45\\EntityFramework.SqlServer.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.ComponentModel.DataAnnotations.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\\lib\\net46\\System.Data.SQLite.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\System.Data.SQLite.EF6.1.0.118.0\\lib\\net46\\System.Data.SQLite.EF6.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\packages\\System.Data.SQLite.Linq.1.0.118.0\\lib\\net46\\System.Data.SQLite.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\bin\\Debug\\compabetov2.exe","OutputItemRelativePath":"compabetov2.exe"},{"OutputItemFullPath":"C:\\Users\\carsu\\source\\repos\\compabetoOG\\bin\\Debug\\compabetov2.pdb","OutputItemRelativePath":"compabetov2.pdb"}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe
index e8755cf..fe3fc0d 100644
Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ
diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb
index aff23ee..89f04ee 100644
Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ
diff --git a/bin/Debug/data.db b/bin/Debug/data.db
index 8fa3456..a2d1e31 100644
Binary files a/bin/Debug/data.db and b/bin/Debug/data.db differ
diff --git a/compabetov2.csproj b/compabetov2.csproj
index 5012fbb..b0ce6d4 100644
--- a/compabetov2.csproj
+++ b/compabetov2.csproj
@@ -74,6 +74,7 @@
+
diff --git a/database/DAO.cs b/database/DAO.cs
index b810b91..57358b5 100644
--- a/database/DAO.cs
+++ b/database/DAO.cs
@@ -107,10 +107,13 @@ namespace compabetov2.database
{
conexion.Open();
- string sql = "INSERT INTO Producto (nombre, descripcion, precio, stock, fk_idcategoria) "+
- "VALUES (@nombre, @descripcion, @precio,@stock, @idcategoria)";
-
-
+ string sql = "INSERT INTO Producto (nombre, descripcion, precio,img, stock, fk_idcategoria) "+
+ "VALUES (@nombre, @descripcion, @precio,@img , @stock, @idcategoria)";
+
+ if (!producto.img.Equals(""))
+ {
+ producto.img = guardarImg(producto.img);
+ }
using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
@@ -118,6 +121,7 @@ namespace compabetov2.database
command.Parameters.AddWithValue("@nombre", producto.nombre);
command.Parameters.AddWithValue("@descripcion", producto.descripcion);
command.Parameters.AddWithValue("@precio", producto.precion);
+ command.Parameters.AddWithValue("@img", producto.img);
command.Parameters.AddWithValue("@stock", producto.stock);
command.Parameters.AddWithValue("@idcategoria", producto.categoria.idCategoria);
int filasAfectadas = command.ExecuteNonQuery();
@@ -134,6 +138,34 @@ namespace compabetov2.database
}
}
+ public static bool eliminarProductoDAO(Producto producto)
+ {
+ var db_conexion = new Conexion();
+ try
+ {
+ using (SQLiteConnection conexion = db_conexion.get_connection())
+ {
+ conexion.Open();
+
+ string sql = "DELETE FROM Producto WHERE idproducto = @idproducto";
+
+ using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
+ {
+ command.Parameters.AddWithValue("@idproducto", producto.idProducto);
+ int filasAfectadas = command.ExecuteNonQuery();
+
+ if (filasAfectadas > 0) { return true; }
+ else { return false; }
+ }
+ }
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return false;
+ }
+ }
+
public static bool insertarCategoriaDAO(Categoria categoria)
{
var db_conexion = new Conexion();
@@ -164,6 +196,96 @@ namespace compabetov2.database
}
}
+ public static bool insertarClienteDAO(Cliente cliente)
+ {
+ var db_conexion = new Conexion();
+ try
+ {
+ using (SQLiteConnection conexion = db_conexion.get_connection())
+ {
+ conexion.Open();
+
+ string sql = "INSERT INTO Cliente (nombres, apellidos, calle, colonia, cp, no_ext, no_int, referencia, telefono, telefono_extra) " +
+ "VALUES (@nombres, @apellidos, @calle, @colonia, @cp, @no_ext, @no_int, @referencia, @telefono, @telefono_extra)";
+
+ using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
+ {
+ command.Parameters.AddWithValue("@nombre", cliente.nombres);
+ command.Parameters.AddWithValue("@apellidios", cliente.apellidos);
+ command.Parameters.AddWithValue("@calle", cliente.calle);
+ command.Parameters.AddWithValue("@colonia", cliente.colonia);
+ command.Parameters.AddWithValue("@cp", cliente.cp);
+ command.Parameters.AddWithValue("@no_ext", cliente.no_ext);
+ command.Parameters.AddWithValue("@no_int", cliente.no_int);
+ command.Parameters.AddWithValue("@referencia", cliente.referencia);
+ command.Parameters.AddWithValue("@telefono", cliente.telefono);
+ command.Parameters.AddWithValue("@telefono_extra", cliente.telefono_extra);
+ int filasAfectadas = command.ExecuteNonQuery();
+
+ if (filasAfectadas > 0) { return true; }
+ else { return false; }
+ }
+ }
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return false;
+ }
+ }
+
+ public static bool eliminarClienteDAO(Cliente cliente)
+ {
+ var db_conexion = new Conexion();
+ try
+ {
+ using (SQLiteConnection conexion = db_conexion.get_connection())
+ {
+ conexion.Open();
+
+ string sql = "DELETE FROM Cliente WHERE idCliente = @idCliente";
+
+ using (SQLiteCommand command = new SQLiteCommand(sql, conexion))
+ {
+ command.Parameters.AddWithValue("@idCliente", cliente.idCliente);
+ int filasAfectadas = command.ExecuteNonQuery();
+
+ if (filasAfectadas > 0) { return true; }
+ else { return false; }
+ }
+ }
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return false;
+ }
+ }
+
+ public static SQLiteDataReader conseguirClientesDAO()
+ {
+ SQLiteDataReader reader = null;
+ var db_conexion = new Conexion();
+ try
+ {
+ using (SQLiteConnection conexion = db_conexion.get_connection())
+ {
+ conexion.Open();
+
+ string sql = "SELECT * FROM Cliente";
+ SQLiteCommand command = new SQLiteCommand(sql, conexion);
+ reader = command.ExecuteReader();
+
+ return reader;
+ }
+ }
+ catch (SQLiteException ex)
+ {
+ MessageBox.Show(ex.Message);
+ return reader;
+ }
+ }
+
private static string guardarImg(String rutaImagen)
{
//consigue la carpeta del proyectro
@@ -195,6 +317,7 @@ namespace compabetov2.database
"DROP TABLE IF EXISTS Empleado",
"DROP TABLE IF EXISTS Producto",
"DROP TABLE IF EXISTS Categoria",
+ "DROP TABLE IF EXISTS Cliente",
"CREATE TABLE Empleado (idempleado INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, "+
"apellido TEXT NOT NULL, calle TEXT NOT NULL, fecha_contratacion TEXT NOT NULL, colonia TEXT NOT NULL, cp TEXT NOT NULL, no_ext TEXT NOT NULL," +
@@ -206,9 +329,13 @@ namespace compabetov2.database
"CREATE TABLE Categoria (idcategoria INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL)",
"CREATE TABLE Producto (idproducto INTEGER PRIMARY KEY AUTOINCREMENT, nombre TEXT NOT NULL, descripcion TEXT NOT NULL, "+
- "precio DECIMAL(10, 2) NOT NULL, stock INTEGER NOT NULL, " +
+ "precio DECIMAL(10, 2) NOT NULL, img TEXT NOT NULL, stock INTEGER NOT NULL, " +
"fk_idcategoria INTEGER NOT NULL, FOREIGN KEY (fk_idcategoria) REFERENCES Categoria (idcategoria))",
+ "CREATE TABLE Cliente (idcliente INTEGER PRIMARY KEY AUTOINCREMENT, nombres TEXT NOT NULL, apellidos TEXT NOT NULL, " +
+ "calle TEXT NOT NULL, colonia TEXT NOT NULL, cp TEXT NOT NULL, no_ext TEXT NOT NULL, no_int TEXT NOT NULL, referencia TEXT NOT NULL, " +
+ "telefono TEXT NOT NULL, telefono_extra TEXT NOT NULL)",
+
"INSERT INTO Empleado ( nombre, apellido, calle, fecha_contratacion, colonia, cp, no_ext,no_int, referencia, fecha_nac, telefono, activo) VALUES('jefe', '', '', '', '', '', '', '', '', '', '', 0);",
"INSERT INTO Login ( tipo, usuario, contra, fk_idempleado) VALUES('admin', 'admin', '12345', 1);"
};
diff --git a/database/modelos/Cliente.cs b/database/modelos/Cliente.cs
new file mode 100644
index 0000000..d61ecf3
--- /dev/null
+++ b/database/modelos/Cliente.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace compabetov2.database.modelos
+{
+ public class Cliente
+ {
+ public int idCliente;
+ public string nombres;
+ public string apellidos;
+ public string calle;
+ public string colonia;
+ public string cp;
+ public string no_ext;
+ public string no_int;
+ public string referencia;
+ public string telefono;
+ public string telefono_extra;
+
+ public Cliente(int idCliente = -1, string nombres = "", string apellidos = "", string calle = "",
+ string colonia = "", string cp = "", string no_ext = "",string no_int = "", string referencia = "", string telefono = "", string telefono_extra = "")
+ {
+ this.idCliente = idCliente;
+ this.nombres = nombres;
+ this.apellidos = apellidos;
+ this.calle = calle;
+ this.colonia = colonia;
+ this.cp = cp;
+ this.no_ext = no_ext;
+ this.no_int = no_int;
+ this.referencia = referencia;
+ this.telefono = telefono;
+ this.telefono_extra = telefono_extra;
+
+
+ }
+ }
+}
+
diff --git a/database/service.cs b/database/service.cs
index 2311812..c7fe170 100644
--- a/database/service.cs
+++ b/database/service.cs
@@ -53,5 +53,41 @@ namespace compabetov2.database
{
return DAO.insertarCategoriaDAO(categoria);
}
+
+ public static bool insertarCliente(Cliente cliente)
+ {
+ return DAO.insertarClienteDAO(cliente);
+ }
+
+ public static bool eliminarCliente(Cliente cliente)
+ {
+ return DAO.eliminarClienteDAO(cliente);
+ }
+
+ public static List conseguirCliente()
+ {
+ List clientes = new List();
+
+ SQLiteDataReader reader = DAO.conseguirClientesDAO();
+
+ while (reader.Read())
+ {
+ Cliente cliente = new Cliente(
+ (int)reader["idCliente"],
+ reader["nombres"].ToString(),
+ reader["apellidos"].ToString(),
+ reader["calle"].ToString(),
+ reader["colonia"].ToString(),
+ reader["cp"].ToString(),
+ reader["no_ext"].ToString(),
+ reader["no_int"].ToString(),
+ reader["referencia"].ToString(),
+ reader["telefono"].ToString(),
+ reader["telefono_extra"].ToString()
+ );
+ clientes.Add(cliente);
+ }
+ return clientes;
+ }
}
}
diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
index 143446f..22aac9d 100644
--- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
+++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-27e294817a0bec5f75cbc3af7fd0a10fac43022232f7b6272aae9c64a32c97fa
+02dc50247532cb20084f44304c5c95e6e614121351100c9987f88dd3c1f0e1c2
diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe
index e8755cf..fe3fc0d 100644
Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ
diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb
index aff23ee..89f04ee 100644
Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ