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

            if (rowsCount > 0)
            {
                SeoWebSite.Model.odds_dx model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SeoWebSite.Model.odds_dx();
                    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]["pankou"].ToString() != "")
                    {
                        model.pankou = decimal.Parse(dt.Rows[n]["pankou"].ToString());
                    }
                    if (dt.Rows[n]["big"].ToString() != "")
                    {
                        model.big = decimal.Parse(dt.Rows[n]["big"].ToString());
                    }
                    if (dt.Rows[n]["small"].ToString() != "")
                    {
                        model.small = decimal.Parse(dt.Rows[n]["small"].ToString());
                    }
                    if (dt.Rows[n]["time"].ToString() != "")
                    {
                        model.time = DateTime.Parse(dt.Rows[n]["time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<SeoWebSite.Model.odds_dx> DataTableToList(DataTable dt)
 {
     List<SeoWebSite.Model.odds_dx> modelList = new List<SeoWebSite.Model.odds_dx>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         SeoWebSite.Model.odds_dx model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new SeoWebSite.Model.odds_dx();
             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]["pankou"].ToString()!="")
             {
                 model.pankou=decimal.Parse(dt.Rows[n]["pankou"].ToString());
             }
             if(dt.Rows[n]["big"].ToString()!="")
             {
                 model.big=decimal.Parse(dt.Rows[n]["big"].ToString());
             }
             if(dt.Rows[n]["small"].ToString()!="")
             {
                 model.small=decimal.Parse(dt.Rows[n]["small"].ToString());
             }
             if(dt.Rows[n]["time"].ToString()!="")
             {
                 model.time=DateTime.Parse(dt.Rows[n]["time"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SeoWebSite.Model.odds_dx model)
 {
     return(dal.Update(model));
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(SeoWebSite.Model.odds_dx model)
 {
     return(dal.Add(model));
 }