Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string ids = Request.QueryString["id"] + "";
            int    id  = 0;
            if (string.IsNullOrEmpty(ids) || !int.TryParse(ids, out id) || id <= 0)
            {
                Response.Redirect("/Default.aspx");
            }
            articles = bllArticles.GetModel(id);
            if (articles == null)
            {
                Response.Redirect("/Default.aspx");
            }
            bllArticles.UpdateClick(id);

            currentCategory = bllCategory.GetModel(articles.parentId);
            if (currentCategory != null)
            {
                LeftNavControl.navParentID      = currentCategory.parentID;
                LeftNavControl.navCode          = currentCategory.codeNo;
                LocationControl.currentCategory = currentCategory;

                parentCategory = bllCategory.GetModel(currentCategory.parentID);
                if (parentCategory != null)
                {
                    LocationControl.parentCategory = parentCategory;
                    LeftNavControl.navTitle        = parentCategory.title;
                    Page.Title = articles.title + "-" + currentCategory.title + "-" + parentCategory.title;


                    activeNav = LocationControl.GetNavName();
                }
                else
                {
                    LeftNavControl.navTitle = currentCategory.title;
                    Page.Title = articles.title + "-" + currentCategory.title;
                }
            }
            else
            {
                Response.Redirect("~/");
            }
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string code = Request.QueryString["code"] + "";
            if (string.IsNullOrEmpty(code))
            {
                code = "zxjj";
            }
            if (code.Equals("zxly"))
            {
                Response.Redirect("Message.aspx");
            }

            currentCategory = bllCategory.GetModel(code);
            if (currentCategory != null)
            {
                LocationControl.currentCategory = currentCategory;
                LeftNavControl.navParentID      = currentCategory.parentID;
                LeftNavControl.navCode          = code;
                parentCategory = bllCategory.GetModel(currentCategory.parentID);
                if (parentCategory != null)
                {
                    //set nav
                    LocationControl.parentCategory = parentCategory;
                    activeNav = LocationControl.GetNavName();

                    LeftNavControl.navTitle = parentCategory.title;
                    Page.Title = currentCategory.title + "-" + parentCategory.title;
                }
                else
                {
                    LeftNavControl.navTitle = currentCategory.title;
                    Page.Title = currentCategory.title;
                }
            }
            else
            {
                Response.Redirect("~/");
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string code = Request.QueryString["code"] + "";
            if (string.IsNullOrEmpty(code))
            {
                code = "zxjj";
            }

            currentCategory = bllCategory.GetModel(code);
            if (currentCategory != null)
            {
                LeftNavControl.navParentID      = currentCategory.parentID;
                LeftNavControl.navCode          = code;
                LocationControl.currentCategory = currentCategory;

                parentCategory = bllCategory.GetModel(currentCategory.parentID);
                if (parentCategory != null)
                {                    //set nav
                    LocationControl.parentCategory = parentCategory;
                    activeNav = LocationControl.GetNavName();

                    LeftNavControl.navTitle = parentCategory.title;
                    Page.Title = currentCategory.title + "-" + parentCategory.title;
                }
                else
                {
                    LeftNavControl.navTitle = currentCategory.title;
                    Page.Title = currentCategory.title;
                }

                rptSubCategory.DataSource = bllCategory.GetNextNodeByCode(currentCategory.codeNo);
                rptSubCategory.DataBind();
            }
            else
            {
                Response.Redirect("~/");
            }
        }
    }
Esempio n. 4
0
    private void InitData()
    {
        string code = Request.QueryString["code"] + "";

        if (string.IsNullOrEmpty(code))
        {
            code = "zxly";
        }

        currentCategory = bllCategory.GetModel(code);
        if (currentCategory != null)
        {
            LocationControl.currentCategory = currentCategory;
            LeftNavControl.navParentID      = currentCategory.parentID;
            LeftNavControl.navCode          = code;
            parentCategory = bllCategory.GetModel(currentCategory.parentID);
            if (parentCategory != null)
            {
                //set nav
                LocationControl.parentCategory = parentCategory;
                activeNav = LocationControl.GetNavName();

                LeftNavControl.navTitle = parentCategory.title;
                Page.Title = currentCategory.title + "-" + parentCategory.title;
            }
            else
            {
                LeftNavControl.navTitle = currentCategory.title;
                Page.Title = currentCategory.title;
            }
        }
        else
        {
            Response.Redirect("~/");
        }
    }