public void Add(Models.SysPermission item) { DbCommand comm = this.GetCommand("SysPermission_Insert"); comm.AddParameter <string>(this.Factory, "Code", item.Code); comm.AddParameter <string>(this.Factory, "Name", item.Name); this.SafeExecuteNonQuery(comm); }
public Models.SysPermission Get(Models.SysPermission dummy) { DbCommand comm = this.GetCommand("SysPermission_Get"); comm.AddParameter <string>(this.Factory, "Code", dummy.Code); DataTable dt = this.GetTable(comm); return(EntityBase.ParseListFromTable <SysPermission>(dt).FirstOrDefault()); }
public void Update(Models.SysPermission @new, Models.SysPermission old) { var item = @new; item.Code = old.Code; DbCommand comm = this.GetCommand("SysPermission_Update"); comm.AddParameter <string>(this.Factory, "Code", item.Code); comm.AddParameter <string>(this.Factory, "Name", item.Name); this.SafeExecuteNonQuery(comm); }
private EasyuiTreeNode GetChildPermission(Models.SysPermission pm, IEnumerable <Models.SysPermission> ps, int selectedId) { var list = ps.Where(p => p.ParentId == pm.PermissionId); var node = new EasyuiTreeNode() { id = pm.PermissionId.ToString(), text = pm.MenuLanguageName }; if (pm.PermissionId == selectedId) { node.selected = true; } foreach (var permission in list) { node.children.Add(GetChildPermission(permission, ps, selectedId)); } return(node); }
public void Remove(Models.SysPermission item) { throw new NotImplementedException(); }