grid con fallas
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Data.SQLite;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using compabetov2.database;
|
||||
using compabetov2.database.modelos;
|
||||
|
||||
@@ -89,5 +90,46 @@ namespace compabetov2.database
|
||||
}
|
||||
return clientes;
|
||||
}
|
||||
|
||||
public static bool insertarEmpleado(Empleado empleado)
|
||||
{
|
||||
return DAO.insertarEmpleadoDAO(empleado);
|
||||
}
|
||||
|
||||
public static List<Empleado> conseguirEmpleados()
|
||||
{
|
||||
List<Empleado> empleados = new List<Empleado>();
|
||||
|
||||
using (SQLiteDataReader reader = DAO.conseguirEmpleadosDAO()) {
|
||||
if(reader == null) { MessageBox.Show("null");
|
||||
return empleados;
|
||||
} else
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
Empleado empleado = new Empleado(
|
||||
(int)reader["idempleado"],
|
||||
(string)reader["nombre"].ToString(),
|
||||
(string)reader["apellidos"].ToString(),
|
||||
(string)reader["calle"].ToString(),
|
||||
(string)reader["fecha_contratacion"].ToString(),
|
||||
(string)reader["estado"].ToString(),
|
||||
(string)reader["colonia"].ToString(),
|
||||
(string)reader["cp"].ToString(),
|
||||
(string)reader["no_ext"].ToString(),
|
||||
(string)reader["no_int"].ToString(),
|
||||
(string)reader["referencia"].ToString(),
|
||||
(string)reader["fecha_nac"].ToString(),
|
||||
(string)reader["telefono"].ToString()
|
||||
);
|
||||
empleados.Add(empleado);
|
||||
}
|
||||
return empleados;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user