Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["AccountName"] == null)
     {
         Response.Redirect("../Login/Login.aspx");
     }
     if (!IsPostBack)
     {
         BindData(Product_BUS.getAllProduct());
         txtSearch.Text = "";
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            List <DTO.Product> lst = Product_BUS.getAllProduct();
            var source             = lst.Select((item) =>
            {
                return(new
                {
                    Image = "../../../Admin/Img/images/" + (string.IsNullOrEmpty(item.Image) ? "noimg.png" : HttpUtility.UrlDecode(item.Image)),
                    Summary = HttpUtility.UrlDecode(item.Summary),
                    Price = item.Price.ToString() + "đ",
                    ProductID = item.ProductID,
                    ProductName = item.ProductName
                });
            });

            DataList1.DataSource = source;
            DataList1.DataBind();
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["AccountName"] == null)
     {
         Response.Redirect("../Login/Login.aspx");
     }
     proID   = Guid.Parse(Request.QueryString.Get("productID"));
     product = Product_BUS.GetEntityByID <DTO.Product>(proID);
     if (!IsPostBack)
     {
         txtProductInfo.Text = GetProductInfo();
         productImg.ImageUrl = "../../Img/images/" + (string.IsNullOrEmpty(product.Image) ? "noimg.png" : product.Image);
         //btnBack.Attributes.Add("onClick", "javascript:history.back(); return false;");
         LoadGift();
         //Load DropDownList tất cả sp
         List <DTO.Product> allProduct = Product_BUS.getAllProduct();
         ddlAllProduct.DataSource     = allProduct;
         ddlAllProduct.DataTextField  = "ProductName";
         ddlAllProduct.DataValueField = "ProductID";
         ddlAllProduct.DataBind();
     }
 }
Exemplo n.º 4
0
 protected void btnLamMoi_Click(object sender, EventArgs e)
 {
     BindData(Product_BUS.getAllProduct());
     txtSearch.Text = "";
 }