/// <summary> /// 获得数据列表 /// </summary> public List <DTcms.Model.StoreInOrder> DataTableToList(DataTable dt) { List <DTcms.Model.StoreInOrder> modelList = new List <DTcms.Model.StoreInOrder>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.StoreInOrder model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.StoreInOrder(); if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } if (dt.Rows[n]["CustomerId"].ToString() != "") { model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString()); } if (dt.Rows[n]["Status"].ToString() != "") { model.Status = int.Parse(dt.Rows[n]["Status"].ToString()); } if (dt.Rows[n]["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } if (dt.Rows[n]["BeginChargingTime"].ToString() != "") { model.BeginChargingTime = DateTime.Parse(dt.Rows[n]["BeginChargingTime"].ToString()); } if (dt.Rows[n]["ChargingTime"].ToString() != "") { model.ChargingTime = DateTime.Parse(dt.Rows[n]["ChargingTime"].ToString()); } model.Admin = dt.Rows[n]["Admin"].ToString(); if (dt.Rows[n]["ChargingCount"].ToString() != "") { model.ChargingCount = decimal.Parse(dt.Rows[n]["ChargingCount"].ToString()); } model.InspectionNumber = dt.Rows[n]["InspectionNumber"].ToString(); model.AccountNumber = dt.Rows[n]["AccountNumber"].ToString(); if (dt.Rows[n]["SuttleWeight"].ToString() != "") { model.SuttleWeight = decimal.Parse(dt.Rows[n]["SuttleWeight"].ToString()); } if (dt.Rows[n]["FreeDays"].ToString() != "") { model.FreeDays = int.Parse(dt.Rows[n]["FreeDays"].ToString()); } model.Remark = dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 获得数据列表 /// </summary> public List<DTcms.Model.StoreInOrder> DataTableToList(DataTable dt) { List<DTcms.Model.StoreInOrder> modelList = new List<DTcms.Model.StoreInOrder>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { DTcms.Model.StoreInOrder model; for (int n = 0; n < rowsCount; n++) { model = new DTcms.Model.StoreInOrder(); if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } if (dt.Rows[n]["CustomerId"].ToString() != "") { model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString()); } if (dt.Rows[n]["Status"].ToString() != "") { model.Status = int.Parse(dt.Rows[n]["Status"].ToString()); } if (dt.Rows[n]["CreateTime"].ToString() != "") { model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString()); } if (dt.Rows[n]["BeginChargingTime"].ToString() != "") { model.BeginChargingTime = DateTime.Parse(dt.Rows[n]["BeginChargingTime"].ToString()); } if (dt.Rows[n]["ChargingTime"].ToString() != "") { model.ChargingTime = DateTime.Parse(dt.Rows[n]["ChargingTime"].ToString()); } model.Admin = dt.Rows[n]["Admin"].ToString(); if (dt.Rows[n]["ChargingCount"].ToString() != "") { model.ChargingCount = decimal.Parse(dt.Rows[n]["ChargingCount"].ToString()); } model.InspectionNumber = dt.Rows[n]["InspectionNumber"].ToString(); model.AccountNumber = dt.Rows[n]["AccountNumber"].ToString(); if (dt.Rows[n]["SuttleWeight"].ToString() != "") { model.SuttleWeight = decimal.Parse(dt.Rows[n]["SuttleWeight"].ToString()); } model.Remark = dt.Rows[n]["Remark"].ToString(); modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(DTcms.Model.StoreInOrder model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(DTcms.Model.StoreInOrder model) { dal.Add(model); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(DTcms.Model.StoreInOrder model) { return(dal.Add(model)); }