Пример #1
0
        //protected List<resultsTally> evaluateTopBookPlurality()
        //{
        //    SQLFunctions conn = new SQLFunctions();
        //    int X = -1;
        //    List<resultsTally> lrtresult = new List<resultsTally>();

        //    List<resultsTally> lrt = conn.getNumberOnePlurality();
        //    foreach (resultsTally rt in lrt)
        //    {
        //        // Check for a tie
        //        if (rt.numberVotes == 3)
        //        {

        //        }


        //        if (X > -1)
        //        {
        //            if (X == rt.numberVotes)
        //            {
        //                lrtresult.Add(rt);
        //            }
        //        } else
        //        {
        //            X = rt.numberVotes;
        //            lrtresult.Add(rt);
        //        }
        //    }

        //    return lrt;
        //}

        protected resultsTally evaluateBottomBooks()
        {
            SQLFunctions conn = new SQLFunctions();

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


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

            if (book1 > book2)
            {
                return(lrt[0]);
            }
            else
            {
                rt         = new resultsTally();
                rt.book_id = -1;
                return(rt);
            }
        }