Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)

        {
            string mode  = Request.QueryString["mode"];
            string email = Request.QueryString["user"];

            users  = QueryClass.GetUsers();
            orders = QueryClass.GetOrders();
            if (mode != null)
            {
                //Suspend a user
                if (mode.Equals("toggleSuspend") && !((User)Session["user"]).Email.Equals(email))
                {
                    QueryClass.ToggleSuspendUser(email);

                    users = QueryClass.GetUsers();
                }
                //Delete a user
                if (mode.Equals("delete") && !((User)Session["user"]).Email.Equals(email))
                {
                    QueryClass.ToggleDeleteUser(email);

                    users = QueryClass.GetUsers();
                }
            }
        }
Esempio n. 2
0
        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"];
            orders = QueryClass.GetOrders();

            if (mode != null && order != null)
            {
                if (mode.Equals("toggleSent"))
                {
                    if (GlobalData.Orders[Convert.ToInt32(order)].Status.Equals("Processing"))
                    {
                        GlobalData.Orders[Convert.ToInt32(order)].Status = "Sent";
                    }
                    else if (GlobalData.Orders[Convert.ToInt32(order)].Status.Equals("Sent"))
                    {
                        GlobalData.Orders[Convert.ToInt32(order)].Status = "Processing";
                    }
                }
            }
        }