using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Controls_ToolMenu : System.Web.UI.UserControl
{
    /// <summary>
    /// 导航名称(管理文件名)
    /// </summary>
    private string _NavName;
    /// <summary>
    /// 导航名称(管理文件名)
    /// </summary>
    public string NavName
    {
        set
        {
            _NavName = value;
        }
        get
        {
            return _NavName;
        }
    }

    /// <summary>
    /// 语言版本ID
    /// </summary>
    private Guid? _EditionID;
    /// <summary>
    /// 语言版本ID
    /// </summary>
    public Guid? EditionID
    {
        set
        {
            _EditionID = value;
        }
        get
        {
            return _EditionID;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        SetItem();
    }

    private void SetItem()
    {
        if (SnSee.Config.WebConfig.EditionAdmin)
        {
            toolItem.Visible = true;
        }
    }

    /// <summary>
    /// 删除当前语言版本
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lbtnEditionDel_Click(object sender, EventArgs e)
    {
        if (_EditionID.HasValue)
        {
            if (SnSee.Factory.Factory.Edition.Delete(_EditionID.Value))
            {
                SnSee.Tool.MessageTool.MessageBox(this.Page, "恭喜您，操作成功！", _NavName + ".aspx");
            }
        }
    }
}