public bool AddVenta(Sale sale, List <DetalleVenta> Detalles) { if (sale.IdSALE == null) { return(false); } foreach (var dvent in Detalles) { dvent.VentaId = sale.IdSALE; } Context.DetalleVentas.AddRange(Detalles); Context.Sales.Add(sale); Context.SaveChanges(); return(true); }
public bool AddPaciente(Paciente paciente) { Context.Pacientes.Add(paciente); Context.SaveChanges(); return(true); }
public void AddAExpediente(Expediente expediente) { Context.Expediente.Add(expediente); expediente.Fecha = DateTime.Now; Context.SaveChanges(); }
public bool AddProducto(Producto producto) { Context.Productos.Add(producto); Context.SaveChanges(); return(true); }
public bool AddDoctor(Doctor doctor) { Context.Doctores.Add(doctor); Context.SaveChanges(); return(true); }
public bool AddCategoria(Categoria categoria) { Context.Categorias.Add(categoria); Context.SaveChanges(); return(true); }