/// <summary> /// 获得数据列表 /// </summary> public List <BookShop.Model.RoleRight> DataTableToList(DataTable dt) { List <BookShop.Model.RoleRight> modelList = new List <BookShop.Model.RoleRight>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { BookShop.Model.RoleRight model; for (int n = 0; n < rowsCount; n++) { model = new BookShop.Model.RoleRight(); if (dt.Rows[n]["RoleRightId"].ToString() != "") { model.RoleRightId = int.Parse(dt.Rows[n]["RoleRightId"].ToString()); } if (dt.Rows[n]["RoleId"].ToString() != "") { int RoleId = int.Parse(dt.Rows[n]["RoleId"].ToString()); model.RoleInfo = roleInfoServices.GetModel(RoleId); } if (dt.Rows[n]["NodeId"].ToString() != "") { int NodeId = int.Parse(dt.Rows[n]["NodeId"].ToString()); model.SysFun = sysfunServices.GetModel(NodeId); if (model.SysFun == null) { continue; } } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(BookShop.Model.RoleRight model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BookShop.Model.RoleRight model) { return(dal.Add(model)); }