コード例 #1
0
ファイル: Message.aspx.cs プロジェクト: FZfangzheng/QQ_space
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            if (!IsPostBack)
            {
                string sql3 = "";
                if (Session["tourist"] != null)
                {
                    sql3 = "select * from Message where username='******' order by id desc";
                }
                else
                {
                    sql3 = "select * from Message where username='******' order by id desc";
                }
                DataTable dt2 = mymessage.select(sql3);

                RptPerson.DataSource = dt2;

                RptPerson.DataBind();
            }
        }
        else
        {
            Response.Write("<script>alert('尚未登录!');location='Login.aspx'</script>");
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            if (pnspecialfriend.Visible == true)

            {
                DataTable dt2 = new DataTable();

                DataTable dt1 = new DataTable();

                DataTable dt3 = new DataTable();

                int count, numble;

                string sql2 = "select otherusername from  Care where username='******'";

                dt3 = myspecial.select(sql2);//取出特别关心的用户

                count = dt3.Rows.Count;

                string sql1 = " ";

                for (numble = 0; numble < count; numble++)

                {
                    sql1 = "select * from Dynamic where username='******'";

                    dt1 = myspecial.select(sql1);

                    dt2.Merge(dt1);
                }
                //对视图进行排序,以ID大小进行降序排序
                DataView dv = new DataView(dt2);

                if (dt2 == null)

                {
                    dv.Sort = "id desc";

                    dt2 = dv.ToTable();
                }

                RptPerson.DataSource = dt2;

                RptPerson.DataBind();
            }
            //if(pnaddspecialfriend.Visible==true )
            // {
            DataBindToRepeater(1);
            // }
        }
        else
        {
            Response.Write("<script>alert('尚未登录!');location='Login.aspx'</script>");
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            if (!IsPostBack)
            {
                string sql3 = "";
                if (Session["tourist"] != null)
                {
                    label.Text = "他的说说";

                    saysay.Visible = false;

                    printsay.Visible = false;

                    sql3 = "select * from Dynamic where username='******' and class='say' order by id desc";
                }
                else
                {
                    label.Text = "我的说说";

                    sql3 = "select * from Dynamic where username='******' and class='say' order by id desc";
                }



                DataTable dt2 = mysay.select(sql3);

                RptPerson.DataSource = dt2;

                RptPerson.DataBind();
            }
        }
        else
        {
            Response.Write("<script>alert('尚未登录!');location='Login.aspx'</script>");
        }
    }
コード例 #4
0
ファイル: Homepage.aspx.cs プロジェクト: FZfangzheng/QQ_space
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            string sql1 = "";

            string sql2 = "";

            string sql3 = "";

            string sql4 = "";

            string sql5 = "";

            if (Session["tourist"] != null)
            {
                sql1 = "select * from Photo where username='******'";

                sql2 = "select * from Dynamic where username= '******'and class='say'";

                sql3 = "select * from Dairy where username='******'";

                sql4 = "select * from Login where username='******'";

                sql5 = "select * from Dynamic where username='******' order by id desc";
            }
            else
            {
                sql1 = "select * from Photo where username='******'";

                sql2 = "select * from Dynamic where username= '******'and class='say'";

                sql3 = "select * from Dairy where username='******'";

                sql4 = "select * from Login where username='******'";

                sql5 = "select * from Dynamic where username='******' order by id desc";
            }

            DataTable dt1 = myhome.select(sql1);

            DataTable dt2 = myhome.select(sql2);

            DataTable dt3 = myhome.select(sql3);

            DataTable dt4 = myhome.select(sql4);

            DataTable dt5 = myhome.select(sql5);

            numblephoto.Text = dt1.Rows.Count.ToString();

            numblesay.Text = dt2.Rows.Count.ToString();

            numbledairy.Text = dt3.Rows.Count.ToString();

            lbage.Text = dt4.Rows[0][5].ToString();

            lbsex.Text = dt4.Rows[0][4].ToString();

            lblocation.Text = dt4.Rows[0][6].ToString();

            if (!IsPostBack)
            {
                RptPerson.DataSource = dt5;

                RptPerson.DataBind();
            }
        }
        else
        {
            Response.Write("<script>alert('尚未登录!');location='Login.aspx'</script>");
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            if (!IsPostBack)
            {
                string sql3 = "";

                string sql2 = "";

                if (Session["tourist"] != null)
                {
                    saysay.Visible = false;

                    printsay.Visible = false;

                    sql3 = "select * from Dynamic where username='******'";

                    sql2 = "select otherusername from  Friend where myusername='******'";
                }
                else
                {
                    sql3 = "select * from Dynamic where username='******'";

                    sql2 = "select otherusername from  Friend where myusername='******'";
                }

                DataTable dt2 = mycenter.select(sql3);

                DataTable dt1 = new DataTable();

                DataTable dt3 = new DataTable();

                int count, numble;

                dt3 = mycenter.select(sql2);

                count = dt3.Rows.Count;

                string sql1 = "";

                for (numble = 0; numble < count; numble++)

                {
                    sql1 = "select * from Dynamic where username='******'";

                    dt1 = mycenter.select(sql1);

                    dt2.Merge(dt1);
                }
                //对视图进行排序,以ID大小进行降序排序
                DataView dv = new DataView(dt2);

                dv.Sort = "id desc";

                dt2 = dv.ToTable();

                RptPerson.DataSource = dt2;

                RptPerson.DataBind();
            }
        }
        else
        {
            Response.Write("<script>alert('尚未登录!');location='Login.aspx'</script>");
        }
    }