using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Data;

public partial class inClude_bottom : System.Web.UI.UserControl
{
    public string appKey = "1234";

    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();
        dbDataFunction db = new dbDataFunction();

        if (!IsPostBack)
        {
            //导航及产品
            bottomNav.Text = "<a href=\"/\" target=\"_top\">网站首页</a>";
            DataTable dt = db.getDataTable("select Tid,TreeName from newsTree where TreeID=0 and TreeType='taobaoke' order by ListID ASC,Tid ASC");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string tid = dt.Rows[i]["Tid"].ToString().Trim();
                string treeName = dt.Rows[i]["TreeName"].ToString().Trim();

                bottomNav.Text += "&nbsp;<span class=\"headLine\">|</span>&nbsp;<a href=\"/" + tid + ".htm\" target=\"_top\">" + treeName + "</a>";
            }
            dt.Dispose();

            miibeian.Text = xc.readXmlData("xabara.config", "miibeian");
            webTitle.Text = xc.readXmlData("xabara.config", "webName");
            webVer.Text = xc.readXmlData("xabara.config", "webVer");

            yearLab.Text = DateTime.Now.Year.ToString();

            countStr.Text = xc.readXmlData("xabara.config", "countScript");

            string qqID = xc.readXmlData("xabara.config", "qq");
            qqLink.Text = xc.QQHTM(qqID, "41");

            string tbID = xc.readXmlData("xabara.config", "taobao");
            tbLink.Text = xc.taobaoHTM(tbID, "1");

            string tel = xc.readXmlData("xabara.config", "freePhone");
            if (!string.IsNullOrEmpty(tel as string))
            {
                telInfo.Text = tel + "&nbsp;";
            }
            tel = xc.readXmlData("xabara.config", "mobile");
            if (!string.IsNullOrEmpty(tel as string))
            {
                telInfo.Text += tel + "&nbsp;";
            }
            tel = xc.readXmlData("xabara.config", "webTel");
            if (!string.IsNullOrEmpty(tel as string))
            {
                telInfo.Text += tel + "&nbsp;";
            }

            appKey = xc.readXmlData("xabara.config", "taobaoKeAppKey");
        }
    }
}