예제 #1
0
        private bool InitState()
        {
            string ouID   = WebUtility.GetRequestQueryString("ou", string.Empty);
            bool   result = true;

            try
            {
                SchemaObjectBase parent = DbUtil.GetEffectiveObject(ouID, null);

                this.ParentOrganization = parent.ToSimpleObject();
                this.hfOuParentId.Value = parent.ID == SCOrganization.RootOrganizationID ? string.Empty : DbUtil.GetParentOURelation(parent.ID).ParentID;
            }
            catch (ObjectNotFoundException)
            {
                result = false;
            }

            return(result);
        }
        public OguObjectCollection <IOguObject> GetObjects(params string[] ids)
        {
            ids.NullCheck("ids");

            SCObjectAndRelationCollection relations = SCSnapshotAdapter.Instance.QueryObjectAndRelationByIDs(SchemaInfo.FilterByCategory("Users", "Groups", "Organizations").ToSchemaNames(), ids, false, DateTime.MinValue);

            relations.FillDetails();

            List <IOguObject> list = new List <IOguObject>(relations.Count);

            foreach (var item in relations)
            {
                SchemaObjectBase obj = item.Detail;
                if (obj != null)
                {
                    IOguObject oguObj = obj.ToSimpleObject().ToOguObject();
                    list.Add(oguObj);
                }
            }

            return(new OguObjectCollection <IOguObject>(list));
        }
예제 #3
0
 public SCStatusCheckException(SchemaObjectBase relativeObject, SCOperationType opType)
     : base(string.Format("对象\"{0}\"的状态不是正常状态,不能执行{1}操作", relativeObject.ToSimpleObject().Name, EnumItemDescriptionAttribute.GetDescription(opType)))
 {
     this._RelativeObject = relativeObject;
     this._OperationType  = opType;
 }
		public SCStatusCheckException(SchemaObjectBase relativeObject, SCOperationType opType)
			: base(string.Format("对象\"{0}\"的状态不是正常状态,不能执行{1}操作", relativeObject.ToSimpleObject().Name, EnumItemDescriptionAttribute.GetDescription(opType)))
		{
			this._RelativeObject = relativeObject;
			this._OperationType = opType;
		}