Exemplo n.º 1
0
        /// <summary>
        /// Gets the property value by name.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="propertyName">Name of the property.</param>
        /// <returns></returns>
        public static object GetPropertyValueByName(VwUserGroupPermission entity, string propertyName)
        {
            switch (propertyName)
            {
            case "UserCnName":
                return(entity.UserCnName);

            case "UserId":
                return(entity.UserId);

            case "RoleId":
                return(entity.RoleId);

            case "RoleName":
                return(entity.RoleName);

            case "PermissionId":
                return(entity.PermissionId);

            case "PermissionName":
                return(entity.PermissionName);

            case "GroupId":
                return(entity.GroupId);
            }
            return(null);
        }
Exemplo n.º 2
0
        ///<summary>
        /// A simple factory method to create a new <see cref="VwUserGroupPermission"/> instance.
        ///</summary>
        ///<param name="_userCnName"></param>
        ///<param name="_userId"></param>
        ///<param name="_roleId"></param>
        ///<param name="_roleName"></param>
        ///<param name="_permissionId"></param>
        ///<param name="_permissionName"></param>
        ///<param name="_groupId"></param>
        public static VwUserGroupPermission CreateVwUserGroupPermission(System.String _userCnName, System.String _userId, System.String _roleId, System.String _roleName, System.String _permissionId, System.String _permissionName, System.String _groupId)
        {
            VwUserGroupPermission newVwUserGroupPermission = new VwUserGroupPermission();

            newVwUserGroupPermission.UserCnName     = _userCnName;
            newVwUserGroupPermission.UserId         = _userId;
            newVwUserGroupPermission.RoleId         = _roleId;
            newVwUserGroupPermission.RoleName       = _roleName;
            newVwUserGroupPermission.PermissionId   = _permissionId;
            newVwUserGroupPermission.PermissionName = _permissionName;
            newVwUserGroupPermission.GroupId        = _groupId;
            return(newVwUserGroupPermission);
        }
Exemplo n.º 3
0
        ///<summary>
        ///  Returns a Typed VwUserGroupPermissionBase Entity
        ///</summary>
        public virtual VwUserGroupPermissionBase Copy()
        {
            //shallow copy entity
            VwUserGroupPermission copy = new VwUserGroupPermission();

            copy.UserCnName     = this.UserCnName;
            copy.UserId         = this.UserId;
            copy.RoleId         = this.RoleId;
            copy.RoleName       = this.RoleName;
            copy.PermissionId   = this.PermissionId;
            copy.PermissionName = this.PermissionName;
            copy.GroupId        = this.GroupId;
            copy.AcceptChanges();
            return((VwUserGroupPermission)copy);
        }