/// <summary>
        /// Returns true if OrgApacheJackrabbitOakSpiSecurityUserActionDefaultAuthorizableProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of OrgApacheJackrabbitOakSpiSecurityUserActionDefaultAuthorizableProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrgApacheJackrabbitOakSpiSecurityUserActionDefaultAuthorizableProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EnabledActions == other.EnabledActions ||
                     EnabledActions != null &&
                     EnabledActions.Equals(other.EnabledActions)
                     ) &&
                 (
                     UserPrivilegeNames == other.UserPrivilegeNames ||
                     UserPrivilegeNames != null &&
                     UserPrivilegeNames.Equals(other.UserPrivilegeNames)
                 ) &&
                 (
                     GroupPrivilegeNames == other.GroupPrivilegeNames ||
                     GroupPrivilegeNames != null &&
                     GroupPrivilegeNames.Equals(other.GroupPrivilegeNames)
                 ) &&
                 (
                     Constraint == other.Constraint ||
                     Constraint != null &&
                     Constraint.Equals(other.Constraint)
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (EnabledActions != null)
         {
             hashCode = hashCode * 59 + EnabledActions.GetHashCode();
         }
         if (UserPrivilegeNames != null)
         {
             hashCode = hashCode * 59 + UserPrivilegeNames.GetHashCode();
         }
         if (GroupPrivilegeNames != null)
         {
             hashCode = hashCode * 59 + GroupPrivilegeNames.GetHashCode();
         }
         if (Constraint != null)
         {
             hashCode = hashCode * 59 + Constraint.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #3
0
        private void Initial()
        {
            _currentUser = AppClientContext.CurrentUser.Id;
            listUser     = PharmacyDatabaseService.GetUser(out msg, _currentUser);
            listR        = PharmacyDatabaseService.AllRoles(out msg).Where(p => p.Name == "SystemRole" || p.Name == "信息管理员").FirstOrDefault();
            listRU       = PharmacyDatabaseService.GetRoleWithUserInfo(out msg, listUser.Id, listR.Id).FirstOrDefault();

            _tabPageEdit   = tabPageEdit;
            _tabPageSearch = tabPageSearch;
            DisplayTabPage(false);
            if (EnabledActions.Count > 0)
            {
                if (!EnabledActions.Contains("Search"))
                {
                    btnCancel.Visible  = false;
                    btnRefresh.Visible = false;
                    btnSearch.Visible  = false;
                }


                if (!EnabledActions.Contains("Add"))
                {
                    btnAdd.Visible = false;
                }

                if (!EnabledActions.Contains("Edit"))
                {
                    btnModify.Visible = false;
                }

                if (!EnabledActions.Contains("Edit") && !EnabledActions.Contains("Add"))
                {
                    btnSave.Visible   = false;
                    btnCancel.Visible = false;
                }
            }

            //用户修改自己密码
            if (listRU == null)
            {
                btnAdd.Visible     = false;
                btnDelete.Visible  = false;
                btnRefresh.Visible = false;
                btnSearch.Visible  = false;
            }

            HeaderTexts          = _headTexts;
            this.btnAdd.Click   += new System.EventHandler(this.OnButtonAddClick);
            this.btnClose.Click += new System.EventHandler(this.OnButtonCloseClick);
        }