Пример #1
0
        public void ModificarDetalle(ent.DetalleE _DetalleModificar)
        {
            var _modificarDetalle = AutoMapper.Mapper.Map <ent.DetalleE, bd.DETALLE>(_DetalleModificar);

            _repositorio.Modificar(_modificarDetalle);
            _repositorio.Grabar();
        }
Пример #2
0
        public void EliminarDetalle(ent.DetalleE _DetalleEliminar)
        {
            var _eliminarDetalle = AutoMapper.Mapper.Map <ent.DetalleE, bd.DETALLE>(_DetalleEliminar);

            _repositorio.Adicionar(_eliminarDetalle);
            _repositorio.Grabar();
        }
Пример #3
0
        public ActionResult VerDetsFact(int id)
        {
            var DetallesDeFactura = new ent.DetalleE();

            DetallesDeFactura.Facturas = new dom.FacturaD().FacturasPorId(id);
            return(View(DetallesDeFactura));
        }
Пример #4
0
        public ActionResult VerDetsFact(ent.DetalleE DetsFacturaE)
        {
            var detalle  = new ent.DetalleE();
            var producto = new dom.ProductosD().ProductoPorID(DetsFacturaE.id_producto);

            //Llena el total del detalle
            DetsFacturaE.precio = producto.precio * DetsFacturaE.cantidad;

            //Lleno la entidad que se enviará como parametro para crear el detalle
            detalle.id_factura  = DetsFacturaE.Facturas.num_factura;
            detalle.precio      = DetsFacturaE.precio;
            detalle.id_producto = DetsFacturaE.id_producto;
            detalle.cantidad    = DetsFacturaE.cantidad;
            detalle.num_detalle = DetsFacturaE.num_detalle;

            new dom.DetalleD().CrearDetalle(detalle);
            return(RedirectToAction("VerDetsFact"));
        }
Пример #5
0
 public ActionResult Editar(ent.DetalleE FacturaEditado)
 {
     new dom.DetalleD().ModificarDetalle(FacturaEditado);
     return(RedirectToAction("Index"));
 }
Пример #6
0
 public ActionResult Crear(ent.DetalleE factura)
 {
     new dom.DetalleD().CrearDetalle(factura);
     return(RedirectToAction("Index"));
 }
Пример #7
0
        public ActionResult Crear()
        {
            var _detalles = new ent.DetalleE();

            return(PartialView("Crear", _detalles));
        }