/// <summary> /// 获得数据列表 /// </summary> public List <DTcms.Model.StoreInGoods> DataTableToList(DataTable dt) { List <DTcms.Model.StoreInGoods> modelList = new List <DTcms.Model.StoreInGoods>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.StoreInGoods model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.StoreInGoods(); if (dt.Rows[n]["StoreInOrderId"].ToString() != "") { model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString()); } if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } if (dt.Rows[n]["StoreId"].ToString() != "") { model.StoreId = int.Parse(dt.Rows[n]["StoreId"].ToString()); } if (dt.Rows[n]["StoreModeId"].ToString() != "") { model.StoreModeId = int.Parse(dt.Rows[n]["StoreModeId"].ToString()); } if (dt.Rows[n]["CustomerId"].ToString() != "") { model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString()); } if (dt.Rows[n]["GoodsId"].ToString() != "") { model.GoodsId = int.Parse(dt.Rows[n]["GoodsId"].ToString()); } if (dt.Rows[n]["Status"].ToString() != "") { model.Status = int.Parse(dt.Rows[n]["Status"].ToString()); } if (dt.Rows[n]["Count"].ToString() != "") { model.Count = decimal.Parse(dt.Rows[n]["Count"].ToString()); } if (dt.Rows[n]["StoredInTime"].ToString() != "") { model.StoredInTime = DateTime.Parse(dt.Rows[n]["StoredInTime"].ToString()); } model.Remark = dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return(modelList); }
public void AddStoreInGoods(StoreInGoods storeInGoods) { _storeInGoods.Add(storeInGoods); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DTcms.Model.StoreInGoods model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(DTcms.Model.StoreInGoods model) { dal.Add(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(DTcms.Model.StoreInGoods model) { return(dal.Add(model)); }