Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetPageContent(2);
     uiLabelTitle.Text = ds.Tables[0].Rows[0]["ArTitle"].ToString();
     uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArContent"].ToString());
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();

            uiRepeaterCats.DataSource = db.GetAllCats();
            uiRepeaterCats.DataBind();

            uiRepeaterGallery.DataSource = db.GetAllProducts();
            uiRepeaterGallery.DataBind();
        }
Ejemplo n.º 3
0
        private void BindProducts()
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();
            DataSet ds2 = new DataSet();
            ds = db.GetAllProductByCatID(Convert.ToInt32(Request.QueryString["cid"].ToString()));
            ds2 = db.GetCategoryContent(Convert.ToInt32(Request.QueryString["cid"].ToString()));

            uiLabelCategory.Text = ds2.Tables[0].Rows[0]["CategoryName"].ToString();
            PagedDataSource dt = new PagedDataSource();
            dt.DataSource = ds.Tables[0].DefaultView;
            dt.AllowPaging = true;
            dt.PageSize = 12;
            dt.CurrentPageIndex = PageIndex;
            uiLinkButtonPrev.Enabled = !dt.IsFirstPage;
            uiLinkButtonNext.Enabled = !dt.IsLastPage;
            uiLabelPages.Text = "Page " + (PageIndex + 1).ToString() + " of " + dt.PageCount.ToString() + " Pages";

            uiRepeaterProducts.DataSource = dt;
            uiRepeaterProducts.DataBind();
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["PID"] != null && !string.IsNullOrEmpty(Request.QueryString["PID"].ToString()))
     {
         int id = Convert.ToInt32(Request.QueryString["PID"].ToString());
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetPageContent(id);
         if (ds.Tables[0].Rows.Count != 0)
         {
             uiLabelTitle.Text = ds.Tables[0].Rows[0]["ArTitle"].ToString();
             uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArContent"].ToString());
         }
         else
         {
             Response.Redirect("Node.aspx?PID=2");
         }
     }
     else
     {
         Response.Redirect("Node.aspx?PID=2");
     }
 }