Beispiel #1
0
        public static void UpdateRankList(List<PDFScanAndSort.Models.Application> apps, List<Card> cards)
        {
            Ranker ranker = new Ranker(apps, cards);
            
            ranker.RankCards();

            var grpApps = ranker.RanksList
          .GroupBy(u => u.Page)
          .Select(grp => grp.ToList())
          .ToList();

            foreach (var item in grpApps)
            {
                var grpPage = item
                   .GroupBy(u => u.card)
                   .Select(grp => grp.ToList())
                   .ToList();

                Card winningCard = null;
                int winningGrpnum = 0;
                int currentwinningGrpnum = 0;

                foreach (var grpItem in grpPage)
                {
                    currentwinningGrpnum = grpItem.Count;

                    if (winningGrpnum < currentwinningGrpnum)
                    {
                        winningGrpnum = currentwinningGrpnum;
                        winningCard = grpItem[0].card;
                    }

                }

                if (winningCard != null)
                {
                    GridHelper.SwapCards(item[0].Page.Card, winningCard);
                }
            }

        }
Beispiel #2
0
        public static void RankCards(Form1 form)
        {

            Ranker ranker = new Ranker(form.applications, form.cards);

            ranker.RankCards();

            var grpApps = ranker.RanksList
          .GroupBy(u => u.Page)
          .Select(grp => grp.ToList())
          .ToList();

            foreach (var item in grpApps)
            {
                var grpPage = item
                   .GroupBy(u => u.card)
                   .Select(grp => grp.ToList())
                   .ToList();

                Card winningCard = null;
                int winningGrpnum = 0;
                int currentwinningGrpnum = 0;

                foreach (var grpItem in grpPage)
                {
                    currentwinningGrpnum = grpItem.Count;

                    if (winningGrpnum < currentwinningGrpnum)
                    {
                        winningGrpnum = currentwinningGrpnum;
                        winningCard = grpItem[0].card;
                    }

                }

                if (winningCard != null)
                {
                    GridHelper.SwapCards(item[0].Page.Card, winningCard);
                }

            }


        }
Beispiel #3
0
        private void cardSort()
        {
            Ranker ranker = new Ranker(this.applications, this.cards);

            ranker.RankCards();

            var grpApps = ranker.RanksList
          .GroupBy(u => u.card,
          u=> u.Page)
          .Select(grp => grp.ToList())
          .ToList();

            var grpApps3 = ranker.RanksList
            .GroupBy(u => u.card)
            .Select(grp => grp.ToList())
            .ToList();


            var grpApps2 = ranker.RanksList
          .GroupBy(u => u.Page)
          .Select(grp => grp.ToList())
          .ToList();





            foreach (var item in grpApps3)
            {
                var grpPage = item
                   .GroupBy(u => u.Page)
                   .Select(grp => grp.ToList())
                   .ToList();

                Card winningCard = null;
                int winningGrpnum = 0;
                int currentwinningGrpnum = 0;

                foreach (var grpItem in grpPage)
                {
                    currentwinningGrpnum = grpItem.Count;

                    if (winningGrpnum < currentwinningGrpnum)
                    {
                        winningGrpnum = currentwinningGrpnum;
                        winningCard = grpItem[0].card;

                        if (winningCard != null)
                        {
                            GridHelper.SwapCards(item[0].Page.Card, winningCard);
                        }
                    }

                }



            }
        }