Esempio n. 1
0
        public resultsTally evaluateTopBooks()
        {
            SQLFunctions conn = new SQLFunctions();

            List <resultsTally> lrt = conn.getNumberOneBook();
            resultsTally        rt;


            int book1 = lrt[0].numberVotes;
            int book2 = lrt[1].numberVotes;

            if (book1 > book2)
            {
                return(lrt[0]);
            }
            else if (book1 == book2)
            {
                rt         = new resultsTally();
                rt.book_id = -2;
                return(rt);
            }
            {
                rt         = new resultsTally();
                rt.book_id = -1;
                return(rt);
            }
        }
Esempio n. 2
0
        public List <resultsTally> returnTiedTopBooks()
        {
            SQLFunctions conn = new SQLFunctions();

            List <resultsTally> lrt     = conn.getNumberOneBook();
            List <resultsTally> lrtally = new List <resultsTally>();


            int book1 = lrt[0].numberVotes;
            int book2 = lrt[1].numberVotes;

            lrtally.Add(lrt[0]);
            lrtally.Add(lrt[1]);
            return(lrtally);
        }