Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if ((Boolean)Session["admin"] == true)
                {
                    string username = "******" + Application["user"].ToString().ToUpper();
                    Label1.Text = username;
                }
                rpBanTin.DataSource = dt.bantin_selectall();
                rpBanTin.DataBind();

                rpRandom.DataSource = dt.chitiet_selectrandom();
                rpRandom.DataBind();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int?so       = null;
            int id       = Convert.ToInt32(Request["ID"]);
            int idbantin = Convert.ToInt32(Request["idbantin"]);

            //lấy dữ liệu trong sql:
            dt.chitiet_lanxem(id, ref so);
            if (so == null)
            {
                so = 0;
            }
            int gt = Convert.ToInt32(so) + 1;

            // tăng số lượt xem
            dt.ChiTiet_solanxem(gt, id);
            rpBanTin.DataSource = dt.bantin_selectid(id);
            rpBanTin.DataBind();
            rpChiTiet.DataSource = dt.ChiTiet_SelectID(idbantin, id);
            rpChiTiet.DataBind();
            rpRandom.DataSource = dt.chitiet_selectrandom();
            rpRandom.DataBind();
        }