protected void ddlDepartments_SelectedIndexChanged(object sender, EventArgs e) { if (ddlDepartments.SelectedItem.Text.EndsWith("- OSMS")) { MunchieServiceRef.TheWebService pxy = new MunchieServiceRef.TheWebService(); string department = ddlDepartments.SelectedIndex.ToString(); DataSet ds = pxy.GetProductCatalog(department); rptProducts.DataSource = ds; rptProducts.DataBind(); } else if (ddlDepartments.SelectedItem.Text.EndsWith("- ACO")) { ApocalypseWebRef.TP_WebService apocProxy = new ApocalypseWebRef.TP_WebService(); DataSet apocDS = apocProxy.getCatalog(int.Parse(ddlDepartments.SelectedValue)); apocDS.Tables[0].Columns[0].ColumnName = "ProductID"; apocDS.Tables[0].Columns[1].ColumnName = "Description"; apocDS.Tables[0].Columns[2].ColumnName = "Price"; apocDS.Tables[0].Columns[3].ColumnName = "QuantityOnHand"; apocDS.Tables[0].Columns[4].ColumnName = "DepartmentNumber"; apocDS.Tables[0].Columns[5].ColumnName = "URL"; rptProducts.DataSource = apocDS; rptProducts.DataBind(); } else { string value = ddlDepartments.SelectedValue.Replace(" - Jungle", ""); JungleServiceRef.MerchantStore jungProxy = new JungleServiceRef.MerchantStore(); DataSet jungDS = jungProxy.GetProductCatalog(value); jungDS.Tables[0].Columns[0].ColumnName = "ProductID"; jungDS.Tables[0].Columns[1].ColumnName = "Description"; jungDS.Tables[0].Columns[2].ColumnName = "Price"; jungDS.Tables[0].Columns[3].ColumnName = "QuantityOnHand"; jungDS.Tables[0].Columns[4].ColumnName = "DepartmentNumber"; jungDS.Tables[0].Columns[5].ColumnName = "URL"; rptProducts.DataSource = jungDS; rptProducts.DataBind(); } }
protected void btnCheckOut_Click(object sender, EventArgs e) { string[] purcInfo = new string[15]; TP_Amazon_ClassLibrary.Cart cart = (TP_Amazon_ClassLibrary.Cart)Session["Cart"]; string merchantname = ""; for (int i = 0; i < cart.cartItems.Count; i++) { merchantname = cart.cartItems[i].Product.merchantName; if (merchantname == "One Stop Munchie Shop") { string prodID = cart.cartItems[i].Product.ProductID.ToString(); int prodQuantity = cart.cartItems[i].Quantity; string apikey = "ef2b1305-07ee-4712-be15-35f82b367a94"; MunchieServiceRef.TheWebService prxy = new MunchieServiceRef.TheWebService(); purcInfo[0] = Session["emailSession"].ToString(); purcInfo[1] = txtCustName.Text; purcInfo[2] = txtAddress.Text; purcInfo[3] = txtCity.Text; purcInfo[4] = txtState.Text; purcInfo[5] = txtCountry.Text; purcInfo[6] = TextBox5.Text; purcInfo[7] = TextBox2.Text; purcInfo[8] = TextBox3.Text; purcInfo[9] = TextBox4.Text; purcInfo[10] = TextBox6.Text; purcInfo[11] = ddlCreditCardList.SelectedItem.Text; purcInfo[12] = ddlCreditCardList.SelectedValue; prxy.Purchase(prodID, prodQuantity, apikey, purcInfo); //Email, CardNum, Products insertIntoPurchase(purcInfo[0], purcInfo[11], prodID); } else { int prodQuantity = cart.cartItems[i].Quantity; string prodID = cart.cartItems[i].Product.ProductID.ToString(); ApocalypseWebRef.TP_WebService apocprxy = new ApocalypseWebRef.TP_WebService(); apocprxy.Purchase(prodID, prodQuantity, "Apocalypse Trading Co", "403f3304-f069-485a-b971-f47778dbbc77", purcInfo); } } // string emailBody = "<p>Works!!</p>s"; // TP_Amazon_ClassLibrary.Cart cart = (TP_Amazon_ClassLibrary.Cart)Session["Cart"]; cart.ClearCart(); //Email emailSender = new Email(); //emailSender.SendMail("*****@*****.**", "*****@*****.**", "Reservation Confirmation", emailBody, "*****@*****.**"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["emailSession"] == null) { Response.Redirect("Login.aspx"); } else { //bind departments to dropdown using webservice method MunchieServiceRef.TheWebService pxy = new MunchieServiceRef.TheWebService(); ApocalypseWebRef.TP_WebService apocProxy = new ApocalypseWebRef.TP_WebService(); JungleServiceRef.MerchantStore jungProxy = new JungleServiceRef.MerchantStore(); DataSet munchieDS = pxy.GetDepartments(); DataSet apocDS = apocProxy.getDepartment(); DataSet jungDS = jungProxy.GetDepartments(); for (int i = 0; i < munchieDS.Tables[0].Rows.Count; i++) { ddlDepartments.Items.Add(new ListItem(munchieDS.Tables[0].Rows[i]["DepartmentName"].ToString() + " - OSMS", munchieDS.Tables[0].Rows[i]["DepartmentNumber"].ToString())); } for (int i = 0; i < apocDS.Tables[0].Rows.Count; i++) { ddlDepartments.Items.Add(new ListItem(apocDS.Tables[0].Rows[i][apocDS.Tables[0].Columns[1].ColumnName].ToString() + " - ACO", apocDS.Tables[0].Rows[i][apocDS.Tables[0].Columns[0].ColumnName].ToString())); } for (int i = 0; i < jungDS.Tables[0].Rows.Count; i++) { ddlDepartments.Items.Add(new ListItem(jungDS.Tables[0].Rows[i][jungDS.Tables[0].Columns[1].ColumnName].ToString() + " - Jungle", jungDS.Tables[0].Rows[i][jungDS.Tables[0].Columns[0].ColumnName].ToString() + " - Jungle")); } loadProducts(); } } }