Ejemplo n.º 1
0
        public async Task <GetResponse <IRemunerationPayroll> > GetAsync(RemunerationRequest request)
        {
            var response = new GetResponse <IRemunerationPayroll>();

            try
            {
                using (var connection = ConnectionFactory.GetConnection())
                {
                    var sql = $@"{GetSummarySelectStatement()} AND [State] = @state";

                    var results = await connection.QuerySingleAsync <RemunerationPayrollDto>(sql, new { State = request.State });

                    response.Content = results.ToModel();
                }
            }
            catch (Exception e)
            {
                var messaage = $@"Unable to retrieve remuneration records.";
                response.AddError(e);
                LogManager.LogError(e, messaage);
                Console.WriteLine(e);
            }

            return(response);
        }
Ejemplo n.º 2
0
        public async Task <GetResponse <IReadOnlyList <IRemunerationSales> > > GetAllAsync(RemunerationRequest request)
        {
            var getResponse = new GetResponse <IReadOnlyList <IRemunerationSales> >();

            try
            {
                getResponse = await _remunerationSalesRepository.GetAllAsync(request);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                getResponse.AddError(ex);
                _logManager.LogError(ex, "Error retrieving remunerationSaless");
            }

            return(getResponse);
        }