Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <SeoWebSite.Model.odds_bz> DataTableToList(DataTable dt)
        {
            List <SeoWebSite.Model.odds_bz> modelList = new List <SeoWebSite.Model.odds_bz>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                SeoWebSite.Model.odds_bz model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SeoWebSite.Model.odds_bz();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    if (dt.Rows[n]["companyID"].ToString() != "")
                    {
                        model.companyID = int.Parse(dt.Rows[n]["companyID"].ToString());
                    }
                    if (dt.Rows[n]["scheduleID"].ToString() != "")
                    {
                        model.scheduleID = int.Parse(dt.Rows[n]["scheduleID"].ToString());
                    }
                    if (dt.Rows[n]["home"].ToString() != "")
                    {
                        model.home = decimal.Parse(dt.Rows[n]["home"].ToString());
                    }
                    if (dt.Rows[n]["draw"].ToString() != "")
                    {
                        model.draw = decimal.Parse(dt.Rows[n]["draw"].ToString());
                    }
                    if (dt.Rows[n]["away"].ToString() != "")
                    {
                        model.away = decimal.Parse(dt.Rows[n]["away"].ToString());
                    }
                    if (dt.Rows[n]["time"].ToString() != "")
                    {
                        model.time = DateTime.Parse(dt.Rows[n]["time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<SeoWebSite.Model.odds_bz> DataTableToList(DataTable dt)
 {
     List<SeoWebSite.Model.odds_bz> modelList = new List<SeoWebSite.Model.odds_bz>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         SeoWebSite.Model.odds_bz model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new SeoWebSite.Model.odds_bz();
             if(dt.Rows[n]["id"].ToString()!="")
             {
                 model.id=int.Parse(dt.Rows[n]["id"].ToString());
             }
             if(dt.Rows[n]["companyID"].ToString()!="")
             {
                 model.companyID=int.Parse(dt.Rows[n]["companyID"].ToString());
             }
             if(dt.Rows[n]["scheduleID"].ToString()!="")
             {
                 model.scheduleID=int.Parse(dt.Rows[n]["scheduleID"].ToString());
             }
             if(dt.Rows[n]["home"].ToString()!="")
             {
                 model.home=decimal.Parse(dt.Rows[n]["home"].ToString());
             }
             if(dt.Rows[n]["draw"].ToString()!="")
             {
                 model.draw=decimal.Parse(dt.Rows[n]["draw"].ToString());
             }
             if(dt.Rows[n]["away"].ToString()!="")
             {
                 model.away=decimal.Parse(dt.Rows[n]["away"].ToString());
             }
             if(dt.Rows[n]["time"].ToString()!="")
             {
                 model.time=DateTime.Parse(dt.Rows[n]["time"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SeoWebSite.Model.odds_bz model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(SeoWebSite.Model.odds_bz model)
 {
     return(dal.Add(model));
 }