コード例 #1
0
        //Get List Of Appointment Using Pagination in Stored Procedure
        public IActionResult Index(DataSourceRequest command)
        {
            ViewBag.FormName = "Appointments";
            var model = new AppointmentListModel();

            try
            {
                ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString());
                var PagedList = _reportService.GetAllAppointment(
                    keywords: "",
                    page_num: command.Page,
                    page_size: command.PageSize == 0 ? 10 : command.PageSize,
                    GetAll: command.PageSize == 0 ? true : false);

                //pratiksha get hospital name in Decrypt format 28/nov/2019
                PagedList  = PagedList.Select(a => { a.HospitalName = _encryptionService.DecryptText(a.HospitalName); return(a); }).ToList();
                model.List = PagedList.GetPaged(command.Page, command.PageSize, ((PagedList.Count() != 0)?PagedList[0].TotalRecords:0));
                return(View(model));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(View(model));
            }
        }
コード例 #2
0
        public ActionResult AppointmentList(AppointmentListModel model)
        {
            var appointments = _appointmentService.GetAllAppointments(
                name: model.SearchName,
                pageIndex: model.PageIndex,
                pageSize: model.PageSize);

            return(Json(new
            {
                draw = model.Draw,
                recordsFiltered = 0,
                recordsTotal = appointments.TotalCount,
                data = appointments
            }));
        }