public static ClasesC Buscarr(int?Id) { ClasesC nuevo = null; using (var conexion = new BeautyCoreDb()) { try { nuevo = new ClasesC() { Encabezado = conexion.Citas.Find(Id) }; if (nuevo.Encabezado != null) { nuevo.Detalle = BLL.DetalleCitasBLL.Listar(nuevo.Encabezado.CitaId); } else { nuevo = null; } } catch (Exception) { throw; } } return(nuevo); }
public static bool Insertar(Citas nuevo) { bool resultado = false; using (var Conn = new BeautyCoreDb()) { try { var p = Buscar(nuevo.CitaId); if (p == null) { Conn.Citas.Add(nuevo); } else { Conn.Entry(nuevo).State = EntityState.Modified; } Conn.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Modificar(FacturaDetalles detalle) { using (var conexion = new BeautyCoreDb()) { try { if (Buscar(detalle.Id) != null) { conexion.Entry(detalle).State = EntityState.Modified; if (conexion.SaveChanges() > 0) { return(true); } } else { return(Guardar(detalle)); } } catch (Exception) { throw; } } return(false); }
public static Clases Buscarr(int?facturaId) { Clases factura = null; using (var conexion = new BeautyCoreDb()) { try { factura = new Clases() { Encabezado = conexion.Facturas.Find(facturaId) }; if (factura.Encabezado != null) { factura.Detalle = BLL.FacturaDetallesBLL.Listar(factura.Encabezado.FacturaId); } else { factura = null; } } catch (Exception) { throw; } } return(factura); }
public static bool Guardar(Facturas nueva) { bool resultado = false; using (var db = new BeautyCoreDb()) { db.Facturas.Add(nueva); db.SaveChanges(); resultado = true; } return(resultado); }
public static bool Eliminar(FacturaDetalles detalle) { using (var conexion = new BeautyCoreDb()) { try { conexion.Entry(detalle).State = EntityState.Deleted; conexion.SaveChanges(); } catch (Exception) { throw; } } return(false); }
public static Citas Buscar(int nuevoId) { Citas ID = null; using (var conexion = new BeautyCoreDb()) { try { ID = conexion.Citas.Find(nuevoId); } catch (Exception) { throw; } } return(ID); }
public static Citas BuscarEncabezado(int?Id) { Citas nuevo = null; using (var conexion = new BeautyCoreDb()) { try { nuevo = conexion.Citas.Find(Id); } catch (Exception) { throw; } } return(nuevo); }
public static List <Citas> GetListaFecha(DateTime D, DateTime H) { List <Citas> lista = new List <Citas>(); using (var db = new BeautyCoreDb()) { try { lista = db.Citas.Where(p => p.Fecha >= D && p.Fecha <= H).ToList(); } catch (Exception) { throw; } } return(lista); }
public static Servicios Buscar(int?nuevoId) { Servicios cliente = null; using (var conexion = new BeautyCoreDb()) { try { cliente = conexion.Servicios.Find(nuevoId); } catch (Exception) { throw; } } return(cliente); }
public static List <Servicios> ListarId(int Id) { List <Servicios> list = new List <Servicios>(); using (var db = new BeautyCoreDb()) { try { list = db.Servicios.Where(p => p.ServicioId == Id).ToList(); } catch (Exception) { throw; } } return(list); }
public static List <Servicios> GetLista() { var lista = new List <Servicios>(); using (var conexion = new BeautyCoreDb()) { try { lista = conexion.Servicios.ToList(); } catch (Exception) { throw; } } return(lista); }
public static Facturas BuscarEncabezado(int?facturaId) { Facturas factura = null; using (var conexion = new BeautyCoreDb()) { try { factura = conexion.Facturas.Find(facturaId); } catch (Exception) { throw; } } return(factura); }
public static List <FacturaDetalles> GetLista() { var lista = new List <FacturaDetalles>(); using (var conexion = new BeautyCoreDb()) { try { lista = conexion.FacturaDetalles.ToList(); } catch (Exception) { throw; } } return(lista); }
public static FacturaDetalles Buscar(int nuevoId) { FacturaDetalles ID = null; using (var conexion = new BeautyCoreDb()) { try { ID = conexion.FacturaDetalles.Find(nuevoId); } catch (Exception) { throw; } } return(ID); }
public static List <FacturaDetalles> GetListaId(int Id) { List <FacturaDetalles> list = new List <FacturaDetalles>(); using (var db = new BeautyCoreDb()) { try { list = db.FacturaDetalles.Where(p => p.Id == Id).ToList(); } catch (Exception) { throw; } } return(list); }
public static FacturaDetalles Buscar(int Id) { var c = new FacturaDetalles(); using (var Conn = new BeautyCoreDb()) { try { c = Conn.FacturaDetalles.Find(Id); } catch (Exception) { throw; } } return(c); }
public static Citas Buscar(int Id) { var c = new Citas(); using (var Conn = new BeautyCoreDb()) { try { c = Conn.Citas.Find(Id); } catch (Exception) { throw; } } return(c); }
public static List <Facturas> Listar() { List <Facturas> listado = null; using (var conexion = new BeautyCoreDb()) { try { listado = conexion.Facturas.ToList(); } catch (Exception) { throw; } } return(listado); }
public static List <Citas> GetListaId(int Id) { List <Citas> list = new List <Citas>(); using (var db = new BeautyCoreDb()) { try { list = db.Citas.Where(p => p.ClienteId == Id).ToList(); } catch (Exception) { throw; } } return(list); }
public static Clientes Buscar(int?clienteId) { Clientes cliente = null; using (var conexion = new BeautyCoreDb()) { try { cliente = conexion.Clientes.Find(clienteId); } catch (Exception) { throw; } } return(cliente); }
public static Usuarios Buscar(int?usuarioId) { Usuarios usuario = null; using (var conexion = new BeautyCoreDb()) { try { usuario = conexion.Usuarios.Find(usuarioId); } catch (Exception) { throw; } } return(usuario); }
public static bool Eliminar(ClasesC nuevo) { bool resultado = false; using (var conexion = new BeautyCoreDb()) { try { nuevo = BLL.CitasBLL.Buscarr(nuevo.Encabezado.CitaId); BLL.CitasBLL.Eliminar(nuevo.Encabezado); BLL.DetalleCitasBLL.Eliminar(nuevo.Detalle); } catch (Exception) { throw; } } return(resultado); }
public static bool Guardar(FacturaDetalles detalle) { using (var conexion = new BeautyCoreDb()) { try { conexion.FacturaDetalles.Add(detalle); if (conexion.SaveChanges() > 0) { return(true); } } catch (Exception) { throw; } } return(false); }
public static bool Modificar(Citas nuevo) { using (var conexion = new BeautyCoreDb()) { try { conexion.Entry(nuevo).State = EntityState.Modified; if (conexion.SaveChanges() > 0) { return(true); } } catch (Exception) { throw; } } return(false); }
public static List <CitasDetalles> Listar(int?Id) { List <CitasDetalles> listado = null; using (var conexion = new BeautyCoreDb()) { try { listado = conexion.CitasDetalles. Where(d => d.ClienteId == Id). OrderBy(d => d.Servicio).ToList(); } catch (Exception) { throw; } } return(listado); }
public static bool Eliminar(Clases factura) { bool resultado = false; using (var conexion = new BeautyCoreDb()) { try { factura = BLL.FacturasBLL.Buscarr(factura.Encabezado.FacturaId); BLL.FacturasBLL.Eliminar(factura.Encabezado); BLL.FacturaDetallesBLL.Eliminar(factura.Detalle); } catch (Exception) { throw; } } return(resultado); }
public static List <FacturaDetalles> Listar(int?Id) { List <FacturaDetalles> listado = null; using (var conexion = new BeautyCoreDb()) { try { listado = conexion.FacturaDetalles. Where(d => d.FacturaId == Id). OrderBy(d => d.Id).ToList(); } catch (Exception) { throw; } } return(listado); }
public static bool Eliminar(FacturaDetalles nuevo) { bool resultado = false; using (var Conn = new BeautyCoreDb()) { try { Conn.Entry(nuevo).State = EntityState.Deleted; Conn.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static bool Eliminar(Facturas nuevo) { using (var conexion = new BeautyCoreDb()) { try { conexion.Entry(nuevo).State = EntityState.Deleted; if (conexion.SaveChanges() > 0) { return(true); } } catch (Exception) { throw; } } return(false); }