Esempio n. 1
0
        void PurchaseTicketButton_Click(object sender, EventArgs e)
        {
            string productGuid = "48EC4927-CC02-41A9-A7F9-C450163F020B";

            Session["OrderRemarks"] = null;
            if (VegetarianMealCheckBox.Checked)
            {
                Session["OrderRemarks"] = "Vegetarian Option";
            }
            else
            {
                Session.Remove("OrderRemarks");
            }

            OEObject oe       = new OEObject();
            int      quantity = Convert.ToInt16(PurchaseQuantityDDL.SelectedValue);

            int  i        = 1;
            Guid newOrder = oe.CreateNewOrder(this.CurrentConsultant.ConsultantsGuid, "2018 Fashion Weekend");

            while (newOrder == Guid.Empty)
            {
                newOrder = oe.CreateNewOrder(this.CurrentConsultant.ConsultantsGuid, "2018 Fashion Weekend" + i);
                i++;
            }
            CurrentOrderGuid = newOrder.ToString();
            oe.AddToBag(newOrder, new Guid(productGuid), quantity);
            Response.Redirect("~/Business/Shopping/ConsultantCheckout.aspx");
            Response.End();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OEObject oe = new OEObject();

            DataTable ProductDetailsTable = oe.FetchProductDetails(ProductNumber);

            if (ProductDetailsTable.Rows.Count > 0)
            {
                DataRow ProductDetailsRow  = ProductDetailsTable.Rows[0];
                string  hasOptions         = ProductDetailsRow["HasOptions"].ToString();
                int     productsCount      = ProductsCount;
                int     quantityAvailable  = Convert.ToInt16(ProductDetailsRow["UnallocatedCount"]);
                string  baseLinkConsultant = "http://jjpro.justjewelry.com/Business/Shopping/";


                QuantityAvailable     = quantityAvailable;
                ProductName.InnerHtml = ProductDetailsRow["Description"].ToString();
                ProductImageLink.Attributes.Add("href", baseLinkConsultant + "Item.aspx?Item=" + ProductDetailsRow["ProductNumber"].ToString());
                ProductImageLink.Attributes.Add("target", "_blank");
                ProductImage.Src             = ProductDetailsRow["Image1Url"].ToString();
                ProductRetailPrice.InnerHtml = ProductDetailsRow["Price"].ToString();
                ProductSalePrice.InnerHtml   = ProductDetailsRow["SalePrice"].ToString();
                if (ProductDetailsRow["SalePrice"].ToString() == String.Empty)
                {
                    ProductRetailPrice.Attributes.Remove("class");
                }
                if (hasOptions == "false")
                {
                }

                if (hasOptions == "true")
                {
                    ProductHasOptions = true;
                    DataTable ProductOptionsTable = oe.FetchProductOptions(new Guid(ProductDetailsRow["ProductsGuid"].ToString()));
                    ListItem  defaultOption       = new ListItem();
                    int       availableQuantity   = 0;
                    defaultOption.Attributes.Add("value", "default");
                    defaultOption.Text = "Select Option";
                    ProductOptions.Items.Add(defaultOption);

                    if (ProductOptionsTable.Rows.Count > 0)
                    {
                        foreach (DataRow row in ProductOptionsTable.Rows)
                        {
                            ListItem option = new ListItem();
                            option.Attributes.Add("value", row["Key"].ToString());
                            option.Value = row["Key"].ToString();
                            option.Text  = row["Value"].ToString();
                            ProductOptions.Items.Add(option);
                            availableQuantity = Convert.ToInt16(row["QuantityAvailable"]);
                            quantityAvailable = quantityAvailable + availableQuantity;
                        }

                        QuantityAvailable = quantityAvailable;
                        if (availableQuantity <= 0)
                        {
                            ProductContainer.Style.Add("display", "none");
                        }
                    }
                    else
                    {
                        ProductContainer.Style.Add("display", "none");
                    }
                }
                else
                {
                    ProductOptions.Style.Add("display", "none");
                }

                if (quantityAvailable <= 0)
                {
                    ProductContainer.Style.Add("display", "none");
                }

                switch (ProductsCount)
                {
                case 1:
                    ProductContainer.Attributes.Add("class", "col-lg-12 col-sm-12 text-center CartOfferProducts");

                    break;

                case 2:
                    ProductContainer.Attributes.Add("class", "col-lg-6 col-sm-12 text-center CartOfferProducts");

                    break;

                case 3:
                    ProductContainer.Attributes.Add("class", "col-lg-4 col-sm-12 text-center CartOfferProducts");

                    break;

                case 4:
                    ProductContainer.Attributes.Add("class", "col-lg-3 col-sm-12 text-center CartOfferProducts");

                    break;
                }
            }
        }