首页 > 开发 > 综合 > 正文

杂志目录(页面部分CodeBehind)

2024-07-21 02:16:50
字体:
来源:转载
供稿:网友

using system;
using system.data;
using system.data.sqlclient;


using system.web;
using system.web.ui;
using system.web.ui.webcontrols;




namespace cj168.web
{
    /// <summary>
    /// summary description for showissuecat.
    /// </summary>
    public class showissuecat : system.web.ui.page
    {
        protected system.web.ui.webcontrols.label lbmaginfo;

        protected system.web.ui.webcontrols.datalist datalistmagcat;
        protected system.web.ui.webcontrols.datalist datalistshowmagarttitlelevel2;
        protected system.web.ui.webcontrols.datalist datalistshowmagarttitlelevel1;
        protected system.web.ui.webcontrols.datalist datalist1;

        protected system.web.ui.webcontrols.datalist datalistshowmagarttitlelevel3;
        
        protected system.web.ui.webcontrols.linkbutton linkbutton;
        protected system.web.ui.webcontrols.adrotator adrotator1;
        protected system.web.ui.webcontrols.label lbartdetailtitle;

        protected system.web.ui.webcontrols.label lbartquotation;
        protected system.web.ui.webcontrols.label lbartmainheader;
        protected system.web.ui.webcontrols.label lbartsubheader;
        protected system.web.ui.webcontrols.label lbartviewpoint;
        protected system.web.ui.webcontrols.label lbartpageno;
        protected system.web.ui.webcontrols.label lbartcontent;


    
        
    
        public showissuecat()
        {
            page.init += new system.eventhandler(page_init);
        }

        protected void page_load(object sender, eventargs e)
        {
            // put user code to initialize the page here

            //if (!ispostback)
            //{
                



                showcat();
            

            //}

        }

        //void binddata(int magid, int magyear, int yearissue)
        


        void showcat()
        {
            string magname = request.params["magname"];
            int magid = int32.parse(request.params["magid"]);
            int magyear = int32.parse(request.params["magyear"]);
            int yearissue = int32.parse(request.params["yearissue"]);
            
            

            //if (strmagname != string.empty && strmagid != string.empty  && strmagyear != string.empty && stryearissue != string.empty)
            //{
            

            lbmaginfo.text = magname + " " + magyear + "年度 第" + yearissue + "期";
            //}
            //else
            //{
            //    lbmaginfo.text = "参数有错";
            //}


            cj168.dataaccess.magsdb showmagissuecat = new cj168.dataaccess.magsdb();
            datalistmagcat.datasource = showmagissuecat.getmagissuecat(magid, magyear, yearissue);
            datalistmagcat.databind();
            

        }



        public dataset showsubcat(int magid, int magyear, int yearissue, int catid)
        {

            cj168.dataaccess.magsdb showsubcat = new cj168.dataaccess.magsdb();
            dataset dr = showsubcat.getsubcat(magid, magyear, yearissue, catid);

            return dr;
            
        }

        public dataset showmagarttitle(int catissueid)
        {        

            cj168.dataaccess.magsdb showmagarttitle = new cj168.dataaccess.magsdb();
            dataset dr = showmagarttitle.getmagarttitle(catissueid);
            
            return dr;
            
        }

        public string showarturl(int artid)
        {
            string magname = request.params["magname"];
            int magid = int32.parse(request.params["magid"]);
            int magyear = int32.parse(request.params["magyear"]);
            int yearissue = int32.parse(request.params["yearissue"]);

            return "showissuecat.aspx?magname=" + magname + "&magid=" + magid + "&magyear=" + magyear + "&yearissue=" + yearissue + "&txtid="+ artid;

        }

        public void arttitlelinkbutton_click(object sender, eventargs e)
        {        
            int artid = ((linkbutton)sender).tabindex;
            cj168.dataaccess.magsdb showartdetail = new cj168.dataaccess.magsdb();
            dataset mydataset = showartdetail.getartdetail(artid);

            datarowview myrowview = mydataset.tables["artdetail"].defaultview[0];

            if (myrowview["quotation"].tostring().trim() != string.empty)
            {
                lbartquotation.visible = true;
                lbartquotation.text = "<div class='quotation'>" + myrowview["quotation"].tostring() + "</div>";
            }
            else
            {
                lbartquotation.visible = false;
            }

            lbartmainheader.text = "<div class='mainheader'>" + myrowview["mainheader"].tostring() + "</div>";
            if(myrowview["subheader"].tostring().trim() != string.empty)
            {
                lbartsubheader.visible = true;
                lbartsubheader.text = "<div class='subheader'>" + myrowview["subheader"].tostring() + "</div>";
            }
            else
            {
                lbartsubheader.visible = false;
            }

            if(myrowview["viewpoint"].tostring().trim() != string.empty)
            {    lbartviewpoint.visible = true;
                lbartviewpoint.text = "<div class='viewpoint'>" + myrowview["viewpoint"].tostring() + "</div>";
            }
            else
            {    lbartviewpoint.visible = false;
            }

            lbartpageno.text = "<div class='pageno'>" + "页数:" + myrowview["pageno"].tostring() + "</div>";

            lbartcontent.text = "<div class='content'>" + myrowview["content"].tostring() + "</div>";

        }


        protected void page_init(object sender, eventargs e)
        {
            //
            // codegen: this call is required by the asp.net web form designer.
            //
            initializecomponent();
        }

        //#region web form designer generated code
        /// <summary>
        /// required method for designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void initializecomponent()
        {    
            this.load += new system.eventhandler(this.page_load);

        }
        //#endregion
    }
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表