protected void Page_Load(object sender, EventArgs e) { mode = Request.QueryString["mode"]; order = Request.QueryString["order"]; user = Request.QueryString["user"]; orders = QueryClass.GetOrders(); int orderID = 0; try { orderID = Convert.ToInt32(order); } catch { } //toggles sent if mode is toggleSent and order exists in url if (mode != null && order != null) { if (mode.Equals("toggleSent")) { //query for toggling sent QueryClass.OrderToggleSent(orderID); if (Request.QueryString["flagSingle"] != null) { orders = new List <Order>(); orders.Add(QueryClass.GetOrder(orderID)); } else { orders = QueryClass.GetOrders(); } } } //populates a single order if order exists in url if (order != null && mode == null) { orders = new List <Order>(); orders.Add(QueryClass.GetOrder(orderID)); } //populates by user if there is a user url param if (user != null) { orders = QueryClass.GetOrdersByUser(user); } }
protected void Page_Load(object sender, EventArgs e) { mode = Request.QueryString["mode"]; order = Request.QueryString["order"]; user = Request.QueryString["user"]; int i = 0; try { Convert.ToInt32(order); } catch { } if (mode == null && order != null) { orders = new List <Order>(); orders.Add(QueryClass.GetOrder(i)); } //if these are true, the user shouldnt be here if (user == null && order == null) { Response.Redirect("Main"); } orders = QueryClass.GetOrdersByUser(user); if (mode != null && order != null) { if (mode.Equals("toggleSent")) { try{ Convert.ToInt32(order); } catch { } //Change status of order if admin changes the status QueryClass.OrderToggleSent(i); } if (Request.QueryString["flagSingle"] == null) { orders = QueryClass.GetOrdersByUser(user); } else { orders = new List <Order>(); orders.Add(QueryClass.GetOrder(i)); } } }