/// <summary> /// 获得数据列表 /// </summary> public List <SeoWebSite.Model.odds_rq> DataTableToList(DataTable dt) { List <SeoWebSite.Model.odds_rq> modelList = new List <SeoWebSite.Model.odds_rq>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { SeoWebSite.Model.odds_rq model; for (int n = 0; n < rowsCount; n++) { model = new SeoWebSite.Model.odds_rq(); 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]["home"].ToString() != "") { model.home = decimal.Parse(dt.Rows[n]["home"].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); }
/// <summary> /// ��������б� /// </summary> public List<SeoWebSite.Model.odds_rq> DataTableToList(DataTable dt) { List<SeoWebSite.Model.odds_rq> modelList = new List<SeoWebSite.Model.odds_rq>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { SeoWebSite.Model.odds_rq model; for (int n = 0; n < rowsCount; n++) { model = new SeoWebSite.Model.odds_rq(); 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]["home"].ToString()!="") { model.home=decimal.Parse(dt.Rows[n]["home"].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; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(SeoWebSite.Model.odds_rq model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(SeoWebSite.Model.odds_rq model) { return(dal.Add(model)); }