Esempio n. 1
0
        public Dictionary <string, int> GetVoteDic()
        {
            string sql = "select bNo,count(id) as t from t_active_vote group by bNo order by t desc";
            Dictionary <string, int> Dic = new Dictionary <string, int>();

            try
            {
                using (DataTable dt = helper.GetDataTable(sql))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow r in dt.Rows)
                        {
                            VotePm u = new VotePm()
                            {
                                bNo = r["bNo"].ToString(),
                                num = Convert.ToInt32(r["t"])
                            };
                            if (!Dic.ContainsKey(u.bNo))
                            {
                                Dic.Add(u.bNo, u.num);
                            }
                        }
                    }
                }
            }
            catch { }
            return(Dic);
        }
Esempio n. 2
0
        public List <VotePm> GetVotePm()
        {
            string        sql = "select bNo,count(id) as t from t_active_vote group by bNo order by t desc";
            List <VotePm> lu  = new List <VotePm>();

            try
            {
                using (DataTable dt = helper.GetDataTable(sql))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow r in dt.Rows)
                        {
                            VotePm u = new VotePm()
                            {
                                bNo = r["bNo"].ToString(),
                                num = Convert.ToInt32(r["t"])
                            };
                            lu.Add(u);
                        }
                    }
                }
            }
            catch { }
            return(lu);
        }