コード例 #1
0
        public ActionResult Index()
        {
            try
            {
                if (ProjectSession.Hospital == null)
                {
                    throw new Exception("Something went wrong");
                }

                var list = _service.GetAllTestimonials();
                return(View(list));
            }
            catch (Exception e)
            {
                Logger.log.Error($"Controller: {nameof(TestimonialController)} , Action: {nameof(Index)}. Error: {e.Message}");
                return(View("Error"));
            }
        }
コード例 #2
0
        public ActionResult KendoRead([DataSourceRequest] DataSourceRequest request)
        {
            if (!request.Sorts.Any())
            {
                request.Sorts.Add(new SortDescriptor("Name", ListSortDirection.Ascending));
            }

            var testimonials = _testimonialsService.GetAllTestimonials();

            return(Json(testimonials.ToDataSourceResult(request)));
        }