/// <summary> /// 获得数据列表 /// </summary> public List <zs.Model.Sys_Group> DataTableToList(DataTable dt) { List <zs.Model.Sys_Group> modelList = new List <zs.Model.Sys_Group>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { zs.Model.Sys_Group model; for (int n = 0; n < rowsCount; n++) { model = new zs.Model.Sys_Group(); if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["Type"] != null && dt.Rows[n]["Type"].ToString() != "") { model.Type = dt.Rows[n]["Type"].ToString(); } if (dt.Rows[n]["GroupName"] != null && dt.Rows[n]["GroupName"].ToString() != "") { model.GroupName = dt.Rows[n]["GroupName"].ToString(); } if (dt.Rows[n]["PID"] != null && dt.Rows[n]["PID"].ToString() != "") { model.PID = int.Parse(dt.Rows[n]["PID"].ToString()); } if (dt.Rows[n]["IDPath"] != null && dt.Rows[n]["IDPath"].ToString() != "") { model.IDPath = dt.Rows[n]["IDPath"].ToString(); } if (dt.Rows[n]["NamePath"] != null && dt.Rows[n]["NamePath"].ToString() != "") { model.NamePath = dt.Rows[n]["NamePath"].ToString(); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(zs.Model.Sys_Group model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(zs.Model.Sys_Group model) { return(dal.Add(model)); }