Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <SeoWebSite.Model.BetUser> DataTableToList(DataTable dt)
        {
            List <SeoWebSite.Model.BetUser> modelList = new List <SeoWebSite.Model.BetUser>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                SeoWebSite.Model.BetUser model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new SeoWebSite.Model.BetUser();
                    model.id       = dt.Rows[n]["id"].ToString();
                    model.username = dt.Rows[n]["username"].ToString();
                    model.password = dt.Rows[n]["password"].ToString();
                    model.truename = dt.Rows[n]["truename"].ToString();
                    if (dt.Rows[n]["age"].ToString() != "")
                    {
                        model.age = int.Parse(dt.Rows[n]["age"].ToString());
                    }
                    model.sex    = dt.Rows[n]["sex"].ToString();
                    model.qq     = dt.Rows[n]["qq"].ToString();
                    model.mobile = dt.Rows[n]["mobile"].ToString();
                    model.email  = dt.Rows[n]["email"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<SeoWebSite.Model.BetUser> DataTableToList(DataTable dt)
 {
     List<SeoWebSite.Model.BetUser> modelList = new List<SeoWebSite.Model.BetUser>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         SeoWebSite.Model.BetUser model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new SeoWebSite.Model.BetUser();
             model.id=dt.Rows[n]["id"].ToString();
             model.username=dt.Rows[n]["username"].ToString();
             model.password=dt.Rows[n]["password"].ToString();
             model.truename=dt.Rows[n]["truename"].ToString();
             if(dt.Rows[n]["age"].ToString()!="")
             {
                 model.age=int.Parse(dt.Rows[n]["age"].ToString());
             }
             model.sex=dt.Rows[n]["sex"].ToString();
             model.qq=dt.Rows[n]["qq"].ToString();
             model.mobile=dt.Rows[n]["mobile"].ToString();
             model.email=dt.Rows[n]["email"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Пример #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(SeoWebSite.Model.BetUser model)
 {
     dal.Update(model);
 }
Пример #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(SeoWebSite.Model.BetUser model)
 {
     dal.Add(model);
 }