Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.UrlReferrer != null)
                {
                    ViewState["RefUrl"] = Request.UrlReferrer.ToString();
                }
            }

            if (Session["OrderDetails"] != null)
            {
                odr = (OrderDetails)Session["OrderDetails"];
                populateConfiguredOrder();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Redirect to the Order Screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOrder_Click(object sender, EventArgs e)
        {
            int itemNumber = 1;
            string orderHTML = "";
            for(int i=1; i< 50; i++)//Hardcoded limit on how many configured components
            {
                if (Session["Comp" + i] != null)
                {
                    orderHTML = orderHTML + "ITEM #" + itemNumber + ": " + Session["Comp" + i].ToString() + "\n";
                    itemNumber++;
                }
            }

            OrderDetails odr = new OrderDetails();
            odr.Price = lblOrderPrice.Text;
            odr.Details = Regex.Replace(orderHTML, @"<[^>]+>|&nbsp;", "").Trim();

            Session["OrderDetails"] = null;
            Session["OrderDetails"] = odr;

            Response.Redirect("~/SubmitRequest.aspx");
        }
Beispiel #3
0
        /// <summary>
        /// Returns a list of all orders in the system
        /// </summary>
        /// <returns></returns>
        private static IEnumerable<OrderDetails> GetRecordsFromDatabaseWithFilter(string query)
        {
            Database db = new Database();
            List<OrderDetails> results = new List<OrderDetails>(); db.Connect();

            db.Query(query);

            if (db.rdr.HasRows == true)
            {
                while (db.rdr.Read())
                {
                    OrderDetails order = new OrderDetails();
                    order.ID = (Convert.ToString(db.rdr["ID"]));
                    order.Email = (Convert.ToString(db.rdr["Email"]));
                    order.OrderDate = (Convert.ToString(db.rdr["OrderDate"]));
                    order.Details = RemoveSpecialCharacters(Convert.ToString(db.rdr["OrderDetails"]).ToString());
                    order.Price = (Convert.ToString(db.rdr["TotalPrice"]));
                    order.Notes = (Convert.ToString(db.rdr["Notes"]));
                    results.Add(order);
                }
            }
            return results;
        }
Beispiel #4
0
        /// <summary>
        /// Redirect to the Order Screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOrder_Click(object sender, EventArgs e)
        {
            OrderDetails odr = new OrderDetails();
            odr.NumOfDoors = compDoors.SelectedIndex == -1 ? "N/A" : compDoors.SelectedItem.Text;
            odr.Details = "Component ID: " + Request.QueryString["CompId"].ToString()
                    + " W:" + compWidth.SelectedItem.Text + " D:" + compDepth.SelectedItem.Text + " H: " + compHeight.SelectedItem.Text
                    + " Doors:" + odr.NumOfDoors + " Material:" + compMaterial.SelectedItem.Text;

            odr.Price = compPrice.Value;

            Session["OrderDetails"] = null;
            Session["OrderDetails"] = odr;

            Response.Redirect("~/SubmitRequest.aspx");
        }