/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.Budget_Apply_History> DataTableToList(DataTable dt) { List <Dianda.Model.Budget_Apply_History> modelList = new List <Dianda.Model.Budget_Apply_History>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.Budget_Apply_History model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.Budget_Apply_History(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["BudgetID"].ToString() != "") { model.BudgetID = int.Parse(dt.Rows[n]["BudgetID"].ToString()); } model.ControlInfo = dt.Rows[n]["ControlInfo"].ToString(); if (dt.Rows[n]["Balance"].ToString() != "") { model.Balance = decimal.Parse(dt.Rows[n]["Balance"].ToString()); } if (dt.Rows[n]["DATETIME"].ToString() != "") { model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString()); } model.DoUser = dt.Rows[n]["DoUser"].ToString(); model.DoType = dt.Rows[n]["DoType"].ToString(); model.NOTES = dt.Rows[n]["NOTES"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.Budget_Apply_History model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Dianda.Model.Budget_Apply_History model) { return(dal.Add(model)); }