예제 #1
0
        private void drawOrders(PlaceHolder _orderList)
        {
            var temp = new Order();
            User user = (User) Session["UserToken"];
            var orders = temp.getAllWhere("usid = '"+user.id.ToString()+"'");

            foreach (var orid in orders.Keys)
            {
                _orderList.Controls.Add(new LiteralControl("<p>"+orders[orid].read("shid", true)+" " +
                    "<a href=\"show_orders.aspx?orid="+orders[orid].id.ToString()+"\">Delete Order</a></p>"));
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!LoginHelper.redirectByAuthenticated("user")) {
                    ContentPlaceHolderContent = null;
                }

            if (Request["orid"] != null) {
                Order order = new Order();
                order.id = int.Parse(Request["orid"]);
                order.delete();
            }

            drawOrders(orderList);
        }
예제 #3
0
 private void doOrder(Order order)
 {
     User user = (User) Session["UserToken"];
     order.write("usid", user.id);
     order.insert();
     Response.Redirect("order_ticket.aspx?success=true");
 }
예제 #4
0
 private void orderClick(object sender, System.EventArgs e)
 {
     Order order = new Order();
     order.write("tickets", int.Parse(((TextBox)ticketOrder.FindControl("numOfTickets")).Text));
     order.write("price", 55.0);
     order.write("shid", int.Parse(((HiddenField)ticketOrder.FindControl("hiddenShid")).Value));
     if (LoginHelper.loggedIn()) {
         doOrder(order);
     }
     else {
         Session["tmpOrder"] = order;
         Response.Redirect("order_ticket.aspx?login=true");
     }
 }