Esempio n. 1
0
    /// <summary>
    /// Gets and moves web template up. Called when the "Get and move template up" button is pressed.
    /// Expects the CreateWebTemplate method to be run first.
    /// </summary>
    private bool GetAndMoveWebTemplateUp()
    {
        // Get the web template
        WebTemplateInfo moveUpTemplate = WebTemplateInfoProvider.GetWebTemplateInfo("MyNewTemplate");

        if (moveUpTemplate != null)
        {
            // Move template up
            WebTemplateInfoProvider.MoveTemplateUp(moveUpTemplate.WebTemplateId);

            return(true);
        }

        return(false);
    }
 /// <summary>
 /// Handles the UniGrid's OnAction event.
 /// </summary>
 /// <param name="actionName">Name of item (button) that threw event</param>
 /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
 protected void UniGridModules_OnAction(string actionName, object actionArgument)
 {
     if (actionName == "edit")
     {
         URLHelper.Redirect("WebTemplate_Edit.aspx?webtemplateid=" + actionArgument);
     }
     else if (actionName == "delete")
     {
         WebTemplateInfoProvider.DeleteWebTemplateInfo(ValidationHelper.GetInteger(actionArgument, 0));
     }
     else if (actionName == "moveup")
     {
         // Move the item up in order
         WebTemplateInfoProvider.MoveTemplateUp(ValidationHelper.GetInteger(actionArgument, 0));
         UniGridModules.ReloadData();
     }
     else if (actionName == "movedown")
     {
         // Move the item down in order
         WebTemplateInfoProvider.MoveTemplateDown(ValidationHelper.GetInteger(actionArgument, 0));
         UniGridModules.ReloadData();
     }
 }