public ActionResult GetTasks([DataSourceRequest] DataSourceRequest request, TaskDataFilter dataFilter, string viewMode)
        {
            IEnumerable <ISchedulerEvent> response;

            if (viewMode == "procedure")
            {
                var procedureCountFilter = dataFilter == null ? new ProcedureCountDataFilter() : new ProcedureCountDataFilter
                {
                    VisitDateBegin = dataFilter.VisitDateBegin,
                    VisitDateEnd   = dataFilter.VisitDateEnd
                };

                response = DataProvider.GetList(procedureCountFilter).GroupBy(t => t.VisitDate).Select(g => new ProcedureCountSchedulerEvent(g.Key, g));
            }
            else
            {
                if (dataFilter == null)
                {
                    dataFilter = new TaskDataFilter {
                        AllUsers = true
                    }
                }
                ;
                else
                {
                    dataFilter.AllUsers = true;
                }
                response = DataProvider.GetList(dataFilter).GroupBy(t => t.VisitDate).Select(g => new TaskSchedulerEvent(g.Key, g));
            }

            return(Json(response.ToDataSourceResult(request)));
        }
Esempio n. 2
0
        protected override Func <Task, bool> GetFilterFunc(DataFilter <Task> filter)
        {
            TaskDataFilter dataFilter = (TaskDataFilter)filter;

            return(e =>
                   (dataFilter.Id == null || e.Id == dataFilter.Id) &&
                   (dataFilter.VisitDateBegin == null || e.VisitDate >= dataFilter.VisitDateBegin) &&
                   (dataFilter.VisitDateEnd == null || e.VisitDate <= dataFilter.VisitDateEnd));
        }
        public ActionResult GetTasks([DataSourceRequest]DataSourceRequest request, TaskDataFilter dataFilter, string viewMode)
        {
            IEnumerable<ISchedulerEvent> response;
            if (viewMode == "procedure")
            {
                var procedureCountFilter = dataFilter == null ? new ProcedureCountDataFilter() : new ProcedureCountDataFilter
                {
                    VisitDateBegin = dataFilter.VisitDateBegin,
                    VisitDateEnd = dataFilter.VisitDateEnd
                };

                response = DataProvider.GetList(procedureCountFilter).GroupBy(t => t.VisitDate).Select(g => new ProcedureCountSchedulerEvent(g.Key, g));
            }
            else
            {
                if (dataFilter == null)
                    dataFilter = new TaskDataFilter { AllUsers = true };
                else
                    dataFilter.AllUsers = true;
                response = DataProvider.GetList(dataFilter).GroupBy(t => t.VisitDate).Select(g => new TaskSchedulerEvent(g.Key, g));
            }

            return Json(response.ToDataSourceResult(request));
        }
Esempio n. 4
0
        public ActionResult GetTasks([DataSourceRequest]DataSourceRequest request, TaskDataFilter dataFilter)
        {
            var response = DataProvider.GetList<Task>(dataFilter ?? new TaskDataFilter()).GroupBy(t => t.VisitDate).Select(g => new TaskSchedulerEvent(g.Key, g));

            return Json(response.ToDataSourceResult(request));
        }
Esempio n. 5
0
        public ActionResult GetTasks([DataSourceRequest] DataSourceRequest request, TaskDataFilter dataFilter)
        {
            var response = DataProvider.GetList <Task>(dataFilter ?? new TaskDataFilter()).GroupBy(t => t.VisitDate).Select(g => new TaskSchedulerEvent(g.Key, g));

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