Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session[Constant.Keys.AUTH] != null)
     {
         User user = (User)Session[Constant.Keys.AUTH];
         if (user.RoleID == 2)
         {
             int     id = Int32.Parse(Request.QueryString["id"]);
             Product p  = ProductHandler.get(id);
             updateCartNameTxt.Text        = p.Name;
             updateCartPriceTxt.Text       = p.Price.ToString();
             updateCartStockTxt.Text       = p.Stock.ToString();
             updateCartProductTypeTxt.Text = ProductTypeHandler.getProductType(p.ProductTypeID);
         }
         else
         {
             var redirecTo = Constant.Routes.HOME_ROUTE;
             Response.Redirect(redirecTo);
         }
     }
     else
     {
         var redirecTo = Constant.Routes.HOME_ROUTE;
         Response.Redirect(redirecTo);
     }
 }
Beispiel #2
0
 public List <ProductTypes> getProductType()
 {
     return(productTypeHdlr.getProductType());
 }