/// <summary> /// 获得数据列表 /// </summary> public List <DTcms.Model.StoreInUnitPrice> DataTableToList(DataTable dt) { List <DTcms.Model.StoreInUnitPrice> modelList = new List <DTcms.Model.StoreInUnitPrice>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.StoreInUnitPrice model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.StoreInUnitPrice(); if (dt.Rows[n]["StoreInOrderId"].ToString() != "") { model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString()); } if (dt.Rows[n]["BeginTime"].ToString() != "") { model.BeginTime = DateTime.Parse(dt.Rows[n]["BeginTime"].ToString()); } if (dt.Rows[n]["Price"].ToString() != "") { model.Price = decimal.Parse(dt.Rows[n]["Price"].ToString()); } if (dt.Rows[n]["EndTime"].ToString() != "") { model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString()); } model.Remark = dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 获得数据列表 /// </summary> public List<DTcms.Model.StoreInUnitPrice> DataTableToList(DataTable dt) { List<DTcms.Model.StoreInUnitPrice> modelList = new List<DTcms.Model.StoreInUnitPrice>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.StoreInUnitPrice model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.StoreInUnitPrice(); if(dt.Rows[n]["StoreInOrderId"].ToString()!="") { model.StoreInOrderId=int.Parse(dt.Rows[n]["StoreInOrderId"].ToString()); } if(dt.Rows[n]["BeginTime"].ToString()!="") { model.BeginTime=DateTime.Parse(dt.Rows[n]["BeginTime"].ToString()); } if(dt.Rows[n]["Price"].ToString()!="") { model.Price=decimal.Parse(dt.Rows[n]["Price"].ToString()); } if(dt.Rows[n]["EndTime"].ToString()!="") { model.EndTime=DateTime.Parse(dt.Rows[n]["EndTime"].ToString()); } model.Remark= dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return modelList; }
public void AddUnitPrice(StoreInUnitPrice unitPrices) { _unitPrices.Add(unitPrices); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DTcms.Model.StoreInUnitPrice model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(DTcms.Model.StoreInUnitPrice model) { dal.Add(model); }