/// <summary> /// 获得数据列表 /// </summary> public List <lgk.Model.gp_BusinessAmount> DataTableToList(DataTable dt) { List <lgk.Model.gp_BusinessAmount> modelList = new List <lgk.Model.gp_BusinessAmount>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { lgk.Model.gp_BusinessAmount model; for (int n = 0; n < rowsCount; n++) { model = new lgk.Model.gp_BusinessAmount(); if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "") { model.ID = long.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["BusinessTime"] != null && dt.Rows[n]["BusinessTime"].ToString() != "") { model.BusinessTime = DateTime.Parse(dt.Rows[n]["BusinessTime"].ToString()); } if (dt.Rows[n]["BusinessAmount"] != null && dt.Rows[n]["BusinessAmount"].ToString() != "") { model.BusinessAmount = decimal.Parse(dt.Rows[n]["BusinessAmount"].ToString()); } if (dt.Rows[n]["by01"] != null && dt.Rows[n]["by01"].ToString() != "") { model.by01 = int.Parse(dt.Rows[n]["by01"].ToString()); } if (dt.Rows[n]["by02"] != null && dt.Rows[n]["by02"].ToString() != "") { model.by02 = decimal.Parse(dt.Rows[n]["by02"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(lgk.Model.gp_BusinessAmount model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public long Add(lgk.Model.gp_BusinessAmount model) { return(dal.Add(model)); }