/// <summary> /// Handle node is populated. /// </summary> protected void PopulateNode(TreeNode node) { if (node != null) { int nodeID = ValidationHelper.GetInteger(node.Value, 0); // Get child nodes List <UniTreeNode> childNodes = ProviderObject.GetChildNodes(node.Value); // Add to treeview foreach (UniTreeNode childNode in childNodes) { // Get ID int childNodeId = ((Metric)childNode.ItemData).MetricId; // Don't insert one object more than once if ((childNodeId != nodeID)) { TreeNode createdNode = CreateNode(childNode); RaiseOnNodeCreated(childNode, ref createdNode); if (createdNode != null) { node.ChildNodes.Add(createdNode); } } } } }
/// <summary> /// Returns <see cref="PageBuilderContainerSiteInfo"/> binding structure. /// </summary> /// <param name="pagebuildercontainerId">ObjectType.cms_pagebuildercontainer ID.</param> /// <param name="siteId">Site ID.</param> public static PageBuilderContainerSiteInfo GetPageBuilderContainerSiteInfo(int pagebuildercontainerId, int siteId) { return(ProviderObject.GetObjectQuery().TopN(1) .WhereEquals("PageBuilderContainerID", pagebuildercontainerId) .WhereEquals("SiteID", siteId) .FirstOrDefault()); }
/// <summary> /// Returns <see cref="TreeCategoryInfo"/> binding structure. /// </summary> /// <param name="nodeId">Node ID.</param> /// <param name="categoryId">Content category ID.</param> public static TreeCategoryInfo GetTreeCategoryInfo(int nodeId, int categoryId) { return(ProviderObject.GetObjectQuery().TopN(1) .WhereEquals("NodeID", nodeId) .WhereEquals("CategoryID", categoryId) .FirstOrDefault()); }
/// <summary> /// Returns <see cref="FooCategoryInfo"/> binding structure. /// </summary> /// <param name="fooId">ObjectType.demo_foo ID.</param> /// <param name="categoryId">Content category ID.</param> public static FooCategoryInfo GetFooCategoryInfo(int fooId, int categoryId) { return(ProviderObject.GetObjectQuery().TopN(1) .WhereEquals("FooID", fooId) .WhereEquals("CategoryID", categoryId) .FirstOrDefault()); }
/// <summary> /// Returns the NodeBazInfo structure. /// Null if binding doesn't exist. /// </summary> /// <param name="nodeId">Node ID</param> /// <param name="bazId">ObjectType.demo_baz ID</param> protected virtual NodeBazInfo GetNodeBazInfoInternal(int nodeId, int bazId) { return(ProviderObject.GetObjectQuery().TopN(1) .WhereEquals("NodeID", nodeId) .WhereEquals("BazID", bazId) .FirstOrDefault()); }
/// <summary> /// Returns the FooBarInfo structure. /// Null if binding doesn't exist. /// </summary> /// <param name="fooId">ObjectType.demo_foo ID</param> /// <param name="barId">ObjectType.demo_bar ID</param> protected virtual FooBarInfo GetFooBarInfoInternal(int fooId, int barId) { return(ProviderObject.GetObjectQuery().TopN(1) .WhereEquals("FooID", fooId) .WhereEquals("BarID", barId) .FirstOrDefault()); }
/// <summary> /// Sets (updates or inserts) specified <see cref="SlugGenerationQueueInfo"/>. /// </summary> /// <param name="infoObj"><see cref="SlugGenerationQueueInfo"/> to be set.</param> public static void SetSlugGenerationQueueInfo(SlugGenerationQueueInfo infoObj) { // Set required field if not set. if (DataHelper.GetNull(infoObj.GetValue("SlugGenerationQueueRunning")) == null) { infoObj.SlugGenerationQueueRunning = false; } ProviderObject.SetInfo(infoObj); }
/// <summary> /// Reloads data. /// </summary> public override void ReloadData() { if (!StopProcessing && (ProviderObject != null)) { TreeView.Nodes.Clear(); TreeView.EnableViewState = false; // Add custom root node if (CustomRootNode != null) { if (!EnableRootAction) { CustomRootNode.SelectAction = TreeNodeSelectAction.None; } TreeView.Nodes.Add(CustomRootNode); RaiseOnPopulateRootNode(); } else { if (MultipleRoots) { // Load all roots DataSet ds = ProviderObject.LoadData(ProviderObject.ParentIDColumn + " IS NULL"); if (!DataHelper.DataSourceIsEmpty(ds)) { foreach (DataRow dr in ds.Tables[0].Rows) { // Add all results as roots UniTreeNode rootNode = new UniTreeNode(ProviderObject, ""); rootNode.ItemData = dr; TreeView.Nodes.Add(CreateNode(rootNode)); } } } else // Add root node from provider if (ProviderObject.RootNode != null) { mRootNode = CreateNode((UniTreeNode)ProviderObject.RootNode); RaiseOnNodeCreated((UniTreeNode)ProviderObject.RootNode, ref mRootNode); mRootNode.Expanded = true; TreeView.Nodes.Add(mRootNode); } } } }
/// <summary> /// Handle node is populated. /// </summary> private void OnNodePopulate(TreeNode node) { if ((ProviderObject != null) && (node != null)) { string[] splitted = node.Value.Split('_'); int nodeID = ValidationHelper.GetInteger(splitted[0], 0); // Get node object type string nodeObjectType = string.Empty; if (splitted.Length == 2) { nodeObjectType = splitted[1]; } // Get child nodes SiteMapNodeCollection childNodes = ProviderObject.GetChildNodes(node.Value, node.Depth + 1); // Add to treeview foreach (UniTreeNode childNode in childNodes) { // Get ID int childNodeId = (int)(((DataRow)childNode.ItemData)[ProviderObject.IDColumn]); // Get object type string childNodeType = string.Empty; if (!string.IsNullOrEmpty(ProviderObject.ObjectTypeColumn)) { childNodeType = ValidationHelper.GetString((((DataRow)childNode.ItemData)[ProviderObject.ObjectTypeColumn]), ""); } // Don't insert one object more than once if ((childNodeId != nodeID) || (nodeObjectType != childNodeType)) { TreeNode createdNode = CreateNode(childNode); if (OnNodeCreated != null) { createdNode = OnNodeCreated((DataRow)childNode.ItemData, createdNode); } if (createdNode != null) { node.ChildNodes.Add(createdNode); } } } } }
/// <summary> /// Sets (updates or inserts) specified <see cref="RedirectionTableInfo"/>. /// </summary> /// <param name="infoObj"><see cref="RedirectionTableInfo"/> to be set.</param> public static void SetRedirectionTableInfo(RedirectionTableInfo infoObj) { ProviderObject.SetInfo(infoObj); UpdateCache(); }
/// <summary> /// Returns <see cref="PageBuilderContainerInfo"/> with specified ID. /// </summary> /// <param name="id"><see cref="PageBuilderContainerInfo"/> ID.</param> public static PageBuilderContainerInfo GetPageBuilderContainerInfo(int id) { return(ProviderObject.GetInfoById(id)); }
/// <summary> /// Sets specified <see cref="TreeCategoryInfo"/>. /// </summary> /// <param name="infoObj"><see cref="TreeCategoryInfo"/> to set.</param> public static void SetTreeCategoryInfo(TreeCategoryInfo infoObj) { ProviderObject.SetInfo(infoObj); }
/// <summary> /// Deletes specified <see cref="TreeCategoryInfo"/> binding. /// </summary> /// <param name="infoObj"><see cref="TreeCategoryInfo"/> object.</param> public static void DeleteTreeCategoryInfo(TreeCategoryInfo infoObj) { ProviderObject.DeleteInfo(infoObj); }
/// <summary> /// Deletes specified <see cref="PageBuilderContainerSiteInfo"/> binding. /// </summary> /// <param name="infoObj"><see cref="PageBuilderContainerSiteInfo"/> object.</param> public static void DeletePageBuilderContainerSiteInfo(PageBuilderContainerSiteInfo infoObj) { ProviderObject.DeleteInfo(infoObj); }
/// <summary> /// Sets (updates or inserts) specified LocationInfo. /// </summary> /// <param name="infoObj">LocationInfo to be set</param> public static void SetLocationInfo(LocationInfo infoObj) { ProviderObject.SetLocationInfoInternal(infoObj); }
/// <summary> /// Deletes specified AppointmentInfo. /// </summary> /// <param name="infoObj">AppointmentInfo to be deleted</param> public static void DeleteAppointmentInfo(AppointmentInfo infoObj) { ProviderObject.DeleteAppointmentInfoInternal(infoObj); }
/// <summary> /// Returns <see cref="RedirectionTableInfo"/> with specified ID. /// </summary> /// <param name="id"><see cref="RedirectionTableInfo"/> ID.</param> public static RedirectionTableInfo GetRedirectionTableInfo(int id) { return(ProviderObject.GetInfoById(id)); }
/// <summary> /// Returns AppointmentInfo with specified GUID. /// </summary> /// <param name="guid">AppointmentInfo GUID</param> public static AppointmentInfo GetAppointmentInfo(Guid guid) { return(ProviderObject.GetAppointmentInfoInternal(guid)); }
/// <summary> /// Returns LocationInfo with specified name. /// </summary> /// <param name="name">LocationInfo name</param> public static LocationInfo GetLocationInfo(string name) { return(ProviderObject.GetLocationInfoInternal(name)); }
/// <summary> /// Returns AppointmentInfo with specified name. /// </summary> /// <param name="name">AppointmentInfo name</param> public static AppointmentInfo GetAppointmentInfo(string name) { return(ProviderObject.GetAppointmentInfoInternal(name)); }
/// <summary> /// Returns a query for all the AppointmentInfo objects. /// </summary> public static ObjectQuery <AppointmentInfo> GetAppointments() { return(ProviderObject.GetAppointmentsInternal()); }
/// <summary> /// Deletes specified LocationInfo. /// </summary> /// <param name="infoObj">LocationInfo to be deleted</param> public static void DeleteLocationInfo(LocationInfo infoObj) { ProviderObject.DeleteLocationInfoInternal(infoObj); }
/// <summary> /// Returns <see cref="PageBuilderContainerInfo"/> with specified name. /// </summary> /// <param name="name"><see cref="PageBuilderContainerInfo"/> name.</param> public static PageBuilderContainerInfo GetPageBuilderContainerInfo(string name) { return(ProviderObject.GetInfoByCodeName(name)); }
/// <summary> /// Returns a query for all the LocationInfo objects. /// </summary> public static ObjectQuery <LocationInfo> GetLocations() { return(ProviderObject.GetLocationsInternal()); }
/// <summary> /// Returns all <see cref="PageBuilderContainerSiteInfo"/> bindings. /// </summary> public static ObjectQuery <PageBuilderContainerSiteInfo> GetPageBuilderContainerSites() { return(ProviderObject.GetObjectQuery()); }
/// <summary> /// Returns all <see cref="TreeCategoryInfo"/> bindings. /// </summary> public static ObjectQuery <TreeCategoryInfo> GetTreeCategories() { return(ProviderObject.GetObjectQuery()); }
/// <summary> /// Sets specified <see cref="PageBuilderContainerSiteInfo"/>. /// </summary> /// <param name="infoObj"><see cref="PageBuilderContainerSiteInfo"/> to set.</param> public static void SetPageBuilderContainerSiteInfo(PageBuilderContainerSiteInfo infoObj) { ProviderObject.SetInfo(infoObj); }
/// <summary> /// Deletes specified <see cref="RedirectionTableInfo"/>. /// </summary> /// <param name="infoObj"><see cref="RedirectionTableInfo"/> to be deleted.</param> public static void DeleteRedirectionTableInfo(RedirectionTableInfo infoObj) { ProviderObject.DeleteInfo(infoObj); UpdateCache(); }
/// <summary> /// Sets (updates or inserts) specified AppointmentInfo. /// </summary> /// <param name="infoObj">AppointmentInfo to be set</param> public static void SetAppointmentInfo(AppointmentInfo infoObj) { ProviderObject.SetAppointmentInfoInternal(infoObj); }
/// <summary> /// Returns LocationInfo with specified GUID. /// </summary> /// <param name="guid">LocationInfo GUID</param> public static LocationInfo GetLocationInfo(Guid guid) { return(ProviderObject.GetLocationInfoInternal(guid)); }