/// <summary> /// 获得数据列表 /// </summary> public List <BookShop.Model.SysFun> DataTableToList(DataTable dt) { List <BookShop.Model.SysFun> modelList = new List <BookShop.Model.SysFun>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { BookShop.Model.SysFun model; for (int n = 0; n < rowsCount; n++) { model = new BookShop.Model.SysFun(); if (dt.Rows[n]["NodeId"].ToString() != "") { model.NodeId = int.Parse(dt.Rows[n]["NodeId"].ToString()); } model.DisplayName = dt.Rows[n]["DisplayName"].ToString(); model.NodeURL = dt.Rows[n]["NodeURL"].ToString(); if (dt.Rows[n]["DisplayOrder"].ToString() != "") { model.DisplayOrder = int.Parse(dt.Rows[n]["DisplayOrder"].ToString()); } if (dt.Rows[n]["ParentNodeId"].ToString() != "") { model.ParentNodeId = int.Parse(dt.Rows[n]["ParentNodeId"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(BookShop.Model.SysFun model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(BookShop.Model.SysFun model) { dal.Add(model); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(BookShop.Model.SysFun model) { return(dal.Add(model)); }