Esempio n. 1
0
        public PersonStats GetPersonStats(int user_id)
        {
            OfferQuery offerQuery = new OfferQuery(language);

            System.Data.DataTable dataTable = new System.Data.DataTable();
            dataTable = conn_db.ReadTable(offerQuery.GetPersonOfferCount(user_id));

            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }


            PersonStats personStats = new PersonStats();

            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                personStats.AvailableOffers = Convert.ToInt32(row[0]);
            }
            return(personStats);
        }