コード例 #1
0
ファイル: BookShelf.aspx.cs プロジェクト: swg221456/wenqu
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         logoninfo lg = new logoninfo(Session["user"].ToString());
         lg             = bal.selectname(lg);
         this.user.Text = lg.Name;
         //string name = Session["user"].ToString();
         //string cmdText = "SELECT [bookName], [author], [type], [introduce], [path] FROM [ViewBook]";
         //string[] paramList = { "@type" };
         //object[] valueList = { name };
         //DataSet da = db.FillDataSet(cmdText, paramList, valueList);
         //GridView1.DataSource = da;
         //GridView1.DataSourceID = "";
         //GridView1.DataBind();
         //string cmdText2 = "SELECT [ebookName], [author], [type], [introduce], [path] FROM [ViewEbook]";
         //string[] paramList2 = { "@type" };
         //object[] valueList2 = { name };
         //DataSet da2 = db.FillDataSet(cmdText2, paramList2, valueList2);
         //GridView2.DataSource = da2;
         //GridView2.DataSourceID = "";
         //GridView2.DataBind();
     }
     else
     {
         Response.Redirect("Login.aspx");
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         logoninfo lg = new logoninfo(Session["user"].ToString());
         lg             = bal.selectname(lg);
         this.user.Text = lg.Name;
         this.loginli.Style["display"] = "none";
     }
     else
     {
         this.userli.Style["display"] = "none";
     }
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                logoninfo lg = new logoninfo(Session["user"].ToString());
                lg = bal.selectname(lg);

                this.user.Text = lg.Name;
            }
            else
            {
                this.user.Text = "登录";
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                logoninfo lg = new logoninfo(Session["user"].ToString());
                lg = bal.selectname(lg);

                this.user.Text = lg.Name;
            }
            else
            {
                Response.Redirect("Login.aspx");
            }


            string[] List = { "都市传奇", "玄幻", "仙侠修真", "灵异", "历史", "游戏竞技", "科幻", "武侠", "奇幻", "古代言情", "现代言情", "玄幻言情", "校园生活", "其他" };
            for (int i = 1; i < List.Length; i++)
            {
                DropDownList1.Items.Add(List[i]);
                DropDownList2.Items.Add(List[i]);
            }
        }
コード例 #5
0
ファイル: BookMessage.aspx.cs プロジェクト: swg221456/wenqu
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                logoninfo lg = new logoninfo(Session["user"].ToString());
                lg             = ball.selectname(lg);
                this.user.Text = lg.Name;
                this.loginli.Style["display"] = "none";
            }
            else
            {
                this.userli.Style["display"] = "none";
                this.textshuru.Visible       = false;
                this.Button4.Visible         = false;
            }


            this.name.Text = Session["name"].ToString();
            this.inth.Text = Session["type"].ToString();


            string cmdText = "select * from T_Comment where bookName =  @bookName";

            string[] paramList = { "@bookName" };
            object[] valueList = { this.name.Text };
            DataSet  da        = db.FillDataSet(cmdText, paramList, valueList);

            GridView1.DataSource   = da;
            GridView1.DataSourceID = "";
            GridView1.DataBind();



            if (Session["type"].ToString() == null)
            {
            }
            else if (Session["type"].ToString() == "e")
            {
                this.jieyue.Visible = false;
                string  name = Session["name"].ToString();
                UpEbook lg   = new UpEbook(name);
                lg = bll.selectebook(lg);
                if (lg.path != null)
                {
                    this.smname.Text   = lg.name.ToString();
                    this.name.Text     = lg.name.ToString();
                    this.inth.Text     = lg.inthro.ToString();
                    this.intrduce.Text = lg.intrduce.ToString();
                    this.smtype.Text   = lg.type.ToString();


                    this.Image1.ImageUrl = "~/UploadPic/" + lg.path.ToString() + " ";

                    Session["path"] = lg.path.ToString();
                }
                else
                {
                    this.Image1.ImageUrl = "~/image/pic1.jpg";
                }
            }
            else if (Session["type"].ToString() == "b")
            {
                string name = Session["name"].ToString();
                UpBook lg   = new UpBook(name);
                lg = bll.selectbook(lg);
                if (lg.path != null)
                {
                    this.smname.Text   = lg.name.ToString();
                    this.name.Text     = lg.name.ToString();
                    this.inth.Text     = lg.inthro.ToString();
                    this.intrduce.Text = lg.intrduce.ToString();
                    this.smtype.Text   = lg.type.ToString();

                    this.Image1.ImageUrl = "~/image/" + lg.path.ToString() + " ";
                }
                else
                {
                    this.Image1.ImageUrl = "~/image/pic1.jpg";
                }
            }
        }