Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public async Task <Company_Recibos_Detalle> AddLineaRecibo(LineaReciboRequest dto)
        {
            try
            {
                Company_Recibos_Detalle _entity = new Company_Recibos_Detalle();
                _entity.UID_Recibo       = dto.uidRecibo;
                _entity.UID_Producto     = dto.uidProducto;
                _entity.Descripcion      = dto.descripcion;
                _entity.Importe_Unitario = dto.dcImporteUnitario;
                _entity.Unidades         = dto.iUnidades;
                _entity.Importe_Total    = _entity.Importe_Unitario.Value * _entity.Unidades;
                await _iunitOfWork.CompanyRecibosDetalleRepository.InsertEntity(_entity);

                await _iunitOfWork.CompanyRecibosDetalleRepository.SaverChangeAsyc();

                return(_entity);
            }
            catch (CError e)
            {
                throw _errorManager.AddError("AddRecibos", "AddLineaRecibo", e, MethodBase.GetCurrentMethod(), null);
            }
            catch (System.Exception ex)
            {
                throw _errorManager.AddError("Error Generico", "AddLineaRecibo", ex, MethodBase.GetCurrentMethod(), null);
            }
        }
        public async Task <IActionResult> AddLineaDetalle([FromBody] LineaReciboRequest request)
        {
            try
            {
                ValidationModel validationModel = new ValidationModel();
                var             retorno         = await _recibosSrv.AddLineaRecibo(request);

                return(Ok(new ApiOkResponse("OK")));
            }
            catch (CError ce)
            {
                throw ce;
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }