예제 #1
0
        public IActionResult Listar(DataTableModel <OpcionFilterDto> dataTableModel)
        {
            var jsonResponse = new JsonResponseDto()
            {
                Type = Constante.Error
            };

            try
            {
                FormatDataTable(dataTableModel);
                var jsonResponseDto = new JsonResponseDto()
                {
                    Type = Constante.Error
                };

                var paginationParameter = new PaginationParameter
                {
                    Start       = dataTableModel.start,
                    AmountRows  = dataTableModel.length,
                    WhereFilter = dataTableModel.whereFilter,
                    OrderBy     = dataTableModel.orderBy
                };

                List <OpcionPaginationDto> lstCampania = _Opcion.PaginadoOpcion(paginationParameter);
                dataTableModel.data = lstCampania;
                if (lstCampania.Count > 0)
                {
                    dataTableModel.recordsTotal    = lstCampania[0].Cantidad;
                    dataTableModel.recordsFiltered = dataTableModel.recordsTotal;
                }
            }


            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                jsonResponse.Mensaje = ex.Message;
            }
            return(Json(dataTableModel));
        }