예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <Product> product = ItemAuthHandler.getProducts();

            var dataSource = product.Select(x => new
            {
                x.productID,
                x.productName,
                x.productStock,
                x.ProductType.productTypeName,
                x.productPrice
            });

            viewProduct.DataSource = dataSource;
            viewProduct.DataBind();

            if (Session["userrole"].ToString() == "Administrator")
            {
                adminPvl.Style.Add("display", "inline");
            }
            else
            {
                adminPvl.Style.Add("display", "none");
            }
        }
예제 #2
0
 public static List <Product> getProducts()
 {
     return(ItemAuthHandler.getProducts());
 }