/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.CompanyLog model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.CompanyLog model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.CompanyLog> DataTableToList(DataTable dt) { List <Hownet.Model.CompanyLog> modelList = new List <Hownet.Model.CompanyLog>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.CompanyLog model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.CompanyLog(); 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]["DateTime"].ToString() != "") { model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString()); } if (dt.Rows[n]["LastMoney"].ToString() != "") { model.LastMoney = decimal.Parse(dt.Rows[n]["LastMoney"].ToString()); } if (dt.Rows[n]["ChangMoney"].ToString() != "") { model.ChangMoney = decimal.Parse(dt.Rows[n]["ChangMoney"].ToString()); } if (dt.Rows[n]["Money"].ToString() != "") { model.Money = decimal.Parse(dt.Rows[n]["Money"].ToString()); } if (dt.Rows[n]["TypeID"].ToString() != "") { model.TypeID = int.Parse(dt.Rows[n]["TypeID"].ToString()); } if (dt.Rows[n]["TableID"].ToString() != "") { model.TableID = int.Parse(dt.Rows[n]["TableID"].ToString()); } if (dt.Rows[n]["NowMoneyTypeID"].ToString() != "") { model.NowMoneyTypeID = int.Parse(dt.Rows[n]["NowMoneyTypeID"].ToString()); } if (dt.Rows[n]["NowMoney"].ToString() != "") { model.NowMoney = decimal.Parse(dt.Rows[n]["NowMoney"].ToString()); } if (dt.Rows[n]["NowReta"].ToString() != "") { model.NowReta = decimal.Parse(dt.Rows[n]["NowReta"].ToString()); } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }