Exemple #1
0
        public IActionResult Index(DataTablePostModel dataTablePostModel)
        {
            var model = db.Album.Select(q => new DataTableAlbumList
            {
                Id   = q.Id,
                Name = q.Name
            });

            var Albums = DataTableProcessor <DataTableAlbumList> .ProcessCollection(model, dataTablePostModel).ToList();

            return(View());
        }
        public IActionResult Index(DataTablePostModel dataTablePostModel)
        {
            var model = db.Album.Select(q => new DataTableAlbumList
            {
                Id   = q.Id,
                Name = q.Name
            });

            var Albums = DataTableProcessor <DataTableAlbumList> .ProcessCollection(model, dataTablePostModel).ToList();

            dynamic response = new
            {
                Data            = Albums,
                Draw            = dataTablePostModel.draw,
                RecordsFiltered = model.ToList().Count,
                RecordsTotal    = model.ToList().Count
            };

            return(StatusCode(200, response));
        }
        public IActionResult Images(DataTablePostModel dataTablePostModel, int albumId)
        {
            var model = db.albumItem.Where(q => q.AlbumId == albumId).Select(q => new DataTableAlbumItemList
            {
                Id    = q.Id,
                Image = q.Image
            });

            var Images = DataTableProcessor <DataTableAlbumItemList> .ProcessCollection(model, dataTablePostModel).ToList();

            dynamic response = new
            {
                Data            = Images,
                Draw            = dataTablePostModel.draw,
                RecordsFiltered = model.ToList().Count,
                RecordsTotal    = model.ToList().Count
            };

            return(StatusCode(200, response));
        }
Exemple #4
0
        public IActionResult Index(DataTablePostModel dataTablePostModel)
        {
            var model = db.FAQ.Select(q => new DataTableFAQList
            {
                Id = q.Id,
                Question = q.Question,
                Answer = q.Answer
            });

            var FAQs = DataTableProcessor<DataTableFAQList>.ProcessCollection(model, dataTablePostModel).ToList();

            dynamic response = new
            {
                Data = FAQs,
                Draw = dataTablePostModel.draw,
                RecordsFiltered = model.ToList().Count,
                RecordsTotal = model.ToList().Count
            };
            return StatusCode(200, response);
        }
        public IActionResult Index(DataTablePostModel dataTablePostModel)
        {
            var model = db.Slider.Select(q => new DataTableSliderList
            {
                Id          = q.Id,
                Image       = q.Image,
                ScreenOrder = q.ScreenOrder
            });

            var Sliders = DataTableProcessor <DataTableSliderList> .ProcessCollection(model, dataTablePostModel).ToList();

            dynamic response = new
            {
                Data            = Sliders,
                Draw            = dataTablePostModel.draw,
                RecordsFiltered = model.ToList().Count,
                RecordsTotal    = model.ToList().Count
            };

            return(StatusCode(200, response));
        }
Exemple #6
0
        public IActionResult Index(DataTablePostModel dataTablePostModel)
        {
            var model = db.Contact.Select(q => new DataTableContactList
            {
                Id       = q.Id,
                Sender   = q.Sender,
                Subject  = q.Subject,
                Date     = q.SendDate.ToShortDateString(),
                IsReaded = q.IsReaded
            });

            var Contacts = DataTableProcessor <DataTableContactList> .ProcessCollection(model, dataTablePostModel).ToList();

            dynamic response = new
            {
                Data            = Contacts,
                Draw            = dataTablePostModel.draw,
                RecordsFiltered = model.ToList().Count,
                RecordsTotal    = model.ToList().Count
            };

            return(StatusCode(200, response));
        }