Beispiel #1
0
        public void getdata()
        {
            int type = gettype();

            title = NewsTypeService.GetTypeName(type);
            this.uc_breadcrumb.Title = title;
            string s = NewsTypeService.GetNewsTypeById(type).issimple.ToString();

            if (s == "0")
            {
                issimple = false;



                this.rpNewslist.DataSource = pds();
                this.rpNewslist.DataBind();
            }
            else if (s == "1")
            {
                issimple = true;

                this.rpsimple.DataSource = NewsService.GetSimpleNews(type);
                this.rpsimple.DataBind();
            }
            else
            {
                Response.Redirect("news_pic.aspx?type=" + type);
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["del"] != null)
                {
                    NewsService.SetDelete(int.Parse(Request["del"]), true);
                    //Response.Write(Request["reUrl"].Replace("|", "&"));
                    //Response.End();
                    string backurl = BackPage(pds(), Request["reUrl"].Replace("|", "&"), "news_manage.aspx?page=" + (pds().CurrentPageIndex - 1).ToString() + getcanshu());

                    Response.Redirect(backurl);
                    //Response.Redirect(Request["reUrl"].Replace("|", "&"));
                }
                else if (Request["id"] != null && Request["comm"] != null)
                {
                    NewsService.SetComm(int.Parse(Request["id"]), Request["comm"] == "1"?true:false);
                    Response.Redirect(Request.UrlReferrer.ToString());
                }
                else if (Request["id"] != null && Request["flag"] != null)
                {
                    NewsService.SetFlag(int.Parse(Request["id"]), Request["flag"] == "1"?true:false);
                    Response.Redirect(Request.UrlReferrer.ToString());
                }
                else if (Request["id"] != null && Request["istop"] != null)
                {
                    NewsService.SetTop(int.Parse(Request["id"]), Request["istop"] == "1"?true:false);
                    Response.Redirect(Request.UrlReferrer.ToString());
                }
                else
                {
                    title = NewsTypeService.GetTypeName(int.Parse(Request["type"]));
                }

                ddlType.DataSource     = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"]));
                ddlType.DataTextField  = "typename";
                ddlType.DataValueField = "id";
                ddlType.DataBind();


                //int nid = 12;
                //for (int i = 0; i < nt.DefaultView.Count;i++ )
                //{
                //    if (nt.DefaultView[i]["id"].ToString() == "86")
                //    {
                //        nid = i;
                //    }
                //}
                //if(Request["type"]=="4")
                //{ nt.Rows.RemoveAt(nid); }
                this.rpNewsType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"]));
                this.rpNewsType.DataBind();
                //ddlType.Items.Insert(0, new ListItem("请选择分类", "0"));
                rtNews.DataSource = pds();
                rtNews.DataBind();
            }
        }
Beispiel #3
0
        protected string GetTypeName(object type)
        {
            int t = 0;

            if (type != null)
            {
                t = Convert.ToInt32(type);
            }
            return(NewsTypeService.GetTypeName(t));
        }
Beispiel #4
0
        public void getdata()
        {
            int type = gettype();

            //Response.Write(type);
            //Response.End();
            //NewsType newsob = NewsTypeService.GetNewsTypeById(type);
            title = NewsTypeService.GetTypeName(type);
            //title =
            this.uc_breadcrumb.Title   = title;
            this.rpNewslist.DataSource = pds();
            this.rpNewslist.DataBind();
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["del"] != null)
                {
                    News ob = NewsService.GetNewsById(int.Parse(Request["del"]));

                    if (ob != null)
                    {
                        if (File.Exists(MapPath(ob.img)))
                        {
                            File.Delete(MapPath(ob.img));
                        }
                        if (File.Exists(MapPath(ob.upfile)))
                        {
                            File.Delete(MapPath(ob.upfile));
                        }
                        NewsService.DeleteNews(ob);
                    }


                    string backurl = BackPage(pds(), Request["reUrl"].Replace("|", "&"), "news_recyle.aspx?page=" + (pds().CurrentPageIndex - 1).ToString() + getcanshu());
                    Response.Redirect(backurl);
                }
                else if (Request["back"] != null && Request["back"] != "")
                {
                    NewsService.SetDelete(int.Parse(Request["back"]), false);
                    Response.Redirect(Request.UrlReferrer.ToString());
                }
                else
                {
                    title = NewsTypeService.GetTypeName(int.Parse(Request["type"])) + "回收";
                }

                ddlType.DataSource     = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"]));
                ddlType.DataTextField  = "typename";
                ddlType.DataValueField = "id";
                ddlType.DataBind();

                this.rpNewsType.DataSource = NewsTypeService.GetChildTypeByParentId(int.Parse(Request["type"]));
                this.rpNewsType.DataBind();
                //ddlType.Items.Insert(0, new ListItem("请选择分类", "0"));
                rtNews.DataSource = pds();
                rtNews.DataBind();
            }
        }
Beispiel #6
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();
            }
        }
Beispiel #7
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();
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lbTitle.Text = NewsTypeService.GetTypeName(int.Parse(Request["type"]));
            path1        = MapPath(App_ImgPath);
            path2        = MapPath(App_FilePath);
            if (Request["edit"] != null)
            {
                sbEdit.Visible  = true;
                Submit1.Visible = false;
                btBack.Visible  = true;
            }
            else
            {
                sbEdit.Visible  = false;
                Submit1.Visible = true;
                btBack.Visible  = false;
            }
            if (!IsPostBack)
            {
                //if(Request["type"]=="63")
                //{
                //    this.tbfile.Visible = true;
                //}

                this.ddlptype.DataSource     = NewsTypeService.GetChildTypeByParentId(0);
                this.ddlptype.DataTextField  = "typename";
                this.ddlptype.DataValueField = "id";
                this.ddlptype.DataBind();

                // this.ddlptype.Items.Remove(this.ddlptype.Items.FindByValue("10"));

                this.ddlptype.SelectedValue = Request["type"];



                ddlType.DataSource     = NewsTypeService.GetChildTypeByParentId(int.Parse(this.ddlptype.SelectedValue));
                ddlType.DataTextField  = "typename";
                ddlType.DataValueField = "id";
                ddlType.DataBind();


                //ddlType.Items.Insert(0, new ListItem("请选择分类", "0"));
                tbTime.Text = DateTime.Now.ToString();
                if (Request["edit"] != null)
                {
                    hdUrl.Value = Request.UrlReferrer.ToString();
                    News ob = NewsService.GetNewsById(int.Parse(Request["edit"]));

                    if (ob != null)
                    {
                        tbTitle.Text          = ob.title;
                        tbTitle2.Text         = ob.title2;
                        tbSource.Text         = ob.source;
                        ddlType.SelectedValue = ob.type.ToString();

                        //ftbContent.Value = n["content"].ToString();
                        txtFull.Text                    = ob.content;
                        rbComm.SelectedValue            = ob.flag == true?"1":"0";
                        tbTime.Text                     = ob.addtime.ToString("yyyy-MM-dd");
                        tbAuthor.Text                   = ob.author;
                        tbfile.Text                     = ob.upfile;
                        this.tburl.Text                 = ob.url;
                        this.rbisdiredict.SelectedValue = ob.isdiredict == true?"1":"0";
                        if (!string.IsNullOrEmpty(ob.img))
                        {
                            Image1.Visible = true;
                            //Image1.ImageUrl = n["img"].ToString();
                            Image1.ImageUrl  = "" + ob.img;
                            btDelImg.Visible = true;
                        }
                        if (!string.IsNullOrEmpty(ob.upfile))
                        {
                            btDelFile.Visible = true;
                        }
                    }
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!LJH.Rank.IsModuleRank(1401))
            // {
            //    Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>");
            //     Response.End();
            // }
            if (Request["edit"] != null)
            {
                sbEdit.Visible  = true;
                Submit1.Visible = false;
                btBack.Visible  = true;
            }
            else
            {
                sbEdit.Visible  = false;
                Submit1.Visible = true;
                btBack.Visible  = false;
            }
            if (Request["del"] != null)
            {
                NewsTypeService.DeleteNewsType(int.Parse(Request["del"]));
                Response.Redirect(Request["reUrl"].Replace("|", "&"));
            }
            if (!IsPostBack)
            {
                if (Request["edit"] != null)
                {
                    hdUrl.Value = Request.UrlReferrer.ToString();
                    NewsType n = NewsTypeService.GetNewsTypeById(int.Parse(Request["edit"]));

                    if (n != null)
                    {
                        tbTitle.Text             = n.typename;
                        rbIssimple.SelectedValue = n.issimple.ToString();
                        tbSord.Text = n.sort.ToString();
                        if (n.p_id == 0)
                        {
                            trIssimple.Visible = false;
                            hlBack.Text        = "顶级分类";
                        }
                        else
                        {
                            trIssimple.Visible = true;
                            hlBack.NavigateUrl = "news_type.aspx?id=" + n.p_id.ToString();
                            hlBack.Text        = NewsTypeService.GetTypeName(n.p_id);
                        }
                    }
                }
                else if (Request["id"] != null)
                {
                    trIssimple.Visible = true;

                    NewsType n = NewsTypeService.GetNewsTypeById(int.Parse(Request["id"]));


                    if (n != null)
                    {
                        hlBack.Text = n.typename;
                        if (n.p_id != 0)
                        {
                            hlBack.NavigateUrl = "news_type.aspx?id=" + n.p_id.ToString();
                        }
                        else
                        {
                            hlBack.NavigateUrl = "news_type.aspx";
                        }
                    }
                }

                else
                {
                    trIssimple.Visible = false;
                    hlBack.Text        = "顶级分类";
                }

                if (Request["isdefault"] != null && Request["eid"] != null)
                {
                    bool isdefault = Request["isdefault"] == "0" ? false : true;
                    NewsTypeService.SetIsDefault(isdefault, int.Parse(Request["eid"]));

                    Response.Redirect(Request.UrlReferrer.ToString());
                }
            }
            Bind();
        }