protected void OnRoleNameChanged(RoleNameChangedEventArgs args) { //Save Change to DataBase if (!string.IsNullOrEmpty(args.NewName) && args.OldName != args.NewName) { PermissionDal dal = new PermissionDal(); dal.UpdateRoleInfo(this); } if (RoleNameChanged == null) { return; } Delegate[] invkList = RoleNameChanged.GetInvocationList(); foreach (EventHandler <RoleNameChangedEventArgs> handler in invkList) { try { //IAsyncResult ar = //handler.BeginInvoke(this, args, null, null); handler.Invoke(this, args); } catch (Exception e) { RoleNameChanged -= handler; } } }
/// <summary> /// Ctor /// </summary> private AccountPermission(Users user) { _userId = user.Id; _roleIds = user.GWCodes; _permissionDal = new PermissionDal(); }