/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.FinanceSet> DataTableToList(DataTable dt) { List <Hownet.Model.FinanceSet> modelList = new List <Hownet.Model.FinanceSet>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.FinanceSet model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.FinanceSet(); if (dt.Rows[n]["A"].ToString() != "") { model.A = int.Parse(dt.Rows[n]["A"].ToString()); } if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["Levels"].ToString() != "") { model.Levels = int.Parse(dt.Rows[n]["Levels"].ToString()); } if (dt.Rows[n]["Lengths"].ToString() != "") { model.Lengths = int.Parse(dt.Rows[n]["Lengths"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hownet.Model.FinanceSet model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.FinanceSet model) { return(dal.Add(model)); }