Exemplo n.º 1
0
        public int gettype()
        {
            int type = 11;

            try
            {
                if (Request["type"] != null)
                {
                    int pid = NewsTypeService.GetPid(int.Parse(Request["type"]));
                    if (pid == 0)//是父类
                    {
                        type = NewsTypeService.GetTypeidByPid(int.Parse(Request["type"]));
                    }
                    else
                    {
                        type = int.Parse(Request["type"]);
                    }
                }
            }
            catch (Exception e)
            {
                Response.Redirect("page404.aspx?e=" + "error type");
            }

            return(type);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            dptype = NewsTypeService.GetChildTypeByParentIdDefault(0);

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["type"]))
                {
                    int ptype = int.Parse(Request["type"]);
                    int pid   = NewsTypeService.GetPid(int.Parse(Request["type"]));
                    if (pid == 0)
                    {
                        ptype = int.Parse(Request["type"]);
                    }
                    else
                    {
                        ptype = pid;
                    }
                    _cssType = ptype.ToString();
                }
            }
        }
Exemplo n.º 3
0
        public void getdata()
        {
            string type = "";

            if (Request["type"] != null)
            {
                type = Request["type"];
            }
            else if (Request["id"] != null)
            {
                type = NewsService.GetTypeId(int.Parse(Request["id"])).ToString();
            }
            if (type != "")
            {
                int ptype = int.Parse(type);
                int pid   = NewsTypeService.GetPid(int.Parse(type));
                if (pid == 0)
                {
                    title  = NewsTypeService.GetTypeName(int.Parse(type));
                    _ptype = int.Parse(type);
                }
                else
                {
                    title  = NewsTypeService.GetTypeName(pid);
                    ptype  = pid;
                    _ptype = pid;
                }
                this.rpMenu.DataSource = NewsTypeService.GetChildTypeByParentId(ptype);
                this.rpMenu.DataBind();
                _ctype = Convert.ToInt32(type);
            }
            else
            {
                title = NewsTypeService.GetTypeName(1);
                this.rpMenu.DataSource = NewsTypeService.GetChildTypeByParentId(1);
                this.rpMenu.DataBind();
            }
        }
Exemplo n.º 4
0
        public void getdata()
        {
            if (Request["id"] != null)
            {
                int type = NewsService.GetTypeId(int.Parse(Request["id"]));

                int pid = NewsTypeService.GetPid(type);
                if (pid == 0)
                {
                    //title = LJH.NewsType.GetTypeName(type);
                    this.uc_menu.CssType = type.ToString();
                }
                else
                {
                    this.uc_menu.CssType = pid.ToString();
                }
                //string title = NewsTypeService.GetTypeName(type);
                this.uc_breadcrumb.Title = NewsTypeService.GetTypeName(type);
                // title =LJH.NewsType.GetTypeName(type);
                this.rpNews.DataSource = NewsService.GetNews(int.Parse(Request["id"]));
                this.rpNews.DataBind();
            }
        }