예제 #1
0
        public List <DataTable2> GetMaxScoreArea()
        {
            var getData     = DataTable2Collection.Find(it => true).ToList().OrderBy(it => it.IDProvince).OrderBy(it => it.LocationCode.Substring(0, 2));
            var groupByArea = getData.GroupBy(it => it.NameArea).ToList();
            var listMax     = new List <DataTable2>();

            foreach (var item in groupByArea)
            {
                var getMaxScore = item.FirstOrDefault(it => it.Score == item.Max(i => i.Score));
                listMax.Add(getMaxScore);
            }
            return(listMax);
        }
예제 #2
0
        public List <DataTable2> GetAllTable2()
        {
            var getData = DataTable2Collection.Find(it => true).ToList();

            return(getData);
        }
예제 #3
0
        public List <DataTable2> FilterTagTable2(string tag)
        {
            var getData = DataTable2Collection.Find(it => it.NameParty == "เพื่อไทย" && it.Tag == tag).ToList();

            return(getData);
        }
예제 #4
0
 public List <DataTable2> getArea(string nameArea)
 {
     return(DataTable2Collection.Find(it => it.NameArea == nameArea).ToList());
 }