Example #1
0
        private void saveProducto(Eproductos item, ref ETransactionResult res)
        {
            Daproductos db = new Daproductos();

            db.productos_Insert(item, ref res);

            if (res.result == 0)
            {
                EMovimiento        mov     = new EMovimiento();
                EMovimientoDetalle detalle = new EMovimientoDetalle();
                ETransactionResult result  = new ETransactionResult();
                int     idDetalle          = 0;
                decimal totalCantidad      = 0;

                mov.fecha            = DateTime.Now;
                mov.idMovimiento     = (int)getIdMovimiento();
                mov.idTipoMovimiento = "EPT";
                mov.usuario          = "admin";

                totalCantidad = item.cantidad;
                idDetalle     = (int)getIdMovimientoDet();

                detalle.idDetalle      = idDetalle;
                detalle.idMovimiento   = mov.idMovimiento;
                detalle.tipoAfectacion = "E";
                detalle.idProducto     = item.idProducto;
                detalle.cantidad       = totalCantidad;

                _movimiento.Movimiento_Insert(mov, ref result);
                if (result.result == 0)
                {
                    _movimientoDetalle.MovimientoDetalle_Insert(detalle, ref result);
                }
            }
        }
Example #2
0
        private bool saveDetalleMov(List <EMovimientoDetalle> detalle, ref ETransactionResult result)
        {
            bool res = true;
            DaMovimientoDetalle daDetalle = new DaMovimientoDetalle();

            foreach (EMovimientoDetalle item in detalle)
            {
                daDetalle.MovimientoDetalle_Insert(item, ref result);
                if (result.result != 0)
                {
                    return(false);
                }
            }
            return(res);
        }
Example #3
0
        public object Insert(object obj, ref ETransactionResult result)
        {
            DaMovimientoDetalle daLista = new DaMovimientoDetalle();

            return(daLista.MovimientoDetalle_Insert((EMovimientoDetalle)obj, ref result));
        }