/// <summary> /// 获得数据列表 /// </summary> public List <ROYcms.Sys.Model.ROYcms_user_defined> DataTableToList(DataTable dt) { List <ROYcms.Sys.Model.ROYcms_user_defined> modelList = new List <ROYcms.Sys.Model.ROYcms_user_defined>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ROYcms.Sys.Model.ROYcms_user_defined model; for (int n = 0; n < rowsCount; n++) { model = new ROYcms.Sys.Model.ROYcms_user_defined(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["user_id"].ToString() != "") { model.user_id = int.Parse(dt.Rows[n]["user_id"].ToString()); } model.title = dt.Rows[n]["title"].ToString(); model.XmlPath = dt.Rows[n]["XmlPath"].ToString(); model.key_id = dt.Rows[n]["key_id"].ToString(); model.FieldGroup = dt.Rows[n]["FieldGroup"].ToString(); if (dt.Rows[n]["Time"].ToString() != "") { model.Time = DateTime.Parse(dt.Rows[n]["Time"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(ROYcms.Sys.Model.ROYcms_user_defined model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ROYcms.Sys.Model.ROYcms_user_defined model) { return(dal.Add(model)); }