private static void PrepareTreeNodeRecursively(PC.SCSimpleObject parentOrg, DeluxeTreeNode parentTreeNode, Dictionary <string, PC.SCSimpleObject> parentsList, bool godMode, DateTime timePoint, string[] requiredPermissions, string excludeId, string exceptID) { if (excludeId != parentOrg.ID) { PC.SCObjectAndRelationCollection relations = PC.Adapters.SCSnapshotAdapter.Instance.QueryObjectAndRelationByParentIDs(PC.SchemaInfo.FilterByCategory("Organizations").ToSchemaNames(), new string[] { parentOrg.ID }, false, true, false, timePoint); PC.Permissions.SCContainerAndPermissionCollection permissions = null; if (requiredPermissions != null) { permissions = PC.Adapters.SCAclAdapter.Instance.LoadCurrentContainerAndPermissions(Util.CurrentUser.ID, relations.ToIDArray()); } BindObjectsToTreeNodes(relations, parentTreeNode.Nodes, godMode, requiredPermissions, permissions, excludeId, exceptID); foreach (DeluxeTreeNode childNode in parentTreeNode.Nodes) { PC.SCSimpleObject obj = null; if (parentsList.TryGetValue(childNode.Value, out obj)) { childNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal; childNode.Expanded = true; PrepareTreeNodeRecursively(obj, childNode, parentsList, godMode, timePoint, requiredPermissions, excludeId, exceptID); } } } }
/// <summary> /// 使用指定的<see cref="SCSimpleObject"/>和引用对象ID初始化<see cref="SCWrappedSchemaOwnership"/>。 /// </summary> /// <param name="schemaObject"></param> /// <param name="refId"></param> public SCWrappedSchemaOwnership(SCSimpleObject schemaObject, string refId) { if (schemaObject == null) { throw new ArgumentNullException("org"); } this.schemaObject = schemaObject; this.refId = refId; }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { this.Object = PC.Adapters.SchemaObjectAdapter.Instance.Load(this.Request.QueryString["id"]).ToSimpleObject(); } this.Response.Cache.SetCacheability(HttpCacheability.NoCache); this.binding1.Data = this.Object; }
protected void Page_Load(object sender, EventArgs e) { Util.InitSecurityContext(this.notice); this.Page.Response.CacheControl = "no-cache"; if (Page.IsPostBack == false) { this.UserObject = DbUtil.GetEffectiveObject <PC.SCUser>(this.Request.QueryString["id"]).ToSimpleObject(); this.gridMain.PageSize = ProfileUtil.PageSize; } this.binding1.Data = this.UserObject; }
public static IOguObject ToOguObject(this SCSimpleObject obj) { OguBase result = null; string category = SchemaDefine.GetSchemaConfig(obj.SchemaType).Category; SchemaType schemaType = SchemaExtensions.SchemaCategoryToOguSchemaType(category); if (schemaType != OGUPermission.SchemaType.Unspecified) { result = (OguBase)OguBase.CreateWrapperObject(obj.ID, schemaType); result.Name = obj.Name; result.DisplayName = obj.DisplayName; } return(result); }
protected void Page_Load(object sender, EventArgs e) { string groupId = Request.QueryString["id"]; Util.InitSecurityContext(this.notice); this.calcProgress.Tag = groupId; if (Page.IsPostBack == false) { this.GroupObject = DbUtil.GetEffectiveObject(groupId, null).ToSimpleObject(); this.GroupParentId = PC.Adapters.SchemaRelationObjectAdapter.Instance.LoadByObjectID(this.GroupObject.ID).Find(m => m.Status == SchemaObjectStatus.Normal && m.ParentSchemaType == "Organizations").ParentID; this.binding1.Data = this.GroupObject; this.gridMain.InitialData = new Services.ConditionSvc().GetGroupConditions(groupId); this.gridMain.DataBind(); } }
/// <summary> /// 生成表示当前对象的简单对象 /// </summary> /// <returns></returns> public SCSimpleObject ToSimpleObject() { SCSimpleObject result = new SCSimpleObject(); result.ID = this.ID; result.VersionStartTime = this.VersionStartTime; result.VersionEndTime = this.VersionEndTime; result.Tag = this.Tag; result.SchemaType = this.SchemaType; result.Status = this.Status; result.Name = this.Properties.GetValue("Name", string.Empty); result.DisplayName = this.Properties.GetValue("DisplayName", string.Empty); result.CodeName = this.Properties.GetValue("CodeName", string.Empty); if (result.DisplayName.IsNullOrEmpty()) { result.DisplayName = result.Name; } return(result); }