示例#1
0
    protected void ListCategoriesTreeNodeCreate(object sender, TreeNodeEventArgs e)
    {
        var node = e.Node;

        node.NavigateUrl = RedirectorBase.GetAbsoluteUrl(RedirectorAdmin.GetCategoryInfoPageUrl(int.Parse(node.Value)));
        node.Target      = "ContentFrame";
    }
示例#2
0
文件: Error.aspx.cs 项目: minskowl/MY
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (pageNotExists)
            {
                RedirectorAdmin.GoToDefaultPage();
                return;
            }

            BackLink.NavigateUrl = Request.Url.ToString();
            if (exception == null)
            {
                return;
            }

            if (AppSettings.ShowExceptions)
            {
                RealExceptionPanel.Visible = true;
                ExceptionTextBox.Text      = exception.ToString();
                // Message.Text = GetErrorMessage();

                MultiView1.ActiveViewIndex = 0;
            }
            else
            {
                MultiView1.ActiveViewIndex = 1;
            }
        }
        catch (Exception ex)
        {
            Log.Site.Fatal("Error show Exception: ", ex);
        }
    }
示例#3
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            return;
        }
        if (!Identifier.IsValid(RequestIntId))
        {
            RedirectorAdmin.GoToDefaultPage();
            return;
        }
        Knowledge knowledge = manager.GetByID(RequestIntId.Value);

        if (knowledge == null)
        {
            RedirectorAdmin.GoToDefaultPage();
            return;
        }

        if (!knowledge.CanView)
        {
            GoToPreviousPage();
            return;
        }
        buttonEdit.Visible      = knowledge.CanEdit;
        viewKnowledge.Knowledge = knowledge;
    }
示例#4
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!KbContext.CurrentKb.HasUserAdminPermission)
     {
         RedirectorAdmin.GoToUserEditPage(KbContext.CurrentUserId);
         return;
     }
 }
示例#5
0
 private void ShowCategory()
 {
     SetTitle(_category.CategoryID, _category.Name);
     buttonDelete.Visible   = true;
     buttonDelete.Text      = "Delete " + _category.Name + " Category";
     buttonUp.NavigateUrl   = RedirectorAdmin.GetCategoryInfoPageUrl(_category.ParentCategoryID ?? 0);
     buttonMove.NavigateUrl = RedirectorAdmin.GetCategoryMovePageUrl(_category.CategoryID);
 }
示例#6
0
 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         return;
     }
     buttonEditUser.Text        = KbContext.CurrentKb.GetCurrentUser().Login;
     buttonEditUser.NavigateUrl = RedirectorAdmin.GetUserEditPageUrl(KbContext.CurrentUserId);
     buttonEditUser.Target      = PageFrameset.ContentFrameName;
 }
示例#7
0
 /// <summary>
 /// Handles the Click event of the buttonDelete control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void buttonDelete_Click(object sender, EventArgs e)
 {
     _category = KbContext.CurrentKb.ManagerCategory.GetByID(_categoryId);
     if (_category == null)
     {
         RedirectorAdmin.GoToRootCategoryInfoPage();
         return;
     }
     KbContext.CurrentKb.ManagerCategory.Delete(_category);
     RedirectorAdmin.GoToCategoryInfoPage(_category.ParentCategoryID ?? 0);
 }
示例#8
0
    /// <summary>
    /// Handles the Click event of the buttonGotoCategory control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void buttonGotoCategory_Click(object sender, EventArgs e)
    {
        string matcher = textBoxCategoryMatcher.Text.Trim();

        if (string.IsNullOrEmpty(matcher))
        {
            return;
        }
        int categoryId;

        if (!int.TryParse(matcher, out categoryId))
        {
            categoryId = FindCategory(matcher);
        }

        if (Identifier.IsValid(categoryId))
        {
            ShowContent(RedirectorAdmin.GetCategoryInfoPageUrl(categoryId));
        }
        else
        {
            ShowContent(RedirectorAdmin.GetSearchPageUrl(matcher));
        }
    }
示例#9
0
 /// <summary>
 /// Handles the Click event of the buttonAdd control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonAddClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToCategoryAddPage(_categoryId);
 }
示例#10
0
 /// <summary>
 /// Handles the OnClick event of the buttonAddKnowledge control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void buttonAddKnowledge_OnClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToKnowledgeAddPage(_categoryId);
 }
示例#11
0
 /// <summary>
 /// Handles the Click event of the buttonEditKnowledge control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void buttonEditKnowledge_Click(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToKnowledgeEditPage(gridKnowledges.GetIntDataKey((Control)sender));
 }
示例#12
0
 /// <summary>
 /// Handles the Click event of the buttonEdit control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void buttonEdit_Click(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToCategoryEditPage(gridSubCategories.GetIntDataKey((Control)sender));
 }
示例#13
0
 /// <summary>
 /// Handles the OnClick event of the buttonEdit control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void buttonEdit_OnClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToKnowledgeEditPage(RequestIntId.Value);
 }
示例#14
0
 /// <summary>
 /// Handles the Click event of the ViewButton1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonViewCategory_Click(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToCategoryInfoPage(gridSubCategories.GetIntDataKey((Control)sender));
 }
示例#15
0
 /// <summary>
 /// Handles the Click event of the buttonAddUser control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonAddUserClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToUserAddPage();
 }
示例#16
0
 /// <summary>
 /// Handles the Click event of the buttonRights control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonRightsClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToUserRightsPage(gridUsers.GetIntDataKey((Control)sender));
 }
示例#17
0
 /// <summary>
 /// Handles the Click event of the buttonEdit control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonEditClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToKeywordEditPage(griKeywords.GetIntDataKey((Control)sender));
 }
示例#18
0
 /// <summary>
 /// Handles the Click event of the buttonAddKeyword control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void ButtonAddKeywordClick(object sender, EventArgs e)
 {
     RedirectorAdmin.GoToKeywordAddPage();
 }