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