public DelayRenameCodeNameAction(OGUPermission.IOguObject oguObject, string oguPropertyName, string adObjectID, string adPropertyName)
		{
			this.oguObject = oguObject;
			this.oguPropertyName = oguPropertyName;
			this.adObjectID = adObjectID;
			this.adPropertyName = adPropertyName;
		}
예제 #2
0
        protected override void SetPropertyValue(OGUPermission.IOguObject srcOguObject, string srcPropertyName, System.DirectoryServices.DirectoryEntry entry, string targetPropertyName, string context, DataObjects.Security.Transfer.SetterContext setterContext)
        {
            // 借用Pager属性,属性值格式:
            // 时间的内部格式十六进制|MaterialContent的ID,如果为空白,则表示无图片
            string srcPropertyValue    = GetNormalizeddSourceValue(srcOguObject, srcPropertyName, context);
            string targetPropertyValue = GetNormalizeddTargetValue(entry, targetPropertyName, context);

            if (srcPropertyValue != targetPropertyValue)
            {
                entry.Properties[targetPropertyName].Value = srcPropertyValue;

                int ind = string.IsNullOrEmpty(srcPropertyValue) ? -1 : srcPropertyValue.IndexOf('|');
                if (ind > 0)
                {
                    string hexPart   = srcPropertyValue.Substring(0, ind);
                    string keyPart   = srcPropertyValue.Substring(ind + 1);
                    var    imageData = MCS.Library.SOA.DataObjects.MaterialContentAdapter.Instance.Load(w => w.AppendItem("CONTENT_ID", keyPart));
                    if (imageData.Count != 1)
                    {
                        throw new InvalidDataException(string.Format("未能根据ID{0}找到图像数据", keyPart));
                    }

                    entry.Properties["thumbnailPhoto"].Value = imageData[0].ContentData;
                }
                else
                {
                    entry.Properties["thumbnailPhoto"].Value = null;
                }
            }
        }
예제 #3
0
 public DelayRenameCodeNameAction(OGUPermission.IOguObject oguObject, string oguPropertyName, string adObjectID, string adPropertyName)
 {
     this.oguObject       = oguObject;
     this.oguPropertyName = oguPropertyName;
     this.adObjectID      = adObjectID;
     this.adPropertyName  = adPropertyName;
 }
예제 #4
0
        protected override bool ComparePropertyValue(OGUPermission.IOguObject srcOguObject, string srcPropertyName, ADObjectWrapper adObject, string targetPropertyName, string context)
        {
            string srcPropertyValue = null;

            if (srcOguObject.Properties[srcPropertyName] != null)
            {
                srcPropertyValue = srcOguObject.Properties[srcPropertyName] as string;
            }

            string targetPropertyValue = null;

            if (adObject.Properties[targetPropertyName] != null)
            {
                targetPropertyValue = adObject.Properties[targetPropertyName].ToString();
            }

            bool result = false;

            if (srcPropertyValue != null && targetPropertyValue != null)
            {
                result = srcPropertyValue == targetPropertyValue;
            }

            return(result);
        }
 protected override bool ComparePropertyValue(OGUPermission.IOguObject srcOguObject, string srcPropertyName, ADObjectWrapper adObject, string targetPropertyName, string context)
 {
     if (srcOguObject.FullPath == SynchronizeContext.Current.SourceRootPath)
     {
         //名称以权限中心为准
         return(adObject.DN == SynchronizeHelper.AppendNamingContext(SynchronizeContext.Current.TargetRootOU));
     }
     else
     {
         string path = SynchronizeHelper.GetRelativePath(srcOguObject);
         if (path.IndexOf('\\') > 0)
         {
             return(base.ComparePropertyValue(srcOguObject, srcPropertyName, adObject, targetPropertyName, context));
         }
         else
         {
             string dn = SynchronizeContext.Current.GetMappedName(srcOguObject.Name);
             return(adObject.DN == SynchronizeHelper.AppendNamingContext(dn));
         }
     }
 }
예제 #6
0
		/// <summary>
		/// 初始化此类的新实例
		/// </summary>
		/// <param name="oguObject">要移动的OGU对象</param>
		/// <param name="parentDn">要移动到的父级DN</param>
		/// <param name="targetObjectID">要移动的AD对象ID(必须已经存在的)</param>
		public DelayMoveToAction(OGUPermission.IOguObject oguObject, string parentDn, Guid targetObjectID)
		{
			this.oguObject = oguObject;
			this.parentDn = parentDn;
			this.targetObjectID = targetObjectID;
		}
예제 #7
0
		public DelayRenameAction(OGUPermission.IOguObject oguObject, string adObjectID)
		{
			this.oguObject = oguObject;
			this.adObjectID = adObjectID;
		}
예제 #8
0
 public DelayRenameAction(OGUPermission.IOguObject oguObject, string adObjectID)
 {
     this.oguObject  = oguObject;
     this.adObjectID = adObjectID;
 }
예제 #9
0
 /// <summary>
 /// 初始化此类的新实例
 /// </summary>
 /// <param name="oguObject">要移动的OGU对象</param>
 /// <param name="parentDn">要移动到的父级DN</param>
 /// <param name="targetObjectID">要移动的AD对象ID(必须已经存在的)</param>
 public DelayMoveToAction(OGUPermission.IOguObject oguObject, string parentDn, Guid targetObjectID)
 {
     this.oguObject      = oguObject;
     this.parentDn       = parentDn;
     this.targetObjectID = targetObjectID;
 }
예제 #10
0
 protected override void SetPropertyValue(OGUPermission.IOguObject srcOguObject, string srcPropertyName, System.DirectoryServices.DirectoryEntry entry, string targetPropertyName, string context, DataObjects.Security.Transfer.SetterContext setterContext)
 {
     entry.Properties[srcPropertyName].Value = SynchronizeHelper.PermissionCenterInvolved;
     entry.CommitChanges();
 }
예제 #11
0
        public override void Convert(DataObjects.Security.Transfer.ObjectModifyType modifyType, OGUPermission.IOguObject srcObject, System.DirectoryServices.DirectoryEntry targetObject, string context)
        {
            IGroup        grp           = (IGroup)srcObject;
            SetterContext setterContext = new SetterContext();

            ConvertProperties(srcObject, targetObject, setterContext);

            targetObject.Properties["displayNamePrintable"].Value = SynchronizeHelper.PermissionCenterInvolved;

            targetObject.CommitChanges();

            DoAfterObjectUpdatedOP(srcObject, targetObject, setterContext);
        }