コード例 #1
0
    /// <summary>
    /// Handles the ActionPerformed event of the HeaderActions control.
    /// </summary>
    protected void HeaderActions_ActionPerformed(object sender, CommandEventArgs e)
    {
        switch (e.CommandName.ToLowerCSafe())
        {
        case "removelayout":
            // Remove custom device layout
            PageTemplateDeviceLayoutInfo deviceLayout = PageTemplateDeviceLayoutInfoProvider.GetTemplateDeviceLayoutInfo(TemplateID, DeviceProfileID);
            PageTemplateDeviceLayoutInfoProvider.DeleteTemplateDeviceLayoutInfo(deviceLayout);

            ShowConfirmation(GetString("devicelayout.removed"));

            // Refresh the current page
            string refreshUrl = URLHelper.AddParameterToUrl(RequestContext.RawURL, "refreshParent", "1");
            URLHelper.Redirect(refreshUrl);
            break;
        }
    }
コード例 #2
0
    /// <summary>
    /// Devices the layouts grid_ on action.
    /// </summary>
    protected void deviceLayoutsGrid_OnAction(string actionName, object actionArgument)
    {
        // Check permissions
        bool isAuthorized = (MembershipContext.AuthenticatedUser.IsAuthorizedPerResource(ModuleName.DESIGN, "Design"));

        switch (actionName)
        {
        case "delete":
            int deviceProfileId = ValidationHelper.GetInteger(actionArgument, 0);
            if (deviceProfileId > 0)
            {
                // Check permissions
                if (isAuthorized)
                {
                    // Delete layout
                    PageTemplateDeviceLayoutInfo deviceLayout = PageTemplateDeviceLayoutInfoProvider.GetTemplateDeviceLayoutInfo(templateId, deviceProfileId);
                    PageTemplateDeviceLayoutInfoProvider.DeleteTemplateDeviceLayoutInfo(deviceLayout);
                }
            }

            break;
        }
    }
コード例 #3
0
 protected void deviceLayoutsGrid_OnAction(string actionName, object actionArgument)
 {
     switch (actionName)
     {
     case "delete":
         int deviceProfileId = ValidationHelper.GetInteger(actionArgument, 0);
         if (deviceProfileId > 0)
         {
             // Check permissions
             if (isAuthorised)
             {
                 // Delete layout
                 PageTemplateDeviceLayoutInfo deviceLayout = PageTemplateDeviceLayoutInfoProvider.GetTemplateDeviceLayoutInfo(PageTemplateID, deviceProfileId);
                 PageTemplateDeviceLayoutInfoProvider.DeleteTemplateDeviceLayoutInfo(deviceLayout);
             }
             else
             {
                 ShowError(GetString("general.actiondenied"));
             }
         }
         break;
     }
 }