当前位置: 首页>>代码示例>>C#>>正文


C# TreeProvider.SelectSingleDocument方法代码示例

本文整理汇总了C#中TreeProvider.SelectSingleDocument方法的典型用法代码示例。如果您正苦于以下问题:C# TreeProvider.SelectSingleDocument方法的具体用法?C# TreeProvider.SelectSingleDocument怎么用?C# TreeProvider.SelectSingleDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeProvider的用法示例。


在下文中一共展示了TreeProvider.SelectSingleDocument方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditForm_OnAfterSave

    /// <summary>
    /// Handles the OnAfterSave event of the EditForm control.
    /// </summary>
    private void EditForm_OnAfterSave(object sender, EventArgs e)
    {
        if (UIFormControl.EditedObject != null)
        {
            // Log widget variant synchronization
            MVTVariantInfo variantInfo = (MVTVariantInfo)UIFormControl.EditedObject;

            // Clear cache
            CacheHelper.TouchKey("om.mvtvariant|bytemplateid|" + variantInfo.MVTVariantPageTemplateID);

            if (variantInfo.MVTVariantDocumentID > 0)
            {
                // Log synchronization
                TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser);
                TreeNode node = tree.SelectSingleDocument(variantInfo.MVTVariantDocumentID);
                DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);
            }
        }
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:22,代码来源:Edit.ascx.cs

示例2: gridData_OnExternalDataBound


//.........这里部分代码省略.........

                    // Emphasize the number when product needs to be reordered
                    if (availableItems <= reorderAt)
                    {
                        // Format message informing about insufficient stock level
                        string reorderMsg = string.Format(GetString("com.sku.reorderatTooltip"), reorderAt);
                        string message = string.Format("<span class=\"alert-status-error\" onclick=\"UnTip()\" onmouseout=\"UnTip()\" onmouseover=\"Tip('{1}')\">{0}</span>", availableItems, reorderMsg);
                        inlineAvailableItems.FormattedText = message;
                    }
                };

                // Unigrid with delayed reload in combination with inline edit control requires additional postback to sort data.
                // Update data only if external data bound is called for the first time.
                if (!forceReloadData)
                {
                    inlineAvailableItems.Update += (s, e) =>
                    {
                        var newNumberOfItems = ValidationHelper.GetInteger(inlineAvailableItems.Text, availableItems);

                        if (ValidationHelper.IsInteger(inlineAvailableItems.Text) && (-1000000000 <= newNumberOfItems) && (newNumberOfItems <= 1000000000))
                        {
                            CheckModifyPermission(sku);

                            // Ensures that grid will display inserted value
                            sku.SKUAvailableItems = newNumberOfItems;

                            // Document list is used to display products -> document has to be updated to ensure correct sku mapping
                            if (DocumentListingDisplayed)
                            {
                                int documentId = ValidationHelper.GetInteger(row.Row["DocumentID"], 0);

                                // Create an instance of the Tree provider and select edited document with coupled data
                                TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser);
                                TreeNode document = tree.SelectSingleDocument(documentId);

                                if (document == null)
                                {
                                    return;
                                }

                                document.SetValue("SKUAvailableItems", newNumberOfItems);
                                document.Update();

                                forceReloadData = true;
                            }
                            // Stand-alone product -> only product has to be updated
                            else
                            {
                                sku.MakeComplete(true);
                                sku.Update();

                                gridData.ReloadData();
                            }
                        }
                        else
                        {
                            inlineAvailableItems.ErrorText = GetString("com.productedit.availableitemsinvalid");
                        }
                    };
                }

                return inlineAvailableItems;

            case "skuprice":

                SKUInfo product = new SKUInfo(row.Row);
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:67,代码来源:Product_List.aspx.cs

示例3: RaiseCallbackEvent

    /// <summary>
    /// Callback event handler.
    /// </summary>
    /// <param name="argument">Callback argument</param>
    public void RaiseCallbackEvent(string argument)
    {
        // Check permissions
        if ((CMSContext.CurrentUser == null)
            || (!CMSContext.CurrentUser.IsAuthorizedPerResource("CMS.MVTest", "Manage"))
            || stopProcessing)
        {
            return;
        }

        // Get arguments
        if (!string.IsNullOrEmpty(argument))
        {
            string[] args = argument.Split(new char[] { ';' }, 3);
            if (args.Length == 3)
            {
                string combinationName = ValidationHelper.GetString(args[0], string.Empty);
                string action = args[1].ToLower();
                string newValue = args[2];

                // Get the combination info
                MVTCombinationInfo mvtcInfo = MVTCombinationInfoProvider.GetMVTCombinationInfo(combinationSelector.PageTemplateID, combinationName);
                if (mvtcInfo != null)
                {
                    switch (action)
                    {
                        case "cname":
                            // Custom name changed
                            mvtcInfo.MVTCombinationCustomName = newValue;
                            if (string.IsNullOrEmpty(newValue))
                            {
                                newValue = mvtcInfo.MVTCombinationName;
                            }
                            // return the new value (when newValue=="", then return combination code name)
                            callbackValue = newValue;
                            break;

                        case "enabled":
                            // combination Enabled changed
                            mvtcInfo.MVTCombinationEnabledOriginal = mvtcInfo.MVTCombinationEnabled;
                            mvtcInfo.MVTCombinationEnabled = ValidationHelper.GetBoolean(newValue, true);
                            callbackValue = string.Empty;
                            break;

                        default:
                            return;
                    }

                    MVTCombinationInfoProvider.SetMVTCombinationInfo(mvtcInfo);

                    // Synchronize widget variants if enabling combination
                    if ((mvtcInfo.MVTCombinationDocumentID > 0)
                        || (!mvtcInfo.MVTCombinationEnabledOriginal && mvtcInfo.MVTCombinationEnabled
                        ))
                    {
                        // Log synchronization
                        TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
                        TreeNode node = tree.SelectSingleDocument(mvtcInfo.MVTCombinationDocumentID);
                        DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);
                    }
                }
            }
        }
    }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:68,代码来源:CombinationPanel.ascx.cs

示例4: EditForm_OnAfterSave

    /// <summary>
    /// Handles the OnAfterSave event of the EditForm control.
    /// </summary>
    protected void EditForm_OnAfterSave(object sender, EventArgs e)
    {
        if (UIFormControl.EditedObject != null)
        {
            // Clear cache
            CacheHelper.TouchKey("om.personalizationvariant|bytemplateid|" + (UIFormControl.EditedObject as ContentPersonalizationVariantInfo).VariantPageTemplateID);

            // Log widget variant synchronization
            ContentPersonalizationVariantInfo variantInfo = (ContentPersonalizationVariantInfo)UIFormControl.EditedObject;
            if (variantInfo.VariantDocumentID > 0)
            {
                // Log synchronization
                TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
                TreeNode node = tree.SelectSingleDocument(variantInfo.VariantDocumentID);
                DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);
            }
        }
    }
开发者ID:KuduApps,项目名称:Kentico,代码行数:21,代码来源:Edit.ascx.cs

示例5: gridElem_OnAction

    /// <summary>
    /// Handles UniGrid's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of the action which should be performed</param>
    /// <param name="actionArgument">ID of the item the action should be performed with</param>
    protected void gridElem_OnAction(string actionName, object actionArgument)
    {
        if (!CheckPermissions("CMS.ContentPersonalization", CMSAdminControl.PERMISSION_MODIFY))
        {
            return;
        }

        int variantId = ValidationHelper.GetInteger(actionArgument, 0);
        if (variantId > 0)
        {
            string action = actionName.ToLower();
            switch (action)
            {
                case "delete":
                    {
                        // Get the instance in order to clear the cache
                        ContentPersonalizationVariantInfo vi = ContentPersonalizationVariantInfoProvider.GetContentPersonalizationVariant(variantId);

                        // Delete the object
                        ContentPersonalizationVariantInfoProvider.DeleteContentPersonalizationVariant(variantId);
                        this.RaiseOnAction(string.Empty, null);

                        // Log widget variant synchronization
                        if ((vi != null) && (vi.VariantDocumentID > 0))
                        {
                            // Log synchronization
                            TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
                            TreeNode node = tree.SelectSingleDocument(vi.VariantDocumentID);
                            DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);
                        }

                        // Clear the variants from the cache
                        if (vi != null)
                        {
                            ReloadWebPartCache(vi.VariantZoneID, vi.VariantInstanceGUID);
                        }

                        // Reload data
                        gridElem.ReloadData();
                    }
                    break;

                case "up":
                case "down":
                    {
                        // Get the instance in order to clear the cache
                        ContentPersonalizationVariantInfo vi = ContentPersonalizationVariantInfoProvider.GetContentPersonalizationVariant(variantId);

                        // Use try/catch due to license check
                        try
                        {
                            if (action == "up")
                            {
                                // Move up
                                ContentPersonalizationVariantInfoProvider.MoveVariantUp(variantId);
                            }
                            else
                            {
                                // Move down
                                ContentPersonalizationVariantInfoProvider.MoveVariantDown(variantId);
                            }

                            this.RaiseOnAction(string.Empty, null);

                            // Log widget variant synchronization
                            if ((vi != null) && (vi.VariantDocumentID > 0))
                            {
                                // Log synchronization
                                TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
                                TreeNode node = tree.SelectSingleDocument(vi.VariantDocumentID);
                                DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);
                            }
                        }
                        catch (Exception ex)
                        {
                            lblError.Visible = true;
                            lblError.Text = ex.Message;
                        }

                        // Clear the variants from the cache
                        if (vi != null)
                        {
                            ReloadWebPartCache(vi.VariantZoneID, vi.VariantInstanceGUID);
                        }
                    }
                    break;
            }
        }
    }
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:94,代码来源:List.ascx.cs


注:本文中的TreeProvider.SelectSingleDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。