Ejemplo n.º 1
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_data.Employees, loadOptions));
 }
Ejemplo n.º 2
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_db.Exams, loadOptions));
 }
Ejemplo n.º 3
0
 public object GetSubjectExam(DataSourceLoadOptions loadOptions, Guid id)
 {
     return(DataSourceLoader.Load(_db.Exams.Where(m => m.SubjectId == id), loadOptions));
 }
Ejemplo n.º 4
0
        public object load(DataSourceLoadOptions options)
        {
            var query = this.dataContext.dicts;

            return(DataSourceLoader.Load(query, options));
        }
Ejemplo n.º 5
0
        public object load(DataSourceLoadOptions options)
        {
            var query = from b in this.dataContext.honors orderby b.publishAt descending select b;

            return(DataSourceLoader.Load(query, options));
        }
        public IActionResult Get_Material_m_Resource(DataSourceLoadOptions loadOptions)
        {
            var mt = _context.m_Resource.Where(w => w.ItemType == "R").Distinct();

            return(Json(DataSourceLoader.Load(mt, loadOptions)));
        }
Ejemplo n.º 7
0
 public object loadActiveProductTags([FromQuery] DataSourceLoadOptions options)
 {
     options.Filter.Add(new String[] { "and" });
     options.Filter.Add(new object[] { "status", "=", 1 });
     return(DataSourceLoader.Load(this.db.productTags, options));
 }
Ejemplo n.º 8
0
        public ActionResult Employees(DataSourceLoadOptions loadOptions)
        {
            var serializedEmployees = JsonConvert.SerializeObject(DataSourceLoader.Load(TreeViewHierarchicalData.Employees, loadOptions));

            return(Content(serializedEmployees, "application/json"));
        }
Ejemplo n.º 9
0
 public ActionResult GetHierarchicalDataForSearch(DataSourceLoadOptions loadOptions)
 {
     return(Content(JsonConvert.SerializeObject(DataSourceLoader.Load(TreeViewHierarchicalDataForSearch.Products, loadOptions)), "application/json"));
 }
Ejemplo n.º 10
0
 public HttpResponseMessage Get(DataSourceLoadOptions loadOptions)
 {
     return(Request.CreateResponse(DataSourceLoader.Load(SampleData.Orders.Where(o => o.ID != 14 && o.ID <= 32), loadOptions)));
 }
Ejemplo n.º 11
0
 public HttpResponseMessage Get(DataSourceLoadOptions loadOptions)
 {
     return(Request.CreateResponse(DataSourceLoader.Load(SampleData.DataGridEmployees.Where(e => e.ID <= 10), loadOptions)));
 }
Ejemplo n.º 12
0
 public LoadResult GetDevextremeList(DevxLoadOptions options)
 => DataSourceLoader.Load(_context.GroupTeachers, options);
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(SampleData.WorldPopulationData, loadOptions));
 }
Ejemplo n.º 14
0
 public HttpResponseMessage GetResoucer(DataSourceLoadOptions loadOptions)
 {
     return(Request.CreateResponse(DataSourceLoader.Load(AgendaResource.AgendaResources.ToList(), loadOptions)));
 }
Ejemplo n.º 15
0
        public IActionResult Get_m_Processmaster(DataSourceLoadOptions loadOptions)
        {
            var pm = _context.m_ProcessMaster.Where(w => w.SysemProcessFLag == "Y");

            return(Json(DataSourceLoader.Load(pm, loadOptions)));
        }
Ejemplo n.º 16
0
 public ActionResult GetPlainDataForDragAndDrop(DataSourceLoadOptions loadOptions)
 {
     return(Content(JsonConvert.SerializeObject(DataSourceLoader.Load(TreeViewPlainDataForDragAndDrop.FileSystemItems, loadOptions)), "application/json"));
 }
Ejemplo n.º 17
0
        public IActionResult Get_FCode_WeeklyPlan(DataSourceLoadOptions loadOptions)
        {
            var fc = _context.WeeklyPlan.Select(s => new { s.Fcode, s.Model }).Distinct();

            return(Json(DataSourceLoader.Load(fc, loadOptions)));
        }
Ejemplo n.º 18
0
        public object GetUserExam(DataSourceLoadOptions loadOptions)
        {
            var userExam = _db.UserExams.Where(u => u.UserId == CurrentUserId);

            return(DataSourceLoader.Load(userExam, loadOptions));
        }
Ejemplo n.º 19
0
 public object load([FromQuery] DataSourceLoadOptions options)
 {
     return(DataSourceLoader.Load(this.db.productTags, options));
 }
Ejemplo n.º 20
0
 public object Get([FromBody] DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(SampleData.GetStates(), loadOptions));
 }
 public HttpResponseMessage Gets(DataSourceLoadOptions loadOptions)
 {
     return(Request.CreateResponse(DataSourceLoader.Load(_councilTypeBLL.GetCouncilTypes(), loadOptions)));
 }
 public object GetList(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_context.Employees, loadOptions));
 }
        public void GroupingAndSummary()
        {
            /*
             *
             *  G1=1
             *      G2=1
             *          A=1 B=1
             *          A=2 B=3
             *
             *          count=2 sum(A)=3 avg(A)=1.5
             *
             *      G2=2
             *          A=3 B=5
             *
             *          count=1 sum(A)=3 avg(A)=3
             *
             *      count=3 sum(A)=6 avg(A)=2
             *
             *  G2=2
             *      G1=1
             *          A=4 B=7
             *          A=5 B=9
             *
             *          count=2 sum(A)=9 avg(A)=4.5
             *
             *      G1=2
             *          A=6 B=11
             *
             *          count=1 sum(A)=6 avg(A)=6
             *
             *      count=3 sum(A)=15, avg(A)=5
             *
             *  count=6 sum(B)=36 avg(B)=6
             *
             *
             */


            var data = new[] {
                new { G1 = 1, G2 = 1, A = 1, B = 1 },
                new { G1 = 1, G2 = 1, A = 2, B = 3 },
                new { G1 = 1, G2 = 2, A = 3, B = 5 },
                new { G1 = 2, G2 = 1, A = 4, B = 7 },
                new { G1 = 2, G2 = 1, A = 5, B = 9 },
                new { G1 = 2, G2 = 2, A = 6, B = 11 },
            };

            var loadOptions = new SampleLoadOptions {
                RemoteGrouping    = true,
                RequireTotalCount = true,
                Group             = new[] {
                    new GroupingInfo {
                        Selector = "G1", IsExpanded = false
                    },
                    new GroupingInfo {
                        Selector = "G2", IsExpanded = false
                    }
                },
                GroupSummary = new[] {
                    new SummaryInfo {
                        SummaryType = "count"
                    },
                    new SummaryInfo {
                        Selector = "A", SummaryType = "sum"
                    },
                    new SummaryInfo {
                        Selector = "A", SummaryType = "avg"
                    }
                },
                TotalSummary = new[] {
                    new SummaryInfo {
                        SummaryType = "count"
                    },
                    new SummaryInfo {
                        Selector = "B", SummaryType = "sum"
                    },
                    new SummaryInfo {
                        Selector = "B", SummaryType = "avg"
                    },
                }
            };

            var result = DataSourceLoader.Load(data, loadOptions);

            Assert.Single(loadOptions.ExpressionLog);
            Assert.Matches(@"AnonType`2\(I0 = .+?, I1 = .+?\)", loadOptions.ExpressionLog[0]);

            Assert.Equal(new object[] { 6, 36M, 6M }, result.summary);
            Assert.Equal(6, result.totalCount);
            Assert.Equal(-1, result.groupCount);

            var groups = result.data.Cast <Group>().ToArray();

            var g1  = groups[0];
            var g2  = groups[1];
            var g11 = g1.items[0] as Group;
            var g12 = g1.items[1] as Group;
            var g21 = g2.items[0] as Group;
            var g22 = g2.items[1] as Group;

            Assert.Equal(1, g1.key);
            Assert.Equal(1, g11.key);
            Assert.Equal(2, g12.key);
            Assert.Equal(2, g2.key);
            Assert.Equal(1, g21.key);
            Assert.Equal(2, g22.key);

            Assert.Equal(new object[] { 3, 6M, 2M }, g1.summary);
            Assert.Equal(new object[] { 2, 3M, 1.5M }, g11.summary);
            Assert.Equal(new object[] { 1, 3M, 3M }, g12.summary);
            Assert.Equal(new object[] { 3, 15M, 5M }, g2.summary);
            Assert.Equal(new object[] { 2, 9M, 4.5M }, g21.summary);
            Assert.Equal(new object[] { 1, 6M, 6M }, g22.summary);

            Assert.Equal(2, g11.count);
            Assert.Equal(1, g12.count);
            Assert.Equal(2, g21.count);
            Assert.Equal(1, g22.count);

            Assert.Null(g11.items);
            Assert.Null(g12.items);
            Assert.Null(g21.items);
            Assert.Null(g22.items);
        }
Ejemplo n.º 24
0
 public object GetChoice(DataSourceLoadOptions loadOptions, Guid id)
 {
     return(DataSourceLoader.Load(_db.Choices.Where(u => u.QuestionId == id), loadOptions));
 }
Ejemplo n.º 25
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(SampleData.Orders, loadOptions));
 }
Ejemplo n.º 26
0
 public object GetExamQuestion(DataSourceLoadOptions loadOptions, Guid id)
 {
     return(DataSourceLoader.Load(_db.UserExamQuestions.Where(m => m.UserExam.ExamId == id), loadOptions));
 }
Ejemplo n.º 27
0
 public object GetSubject(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_db.Subjects, loadOptions));
 }
Ejemplo n.º 28
0
 public object GetCompanies(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(TabPanelData.Companies, loadOptions));
 }
Ejemplo n.º 29
0
 public object GetQuestionExam(DataSourceLoadOptions loadOptions, Guid id)
 {
     return(DataSourceLoader.Load(_db.QuestionExams.Where(m => m.QuestionId == id), loadOptions));
 }
Ejemplo n.º 30
0
 public HttpResponseMessage Get(DataSourceLoadOptions loadOptions, int?id)
 {
     db.PlanGrupoId = SysData.ToInteger(id);
     return(Request.CreateResponse(DataSourceLoader.Load(db.PlanGrupoDetList, loadOptions)));
 }