using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Base;
using nspLable.Manage;

public partial class admin_Lable_SystemLable_SystemLableEdit : BasePage
{
    protected string LableUrl;
    protected string str;
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckRights("Template", "A1");
        if (!IsPostBack)
        {
            LableBind();
            Bind();
            
        }
    }
    private void Bind()
    {
        int id = int.Parse(Request.QueryString["ID"].ToString());
        str = new RSystemLable().GateItem(id).Title.Substring(new RSystemLable().GateItem(id).Title.IndexOf('_') + 1);

        LableUrl = "../Model/" + str + ".aspx?ID=" + id;
        this.DropDownList1.SelectedValue = str + ".aspx";
    }
    
    private void LableBind()
    {

        DataSet ds = new DataSet();
        ds.ReadXml(@Server.MapPath("~/xml/SystemLable.xml"));
        DropDownList1.DataSource = ds.Tables[0];
        DropDownList1.DataTextField = ds.Tables[0].Columns[1].ToString();
        DropDownList1.DataValueField = ds.Tables[0].Columns[0].ToString();
        DropDownList1.DataBind();
        DropDownList1.SelectedValue = str + ".aspx";
    }
}
