/// <summary> /// 获得数据列表 /// </summary> public List<DTcms.Model.Attach> DataTableToList(DataTable dt) { List<DTcms.Model.Attach> modelList = new List<DTcms.Model.Attach>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.Attach model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.Attach(); if(dt.Rows[n]["StoreWaitingGoodsId"].ToString()!="") { model.StoreWaitingGoodsId=int.Parse(dt.Rows[n]["StoreWaitingGoodsId"].ToString()); } model.FilePath= dt.Rows[n]["FilePath"].ToString(); if(dt.Rows[n]["CreateTime"].ToString()!="") { model.CreateTime=DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } model.Admin= dt.Rows[n]["Admin"].ToString(); model.Remark= dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <DTcms.Model.Attach> DataTableToList(DataTable dt) { List <DTcms.Model.Attach> modelList = new List <DTcms.Model.Attach>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.Attach model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.Attach(); if (dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString() != "") { model.StoreInGoodsStoreInOrderId = int.Parse(dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString()); } if (dt.Rows[n]["StoreInGoodsId"].ToString() != "") { model.StoreInGoodsId = int.Parse(dt.Rows[n]["StoreInGoodsId"].ToString()); } model.FilePath = dt.Rows[n]["FilePath"].ToString(); if (dt.Rows[n]["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } model.Admin = dt.Rows[n]["Admin"].ToString(); model.Remark = dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return(modelList); }
public void AddAttach(Attach attach) { _attachs.Add(attach); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DTcms.Model.Attach model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(DTcms.Model.Attach model) { dal.Add(model); }