示例#1
0
        //public static SchemaType GetObjectTypeFromInterface<T>() where T : IOguObject
        //{
        //    SchemaType type = SchemaType.Unspecified;

        //    if (typeof(T) == typeof(IOguObject))
        //        type = SchemaType.All & ~SchemaType.Sideline;
        //    else
        //        if (typeof(T) == typeof(IOrganization))
        //            type = SchemaType.Organizations;
        //        else
        //            if (typeof(T) == typeof(IOrganizationInRole))
        //                type = SchemaType.OrganizationsInRole;
        //            else
        //                if (typeof(T) == typeof(IUser))
        //                    type = SchemaType.Users;
        //                else
        //                    if (typeof(T) == typeof(IGroup))
        //                        type = SchemaType.Groups;

        //    return type;
        //}

        public static UserAttributesType ConvertUserAttribute(int nAttribute)
        {
            UserAttributesType uat = UserAttributesType.Unspecified;

            if ((nAttribute & 1) != 0)
            {
                uat |= UserAttributesType.DangZuChengYuan;
            }

            if ((nAttribute & 2) != 0)
            {
                uat |= UserAttributesType.ShuGuanGanBu;
            }

            if ((nAttribute & 4) != 0)
            {
                uat |= UserAttributesType.JiaoLiuGanBu;
            }

            if ((nAttribute & 8) != 0)
            {
                uat |= UserAttributesType.JieDiaoGanBu;
            }

            return(uat);
        }
示例#2
0
 public PhantomUser(SchemaObjectBase obj)
     : base(obj)
 {
     this._attributes = obj.Properties.GetValue("CadreType", UserAttributesType.Unspecified);
     this._email      = obj.Properties.GetValue <string>("Mail", string.Empty);
     this._logOnName  = obj.Properties.GetValue <string>("CodeName", string.Empty);
     this._occupation = obj.Properties.GetValue("Occupation", string.Empty);
     this._userRank   = obj.Properties.GetValue <UserRankType>("UserRank", UserRankType.Unspecified);
 }
示例#3
0
        /// <summary>
        /// 初始化属性
        /// </summary>
        /// <param name="row"></param>
        public override void InitProperties(DataRow row)
        {
            base.InitProperties(row);

            this.logOnName  = Common.GetDataRowTextValue(row, "LOGON_NAME");
            this.email      = Common.GetDataRowTextValue(row, "E_MAIL");
            this.occupation = Common.GetDataRowTextValue(row, "RANK_NAME");

            this.rank = Common.ConvertUserRankCode(Common.GetDataRowTextValue(row, "RANK_CODE"));

            ObjectType      = SchemaType.Users;
            this.attributes = Common.ConvertUserAttribute(Common.GetDataRowValue(row, "ATTRIBUTES", 0));

            this.isSideline = Common.GetDataRowValue(row, "SIDELINE", 0) == 1;
        }
示例#4
0
        public static UserAttributesType TranslateUserAttributes(SearchResult sr)
        {
            UserAttributesType unspecified = UserAttributesType.Unspecified;

            if (ADHelper.GetInstance().GetSearchResultPropertyStrValue("x121Address", sr) == "y")
            {
                unspecified |= UserAttributesType.DangZuChengYuan;
            }
            if (ADHelper.GetInstance().GetSearchResultPropertyStrValue("primaryTelexNumber", sr) == "y")
            {
                unspecified |= UserAttributesType.ShuGuanGanBu;
            }
            if (ADHelper.GetInstance().GetSearchResultPropertyStrValue("co", sr) == "y")
            {
                unspecified |= UserAttributesType.JiaoLiuGanBu;
            }
            if (ADHelper.GetInstance().GetSearchResultPropertyStrValue("primaryTelexNumber", sr) == "y")
            {
                unspecified |= UserAttributesType.JieDiaoGanBu;
            }
            return(unspecified);
        }
示例#5
0
		/// <summary>
		/// 初始化属性
		/// </summary>
		/// <param name="row"></param>
		public override void InitProperties(DataRow row)
		{
			base.InitProperties(row);

			this.logOnName = Common.GetDataRowTextValue(row, "LOGON_NAME");
			this.email = Common.GetDataRowTextValue(row, "E_MAIL");
			this.occupation = Common.GetDataRowTextValue(row, "RANK_NAME");

			this.rank = Common.ConvertUserRankCode(Common.GetDataRowTextValue(row, "RANK_CODE"));

			ObjectType = SchemaType.Users;
			this.attributes = Common.ConvertUserAttribute(Common.GetDataRowValue(row, "ATTRIBUTES", 0));

			this.isSideline = Common.GetDataRowValue(row, "SIDELINE", 0) == 1;
		}