Ejemplo n.º 1
0
        private Hashtable GetLotteryNum(HttpContext context)
        {
            Hashtable htRet   = new Hashtable();
            Hashtable rowData = new Hashtable();

            try
            {
                string UserId = (context.Request["UserId"]).ToString();

                DBIndex dbm = new DBIndex();
                DataSet ds  = dbm.GetLotteryNum(UserId);   //获取抽奖次数
                if (ds.Tables[0].Rows.Count == 0)
                {
                    htRet["ok"]  = true;
                    htRet["cnt"] = 0;
                    htRet["msg"] = "无数据";
                }
                else
                {
                    ArrayList lst = new ArrayList();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        Hashtable htItem = new Hashtable();

                        htItem["LotteryNum"] = (dr["lotteryNum"]).ToString();

                        lst.Add(htItem);
                    }
                    htRet["ok"]  = true;
                    htRet["lst"] = lst;
                }
            }
            catch (Exception e)
            {
                htRet["ok"]  = false;
                htRet["msg"] = "获取轮番信息失败!" + e.Message;
            }

            return(htRet);
        }