/// <summary> /// ��������б� /// </summary> public List<SeoWebSite.Model.BettingLine> DataTableToList(DataTable dt) { List<SeoWebSite.Model.BettingLine> modelList = new List<SeoWebSite.Model.BettingLine>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { SeoWebSite.Model.BettingLine model; for (int n = 0; n < rowsCount; n++) { model = new SeoWebSite.Model.BettingLine(); model.id=dt.Rows[n]["id"].ToString(); if(dt.Rows[n]["betmoney"].ToString()!="") { model.betmoney=decimal.Parse(dt.Rows[n]["betmoney"].ToString()); } if(dt.Rows[n]["returnmoney"].ToString()!="") { model.returnmoney=decimal.Parse(dt.Rows[n]["returnmoney"].ToString()); } if(dt.Rows[n]["profit"].ToString()!="") { model.profit=decimal.Parse(dt.Rows[n]["profit"].ToString()); } model.state=dt.Rows[n]["state"].ToString(); model.formulaid=dt.Rows[n]["formulaid"].ToString(); model.userid=dt.Rows[n]["userid"].ToString(); modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <SeoWebSite.Model.BettingLine> DataTableToList(DataTable dt) { List <SeoWebSite.Model.BettingLine> modelList = new List <SeoWebSite.Model.BettingLine>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { SeoWebSite.Model.BettingLine model; for (int n = 0; n < rowsCount; n++) { model = new SeoWebSite.Model.BettingLine(); model.id = dt.Rows[n]["id"].ToString(); if (dt.Rows[n]["betmoney"].ToString() != "") { model.betmoney = decimal.Parse(dt.Rows[n]["betmoney"].ToString()); } if (dt.Rows[n]["returnmoney"].ToString() != "") { model.returnmoney = decimal.Parse(dt.Rows[n]["returnmoney"].ToString()); } if (dt.Rows[n]["profit"].ToString() != "") { model.profit = decimal.Parse(dt.Rows[n]["profit"].ToString()); } model.state = dt.Rows[n]["state"].ToString(); model.formulaid = dt.Rows[n]["formulaid"].ToString(); model.userid = dt.Rows[n]["userid"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(SeoWebSite.Model.BettingLine model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(SeoWebSite.Model.BettingLine model) { dal.Add(model); }