public void ModificarDetsFactura(ent.DetsFacturaE _DetsFacturaModificar) { var _modificarDetsFactura = AutoMapper.Mapper.Map <ent.DetsFacturaE, bd.DETALLE>(_DetsFacturaModificar); _repositorio.Modificar(_modificarDetsFactura); _repositorio.Grabar(); }
public void CrearDetsFactura(ent.DetsFacturaE _DetsFacturaCrear) { var _adicionarDetsFactura = AutoMapper.Mapper.Map <ent.DetsFacturaE, bd.DETALLE>(_DetsFacturaCrear); _repositorio.Adicionar(_adicionarDetsFactura); _repositorio.Grabar(); }
public ActionResult VerDetsFact(int id) { var DetallesDeFactura = new ent.DetsFacturaE(); DetallesDeFactura.FACTURAS = new dom.FacturaD().FacturasPorId(id); //var DetallesFact = new dom.FacturasD().FacturasPorID(id); return(View(DetallesDeFactura)); }
public ActionResult VerDetsFact(ent.DetsFacturaE DetsFacturaE) { var detalle = new ent.DetsFacturaE(); var producto = new dom.ProductosD().ProductoPorID(DetsFacturaE.id_producto); //Llena el total del detalle DetsFacturaE.precio = (decimal)(producto.precio * DetsFacturaE.cantidad); //Lleno la entidad que se enviará como parametro para crear el detalle detalle.num_factura = DetsFacturaE.FACTURAS.num_factura; detalle.precio = DetsFacturaE.precio; detalle.id_producto = DetsFacturaE.id_producto; detalle.cantidad = DetsFacturaE.cantidad; detalle.id_detFact = DetsFacturaE.id_detFact; new dom.DetsFacturaD().CrearDetsFactura(detalle); return(RedirectToAction("VerDetsFact")); }
public ActionResult VerDetallesFact(ent.DetsFacturaE DetsFacturaE) { new dom.DetsFacturaD().CrearDetsFactura(DetsFacturaE); return(RedirectToAction("Index")); }