public string Confirmation_BillingAddress(OrderVariables oVars, string template) { string rtn_str = ""; try { if ((oVars.bill_to_fname.Length > 0) && (oVars.bill_to_lname.Length > 0)) { if (template == "gift") { rtn_str = oVars.bill_to_fname.ToUpper().Substring(0, 1) + oVars.bill_to_fname.ToLower().Substring(1) + " " + oVars.bill_to_lname.ToUpper().Substring(0, 1) + oVars.bill_to_lname.ToLower().Substring(1); } else { rtn_str = oVars.bill_to_fname.ToUpper().Substring(0, 1) + oVars.bill_to_fname.ToLower().Substring(1) + " " + oVars.bill_to_lname.ToUpper().Substring(0, 1) + oVars.bill_to_lname.ToLower().Substring(1) + "<br />"; rtn_str += ((oVars.bill_to_apt != null && oVars.bill_to_apt.ToString().Trim().Length > 0) ? oVars.bill_to_apt + ", " : "") + oVars.bill_to_address1; rtn_str += "<br />" + oVars.bill_to_city + ", " + oVars.bill_to_state + " " + oVars.bill_to_zipcode; } } else { rtn_str = ""; } } catch { rtn_str = ""; } return rtn_str; }
public DataTable Dynamic_Pixel(OrderVariables oVariables, string SPname, string pixcd) { CommonModels oComm = new CommonModels(); dbConn.dbConnector.dbConn oDBConn; DataTable pixeltb = new DataTable(); DataSet VpixData = new DataSet(); try { //DBConn and SP execution oDBConn = new dbConn.dbConnector.dbConn(); oDBConn.regKey = ConfigurationManager.AppSettings["SQLConn"].ToString(); VpixData = oDBConn.ExecSPReturnSingleDS(SPname, pixcd); pixeltb = VpixData.Tables[0]; return pixeltb; } catch (Exception ex) { oComm.SendEmail("Dynamic_Pixel() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); return null; } finally { oDBConn = null; pixeltb = null; VpixData = null; } }
public static OrderVariables AssignShippingToOrderVariable(OrderVariables oVariables, ShippingAddress newShippingAddress) { CommonModels oComm = new CommonModels(); //OrderVariables oVariables = new OrderVariables(); oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname = newShippingAddress.ShippingFirstName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname = newShippingAddress.ShippingLastName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1 = newShippingAddress.ShippingAddress1; oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt = newShippingAddress.ShippingAddress2; oVariables.ShipVars[oVariables.default_shp_id].ship_to_city = newShippingAddress.ShippingCity; oVariables.ShipVars[oVariables.default_shp_id].ship_to_state = newShippingAddress.ShippingState; oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode = newShippingAddress.ShippingZipCode; oVariables.referring_url = HttpContext.Current.Request.Url.ToString(); oVariables.ip_address = oComm.GetIPAddress(); oVariables.phone = newShippingAddress.ShippingPhone; oVariables.email = newShippingAddress.ShippingEmail; oVariables.bonus_option = false; if (newShippingAddress.isBonusSelected) { oVariables.bonus_option = true; } //Setting billing Address by default same as shipping address. // later on payment page it will be updated if shipping and biling not same oVariables.bill_to_fname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname; oVariables.bill_to_lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; oVariables.bill_to_address1 = oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1; oVariables.bill_to_apt = oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt; oVariables.bill_to_city = oVariables.ShipVars[oVariables.default_shp_id].ship_to_city; oVariables.bill_to_state = oVariables.ShipVars[oVariables.default_shp_id].ship_to_state; oVariables.bill_to_zipcode = oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode; return oVariables; }
public ActionResult CartDetails() { var oComm = new CommonModels(); OrderVariables oVariables = new OrderVariables(); ViewBag.fireFaceBookPixel = (Session["fireFaceBookPixel"] != null && Session["fireFaceBookPixel"].ToString() == "true") ? true : false; try { if (Session["NewOrderDetails"] != null) { oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables != null) { BindCartDetails(); AssignValuestoViewBag(2); ViewBag.BillZipCode = oVariables.bill_to_zipcode; } } } catch (Exception ex) { oComm.SendEmail("Upsell Page 2 deals <br />Exception Raised from Upsell Page 2 deals. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } return View(); }
public static OrderVariables AssignBillingToOrderVariable(OrderVariables oVariables, BillingDetails billingDetails) { //Assigning Billing Address details to OVariable //if (billingDetails.isBillingSameToShipping) //{ // oVariables.bill_to_fname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname; // oVariables.bill_to_lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; // oVariables.bill_to_address1 = oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1; // oVariables.bill_to_apt = oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt; // oVariables.bill_to_city = oVariables.ShipVars[oVariables.default_shp_id].ship_to_city; // oVariables.bill_to_state = oVariables.ShipVars[oVariables.default_shp_id].ship_to_state; // oVariables.bill_to_zipcode = oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode; //} //else //As we are setting billing and shipping address same on landing page if (billingDetails.isBillingSameToShipping == false) { oVariables.bill_to_fname = billingDetails.BillingFirstName.Trim(); oVariables.bill_to_lname = billingDetails.BillingLastName.Trim(); oVariables.bill_to_address1 = billingDetails.BillingAddress1.Trim(); oVariables.bill_to_apt = (!string.IsNullOrEmpty(billingDetails.BillingAddress2)) ? billingDetails.BillingAddress2.Trim() : ""; oVariables.bill_to_city = billingDetails.BillingCity.Trim(); oVariables.bill_to_state = billingDetails.BillingState.Trim(); oVariables.bill_to_zipcode = billingDetails.BillingZipCode.Trim(); } //Assigning Payment details to OVariable oVariables.credit_rule = "CCC"; oVariables.err = ""; if (oVariables.CCVars.Count > 0) { oVariables.CCVars[0].number = billingDetails.CreditCardNumber.Trim(); oVariables.CCVars[0].type = ""; oVariables.CCVars[0].expdate = billingDetails.CardExpiryMonth.Trim() + billingDetails.CardExpiryYear.Trim(); oVariables.CCVars[0].cvv = billingDetails.SecurityCode.Trim(); oVariables.CCVars[0].zipcode = billingDetails.CCBillZipCode;// billingDetails.BillingZipCode.Trim(); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } else { CCProperties oCCVars = new OrderEngine.CCProperties(); oVariables.payment_type = "CC"; oCCVars.number = billingDetails.CreditCardNumber.Trim(); oCCVars.type = ""; oCCVars.expdate = billingDetails.CardExpiryMonth.Trim() + billingDetails.CardExpiryYear.Trim(); oCCVars.cvv = billingDetails.SecurityCode.Trim(); oCCVars.zipcode = billingDetails.CCBillZipCode;// (billingDetails.BillingZipCode != null && billingDetails.BillingZipCode != "") ? billingDetails.BillingZipCode.Trim() : oVariables.bill_to_zipcode; // billingDetails.BillingZipCode.Trim(); oVariables.credit_rule = "CCC"; oVariables.CCVars.Add(oCCVars); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } return oVariables; }
public ActionResult home(FormCollection form) { if (Session["NewOrderDetails"] != null) { oVariables = Session["NewOrderDetails"] as OrderVariables; return RedirectToAction(oVariables.lastPageClientOn, "landers"); } return RedirectToAction("shipping", "landers"); }
public ActionResult Payment_399() { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["MonthList"] = UtilitiesModels.GetMonthNameList(); ViewData["YearList"] = UtilitiesModels.GetCardExpiryYearList(); OrderVariables oVariables = new OrderVariables(); OrderProcess oProcess = new OrderProcess(); CommonModels oComm = new CommonModels(); string cart_details, conf_pg_tac, total = ""; string shipall = "false"; string template = ""; string pixel = ""; try { if (Session["NewSBMDetails"] != null) { oVariables = (OrderVariables)Session["NewSBMDetails"]; Dictionary<string, string> d = oComm.GetOfferCreatives(oVariables); ViewBag.HeaderImageSrc = oComm.GetDictionaryValue("payment_header", d); if ((string)Request.QueryString["shipall"] != null) { shipall = (string)Request.QueryString["shipall"]; } if ((string)Request.QueryString["template"] != null) { template = (string)Request.QueryString["template"]; } string cartId = oVariables.cart_id.ToString(); conf_pg_tac = oVariables.PageVars[0].conf_pg_tac; cart_details = oComm.ResponsivePayment_GiftingProducts(oVariables, Convert.ToBoolean(shipall), template); total = String.Format("{0:c}", oVariables.total_amt + oVariables.tax_amt + oVariables.total_sah); ViewBag.IsBonusSelected = false; if (oVariables.bonus_option == true) { ViewBag.IsBonusSelected = true; } ViewBag.CartSummary = cart_details; ViewBag.Cart = cartId; ViewBag.Total = total; ViewBag.ConfPgTAC = conf_pg_tac; return View(); } else { return RedirectToAction("Three_99", "Elmo", routeValues: ViewContextExtensions.OptionalParamters(Request.QueryString)); } } catch (Exception ex) { oComm.SendEmail("Exception Raised in EM Landers Payment Page - " + ex.Message.ToString()); return View(); } finally { oComm = null; oVariables = null; } }
public ActionResult OrderDetails() { var oComm = new CommonModels(); OrderVariables oVariables = new OrderVariables(); try { if (Session["NewOrderDetails"] != null) { oVariables = Session["NewOrderDetails"] as OrderVariables; string serviceUrl = ConfigurationManager.AppSettings["iservice"].ToString(); if (oVariables != null) { BindCartDetails(); serviceUrl += "getupselloffers/?token=741889E3-4565-40A1-982A-F15F7A923D72&UpsellId=" + oVariables.upsellId.ToString() + "&PromotionId=" + oVariables.campaign_id + "&format=json"; //serviceUrl += "getupselloffers/?token=741889E3-4565-40A1-982A-F15F7A923D72&UpsellId=19790613&PromotionId=12469&format=json"; connectIServices connectIServices = new connectIServices(); string obj = connectIServices.returnJson(serviceUrl); var yourOjbect = new JavaScriptSerializer().DeserializeObject(obj); List<object> offerList = new List<object>(); object[] O_bookList; int i = 0; foreach (var item1 in (Dictionary<string, object>)yourOjbect) { i++; var item2 = item1.Value; if (i < 2) { O_bookList = (object[])item2; offerList = O_bookList.ToList(); } } BindOfferDetails(offerList); AssignValuestoViewBag(1); ViewBag.BillZipCode = oVariables.bill_to_zipcode; } } } catch (Exception ex) { oComm.SendEmail("Upsell Page 1 deals <br />Exception Raised from Upsell Page 1 deals. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } return View(); }
public string Confirmation_ShippingAddress(OrderVariables oVars) { string rtn_str = ""; int i = 0; bool isNotOneShot = false; while (i < oVars.ShipVars.Count) { if (oVars.ShipVars[i].offer_type == "B") { isNotOneShot = true; if (oVars.ShipVars[i].ship_to_fname.Trim().Length > 0) { rtn_str = oVars.ShipVars[i].ship_to_fname.ToUpper().Substring(0, 1) + oVars.ShipVars[i].ship_to_fname.ToLower().Substring(1) + " " + oVars.ShipVars[i].ship_to_lname.ToUpper().Substring(0, 1) + oVars.ShipVars[i].ship_to_lname.ToLower().Substring(1) + "<br />"; rtn_str += (oVars.ShipVars[i].ship_to_apt != null && (oVars.ShipVars[i].ship_to_apt.ToString().Trim().Length > 0) ? oVars.ShipVars[i].ship_to_apt + ", " : "") + oVars.ShipVars[i].ship_to_address1; rtn_str += "<br />" + oVars.ShipVars[i].ship_to_city + ", " + oVars.ShipVars[i].ship_to_state + " " + oVars.ShipVars[i].ship_to_zipcode; break; } } i++; } // For offers like Ornamets, where there is NO "BASE" offer, uses the below code to generate the shipping details. //if (!isNotOneShot) //{ // if (rtn_str.Length == 0) // { // i = 0; // while (i < oVars.ShipVars.Count) // { // if (oVars.ShipVars[i].offer_type == "O") // { // if (oVars.ShipVars[i].ship_to_fname.Trim().Length > 0) // { // rtn_str = oVars.ShipVars[i].ship_to_fname.ToUpper().Substring(0, 1) + oVars.ShipVars[i].ship_to_fname.ToLower().Substring(1) + " " + oVars.ShipVars[i].ship_to_lname.ToUpper().Substring(0, 1) + oVars.ShipVars[i].ship_to_lname.ToLower().Substring(1) + "<br />"; // rtn_str += ((oVars.ShipVars[i].ship_to_apt.ToString().Trim().Length > 0) ? oVars.ShipVars[i].ship_to_apt + ", " : "") + oVars.ShipVars[i].ship_to_address1; // rtn_str += "<br />" + oVars.ShipVars[i].ship_to_city + ", " + oVars.ShipVars[i].ship_to_state + " " + oVars.ShipVars[i].ship_to_zipcode; // break; // } // } // i++; // } // } //} return rtn_str; }
public OrderVariables MapQueryStringToOrderVariables(OrderVariables oVariables) { if (HttpContext.Current.Request.UrlReferrer != null) { if (oVariables == null) return null; oVariables.referring_url = HttpContext.Current.Request.UrlReferrer.ToString(); oVariables.vendor_id = GetQueryStringFromUri("vendorcode", ""); oVariables.vendor_data2 = GetQueryStringFromUri("key", ""); oVariables.vendor_id = GetQueryStringFromUri("vc", ""); oVariables.promotion_code = GetQueryStringFromUri("pc", ""); oVariables.vendor_data1 = GetQueryStringFromUri("aff_id", ""); oVariables.vendor_cust_ref_id = GetQueryStringFromUri("tracking", ""); oVariables.pcode_pos_8 = GetQueryStringFromUri("src", ""); oVariables.pcode_segment = GetQueryStringFromUri("seg", ""); oVariables.vendor_data2 = GetQueryStringFromUri("aff_id2", ""); oVariables.transaction_id = GetQueryStringFromUri("tracking_id", ""); } return oVariables; }
private void FirePostBackPixel(OrderVariables oVariables) { string SQLString = System.Configuration.ConfigurationManager.AppSettings["SQLConn"].ToString(); try { if (oVariables != null && (!string.IsNullOrEmpty(oVariables.transaction_id)) && (oVariables.transaction_id.Trim().Length > 0)) { string trans_id = oVariables.transaction_id.Trim(); string pixelstring = oVariables.pixel.Trim(); string conversionPixel = "https://sandvikpublishing.go2cloud.org/aff_lsr?transaction_id=" + trans_id; dbConn.dbConnector.dbConn oDBConn = new dbConn.dbConnector.dbConn(); oDBConn.regKey = SQLString; int rowId = 0; rowId = oDBConn.ExecSPReturnInteger("InsertVendorPxlPostBackFeedback", oVariables.order_id, conversionPixel, rowId); oDBConn = null; var client = new WebClient(); var content = client.DownloadString(conversionPixel); oDBConn = new dbConn.dbConnector.dbConn(); oDBConn.regKey = SQLString; oDBConn.ExecSP("UpdateVendorPxlPostBackFeedback", rowId, string.IsNullOrEmpty(content) ? content.ToString().Trim() : "EMPTY"); oDBConn = null; } } catch (Exception ex) { throw; } finally { // dSet = null; } }
public string ResponsivePayment_GiftingProducts(OrderVariables oVars, bool option = false, string template = "") { string start_product_list = "<div class='table-responsive smallTable f12'><table class='table' width='100%' border='0' cellspacing='0' cellpadding='0'><thead><tr><td>Item</td><td>Price</td></tr></thead>"; string title_text = "<tr><td >!_productTitle_!</td><td class='text-right'>!_FullCost_!</td></tr>"; string prod_list = "<tr><td >!_product_!</td><td class='text-right'>!_cost_!</td></tr>"; string space_column = "<tr height='5px''><td colspan='2'></td></tr>"; string dotted_line = "<tr><td colspan='2'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='2'></td></tr><tr>"; string shipping = "<tr><td>Shipping and Handling</td><td>!_ship_!</td></tr>"; string coupon_text = "<tr><td >Coupon/Discount</td><td >-!_discount_!</td></tr>"; string tax = "<tr><td> Tax</td><td >!_tax_!</td></tr>"; string bottom_extra_line = "<tr><td>!_extra_content_!</td></tr>"; string total = "<tfoot><tr><td class='bold'>Total</td><td class='bold'>!_total_!</td></tr></tfoot>"; string end_product_list = "</table></div>"; string prod = oVars.proj_desc; bool isQty = false; foreach (ShippingVariables qtyVariables in oVars.ShipVars) { if (qtyVariables.quantity > 1) { isQty = true; } } bool eBooks = false; if (!isQty) { if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "FREE" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); // prod_list += space_column; } else { start_product_list += title_text.Replace("!_productTitle_!", "" + oVars.ShipVars.FirstOrDefault().OfferVars.Count + " Books From " + oVars.proj_desc).Replace("!_FullCost_!", ""); prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { eBooks = oOffers.offer_item == "EBOOK" ? true : false; prod_list += "<tr><td>" + (eBooks ? "" + oOffers.item_desc + "" : oOffers.item_desc) + "</td><td>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost)) : String.Format("{0:c}", oOffers.item_cost)) + "</td></tr>"; } // prod_list += space_column; } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td>" + tmp_prodlist + "</td><td>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price)) + "</td></tr>"; // prod_list += space_column; } } } } start_product_list += prod_list; // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.total_sah))); } // start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); if (eBooks) { if (oVars.opt_out == "Y") start_product_list += bottom_extra_line.Replace("!_extra_content_!", "<img src='Assets/images/payment/ebooks_em_payment_banner_1.jpg' />"); else start_product_list += bottom_extra_line.Replace("!_extra_content_!", "<img src='Assets/images/payment/ebooks_em_payment_banner.jpg' />"); } start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); return start_product_list += end_product_list; } else { start_product_list = "<div class='table-responsive smallTable f12'><table class='table' width='100%' border='0' cellspacing='0' cellpadding='0'>" + "<thead><tr><td>Item</td>" + "<td>Price</td></tr><thead>"; // + "</tr><tr><td colspan='4'><div style='border-bottom: dashed thin #999999; margin-bottom: 10px; clear: both;'></div></td></tr>"; prod_list = "<tr><td>!_product_!</td>" + "<td>!_cost_!</td>" + "<td>!_subtotal_!</td></tr>"; space_column = "<tr height='5px''><td colspan='4'></td></tr>"; dotted_line = "<tr><td colspan='4'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='4'></td></tr><tr>"; coupon_text = "<tr><td>Coupon/Discount</td><td>-!_discount_!</td></tr>"; shipping = "<tr><td>Shipping and Handling</td>" + "<td>!_ship_!</td></tr>"; tax = "<tr><td>Tax</td>" + "<td>!_tax_!</td></tr>"; total = "<tfoot><tr><td>Total/td>" + "<td>!_total_!</td></tr></tfoot>"; end_product_list = "</table></div>"; prod = oVars.proj_desc; if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); prod_list += space_column; } else { prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { prod_list += "<tr><td>" + oOffers.item_desc + "</td>" + "<td>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost)) + "</td>" // + "<td>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity)) + "</td>" + "</tr>"; } } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td>" + tmp_prodlist + "</td><td>" + ((oShipVars.unit_price == 0) ? "FREE" : String.Format("{0:c}", oShipVars.unit_price)) + "</td></tr>"; } } } } start_product_list += prod_list; //start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "$0.00" : String.Format("{0:c}", oVars.total_sah))); } start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); return start_product_list += end_product_list; } }
public string ResponsiveConfirmation_GiftingProducts(OrderVariables oVars, bool option = false, string template = "") { string start_product_list = "<table id='tblCart' class='table table-striped bold'><tr><td>Item</td><td class='text-right'>Price</td></tr>"; string prod_list = "<tr><td class='paddingBT3'>!_product_!</td><td class='text-right'>!_cost_!</td></tr>"; string space_column = "<tr height='5px'><td colspan='2'></td></tr>"; string dotted_line = "<tr><td colspan='2'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='2'></td></tr><tr>"; string shipping = "<tr><td class='paddingBT3' >Shipping and Handling</td><td class='text-right'>!_ship_!</td></tr>"; string coupon_text = "<tr><td class='paddingBT3'><strong>Voucher / Coupon / Discount</strong></td><td class='text-right'>!_discount_!</td></tr>"; string tax = "<tr><td class='paddingBT3 bold'>Tax</td><td class='text-right bold'>!_tax_!</td></tr>"; string total = "<tr><td class='paddingBT3 bold'>Total</td><td class='text-right bold'>!_total_!</td></tr>"; string end_product_list = "</table>"; string prod = oVars.proj_desc; bool isQty = false; foreach (ShippingVariables qtyVariables in oVars.ShipVars) { if (qtyVariables.quantity > 1) { isQty = true; } } bool eBooks = false; if (!isQty) { if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); prod_list += space_column; } else { prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { eBooks = oOffers.offer_item == "EBOOK" ? true : false; prod_list += "<tr><td class='paddingBT3'>" + (eBooks ? "<strong>" + oOffers.item_desc + "</strong>" : oOffers.item_desc) + "</td><td class='text-right'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost)) + "</td></tr>"; } // prod_list += space_column; } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td class='paddingBT3'>" + tmp_prodlist + "</td><td class='text-right'>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price)) + "</td></tr>"; // prod_list += space_column; } } } } start_product_list += prod_list; // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.total_sah))); } // start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); return start_product_list += end_product_list; } else { start_product_list = "<table id='tblCart' border='0' width='99%'>" + "<tr><td class='bold ash-txt border-dashed'>Item</td>" + "<td class='bold ash-txt border-dashed'>Price</td>" + "<td class='bold ash-txt border-dashed'>Quantity</td>" + "<td class='bold ash-txt border-dashed'>Subtotal</td>" + "</tr>"; prod_list = "<tr><td class='paddingBT3'>!_product_!</td>" + "<td class='text-right'>!_cost_!</td>" + "<td class='text-right'>!_quantity_!</td>" + "<td class='text-right'>!_subtotal_!</td></tr>"; space_column = "<tr height='5px''><td colspan='4'></td></tr>"; dotted_line = "<tr><td colspan='4'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='4'></td></tr><tr>"; coupon_text = "<tr><td class='paddingBT3' colspan='3'>Coupon/Discount</strong></td><td class='text-right'>!_discount_!</td></tr>"; shipping = "<tr><td class='paddingBT3' colspan='3'>Shipping and Handling</td><td class='text-right'>!_ship_!</td></tr>"; tax = "<tr><td class='paddingBT3 bold text-right' colspan='3'>Tax</td><td class='text-right bold'>!_tax_!</td></tr>"; total = "<tr><td class='paddingBT3 bold' colspan='3'>Total</td>" + "<td class='text-right bold'>!_total_!</td></tr>"; end_product_list = "</table>"; prod = oVars.proj_desc; if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); prod_list += space_column; } else { prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { prod_list += "<tr><td class='paddingBT3'>" + oOffers.item_desc + "</td>" + "<td class='text-right'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost)) + "</td>" + "<td class='text-right'>" + oShipVars.quantity + "</td>" + "<td class='text-right'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity)) + "</td>" + "</tr>"; } prod_list += space_column; } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td class='paddingBT3'>" + tmp_prodlist + "</td><td class='text-right'>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price)) + "</td></tr>"; prod_list += space_column; } } } } start_product_list += prod_list; start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "<strong>$0.00</strong>" : String.Format("{0:c}", oVars.total_sah))); } start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); return start_product_list += end_product_list; } }
public ActionResult upsell_offer1() { if (Session["NewOrderDetails"] != null) { oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables.lastPageClientOn != "upsell_offer1") return RedirectToAction(oVariables.lastPageClientOn, "landers"); } if (Session["NewOrderDetails"] == null) { return RedirectToAction("home", "landers"); } return View(); }
public Dictionary<string, string> GetOfferCreatives(OrderVariables oVars) { Dictionary<string, string> d = new Dictionary<string, string>(); bool selected = false; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if ((oShipVars.selected) && (!selected)) { selected = true; #region "Select on Project..." switch (oShipVars.project) { case "U": d.Add("project_description", "Customer level USA"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "ABU": d.Add("project_description", "My First Steps to Learning"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BBU": d.Add("project_description", "Bearrific Friends Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BDU": d.Add("project_description", "Babies First Disney Books"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BEU": d.Add("project_description", "Baby Einstein Discoveries"); d.Add("confirm_header", "Assets/images/bye_confirm_header.gif"); d.Add("prod_image", "Assets/images/bye_logo.gif"); d.Add("payment_header", "Assets/images/payment/bye_payment_header.gif"); break; case "BFU": d.Add("project_description", "Baby's First Book Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BHU": d.Add("project_description", "My First Dr. Seuss & Friends"); d.Add("confirm_header", "Assets/images/mfs_confirm_header.gif"); d.Add("prod_image", "Assets/images/mfs_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/mfs_payment_header.gif"); break; case "BKU": d.Add("project_description", "New Book of Knowledge"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BRU": d.Add("project_description", "Dr. Seuss & His Friends"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BSU": d.Add("project_description", "Dr. Seuss"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "BVU": d.Add("project_description", "Parent Handbook"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "CBU": d.Add("project_description", "Carebears"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "CHU": d.Add("project_description", "Cat In The Hat Learning Lib"); d.Add("confirm_header", "Assets/images/cith_ll_confirm_header.gif"); d.Add("prod_image", "Assets/images/cith_ll_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/cith_ll_payment_header.gif"); break; case "CPU": d.Add("project_description", "CP"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "DBU": d.Add("project_description", "Disney Wonderful World Reading"); d.Add("confirm_header", "Assets/images/disney_confirm_header.jpg"); d.Add("prod_image", "Assets/images/dwwr_logo.gif"); d.Add("payment_header", "Assets/images/payment/disney_payment_header.jpg"); break; case "DFU": d.Add("project_description", "Disney First Readers"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "DPU": d.Add("project_description", "Royal Disney Princess Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "ELU": d.Add("project_description", "Elmo's Learning Adventure"); d.Add("confirm_header", "Assets/images/elmo_confirm_header.jpg"); d.Add("prod_image", "Assets/images/elmo_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/elmo_payment_header.jpg"); break; case "FMU": d.Add("project_description", "My First Music Collection"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "HBU": d.Add("project_description", "Hispanic Books Programs"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "HMU": d.Add("project_description", "Help Me Be Good"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "HOU": d.Add("project_description", "Hooked On Phonics"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "IKU": d.Add("project_description", "Interactive Kids Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "LMU": d.Add("project_description", "Little Mermaid Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "MBU": d.Add("project_description", "MB"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "MCU": d.Add("project_description", "Magic Castle Readers"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "MOU": d.Add("project_description", "MO"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "MSU": d.Add("project_description", "Miscellaneous"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "NCU": d.Add("project_description", "Nature's Children"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "NJU": d.Add("project_description", "Nick Jr."); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "POU": d.Add("project_description", "Pokemon Masters Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "PRU": d.Add("project_description", "Phonics Reading Program"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "SCU": d.Add("project_description", "Scholastic Classics"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "SKU": d.Add("project_description", "SK"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "STU": d.Add("project_description", "Scholastic Teacher account"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "VTU": d.Add("project_description", "Veggie Tales"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "WAU": d.Add("project_description", "Word Advantage 220"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "WPU": d.Add("project_description", "My First Winnie the Pooh Club"); d.Add("confirm_header", "Assets/images/brp_confirm_header.gif"); d.Add("prod_image", "Assets/images/seuss_confirm_logo.gif"); d.Add("payment_header", "Assets/images/payment/seuss_payment_header.gif"); break; case "DCO": case "DPO": case "DOU": d.Add("project_description", "Disney Character Ornaments"); d.Add("confirm_header", "Assets/images/dco_confirm_header.gif"); d.Add("prod_image", "Assets/images/dco_logo_confirm.gif"); d.Add("payment_header", "Assets/images/payment/dco_payment_header.gif"); break; } #endregion } } return d; }
public ActionResult shipping(FormCollection form, ShippingModels.ShoppingOrder shipping) { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["GenderList"] = UtilitiesModels.GetChildGenderNameList(); ViewData["MonthList"] = UtilitiesModels.GetMonthNameList(); ViewData["YearList"] = UtilitiesModels.GetCardExpiryYearList(); try { if (shipping.isBillingSameToShipping) { shipping.BillingFirstName = shipping.ShippingFirstName; shipping.BillingLastName = shipping.ShippingLastName; shipping.BillingAddress1 = shipping.ShippingAddress1; shipping.BillingCity = shipping.ShippingCity; shipping.BillingZipCode = shipping.ShippingZipCode; shipping.CCBillZipCode = shipping.BillingZipCode; } if (ModelState.IsValid == false) { var message = string.Join("<br/>", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); ViewBag.ErrorMsg = message.ToString(); return View(); } oVariables = oProcess.GetOfferAndPageDetails("disney_tripwire"); #region "Commented by Sri @ 04.12.2016" //if ((string)Request.QueryString["vendorcode"] != null) { oVariables.vendor_id = (string)Request.QueryString["vendorcode"]; } //if ((string)Request.QueryString["key"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["key"]; } //if ((string)Request.QueryString["vc"] != null) { oVariables.vendor_id = (string)Request.QueryString["vc"]; } //if ((string)Request.QueryString["pc"] != null) { oVariables.promotion_code = (string)Request.QueryString["pc"]; } //if ((string)Request.QueryString["aff_id"] != null) { oVariables.vendor_data1 = (string)Request.QueryString["aff_id"]; } if ((string)Request.QueryString["tracking"] != null) { oVariables.vendor_cust_ref_id = (string)Request.QueryString["tracking"]; } //if ((string)Request.QueryString["src"] != null) { oVariables.pcode_pos_8 = (string)Request.QueryString["src"]; } //if ((string)Request.QueryString["seg"] != null) { oVariables.pcode_segment = (string)Request.QueryString["seg"]; } if ((string)Request.QueryString["aff_id2"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["aff_id2"]; } //// oVariables.referring_url = System.Web.HttpContext.Current.Request.Url.ToString(); ////string queryStr = ""; ////if (System.Web.HttpContext.Current.Request.UrlReferrer != null) ////{ //// queryStr = System.Web.HttpContext.Current.Request.UrlReferrer.Query; //// string ref_url = System.Web.HttpContext.Current.Request.Url.ToString(); //// oVariables.referring_url = ref_url + queryStr; ////} //string ref_url = System.Web.HttpContext.Current.Request.Url.ToString(); //oVariables.referring_url = ref_url; #endregion var offerService = new OfferService(); oVariables = offerService.MapQueryStringToOrderVariables(oVariables: oVariables); oVariables = ShippingModels.AssignShoppingDetailsToOrderVariable(oVariables, shipping); oVariables.has_shopping_Cart = true; oVariables.pcode_pos_7 = "N"; oVariables.order_Src = "EMS"; //Submitting shipping details to order engin for order process //Code commented for passing to payment page. oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { oVariables.lastPageClientOn = "upsell_offer1"; Session.Add("NewOrderDetails", oVariables); return RedirectToAction("upsell_offer1", "landers"); } else { if (oVariables.err.Length >= 0) { if ((oVariables.order_status == "X") || (oVariables.order_status == "F")) { Session.Add("NewOrderDetails", oVariables); return RedirectToAction("orderstatus", "Home"); } else if (oVariables.err.Length > 0) { ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } else if (oVariables.isSoftDeclined) { Session["NewSBMDetails"] = null; return RedirectToAction("ThankYou", "home"); } else if ((oVariables.order_status == "N") || (oVariables.redirect_page.Length > 0)) { Session.Add("NewSBMDetails", oVariables); return View(); //return RedirectToAction("upsell_offer1", "landers"); } else { ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } } } } else { Session["NewSBMDetails"] = null; return RedirectToAction("orderstatus", "Home"); } } catch (Exception ex) { string page_log = "Exception raised. Exception: " + ex.Message.ToString() + "<br>"; ViewBag.ErrorMsg = ex.Message.ToString(); string s = ""; oCom.SendEmail(HttpContext.Request.Url.ToString() + "<br>ex.message = " + ex.Message.ToString() + "<br> Additional Information - " + page_log + ".<br> Browser Details....<br>" + s); //return RedirectToAction("shipping", "landers", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); return View(); } finally { oVariables = null; oComm = null; oProcess = null; } // return RedirectToAction("shipping", "landers", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); return View(); }
public ActionResult Payment_399(FormCollection form, ShippingModels.BillingDetails billing) { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["MonthList"] = UtilitiesModels.GetMonthNameList(); ViewData["YearList"] = UtilitiesModels.GetCardExpiryYearList(); OrderVariables oVariables = new OrderVariables(); OrderProcess oProcess = new OrderProcess(); CommonModels oComm = new CommonModels(); string cart_details, conf_pg_tac, total = ""; string shipall = "false"; string template = ""; string pixel = ""; if (!string.IsNullOrEmpty(billing.SecurityCaptch) && Session["rndtext"] != null) { string strCaptch = Session["rndtext"] as string; if (!strCaptch.Equals(billing.SecurityCaptch)) { ViewBag.ErrorMsg = "Invalid Security Captcha."; //return View(); } } else { //if (string.IsNullOrEmpty(billing.SecurityCaptch)) //{ ViewBag.ErrorMsg = "Security Captcha is required."; // return View(); //} } if (Session["ShippingDetails"] != null) oVariables = Session["ShippingDetails"] as OrderVariables; try { if (Session["NewSBMDetails"] != null) { oVariables = (OrderVariables)Session["NewSBMDetails"]; if (oVariables != null) { if (ViewBag.ErrorMsg != null && ViewBag.ErrorMsg != "") { //Setting values if page is getting back to the payment view only. Dictionary<string, string> d = oComm.GetOfferCreatives(oVariables); ViewBag.HeaderImageSrc = oComm.GetDictionaryValue("payment_header", d); if ((string)Request.QueryString["shipall"] != null) { shipall = (string)Request.QueryString["shipall"]; } if ((string)Request.QueryString["template"] != null) { template = (string)Request.QueryString["template"]; } string cartId = oVariables.cart_id.ToString(); conf_pg_tac = oVariables.PageVars[0].conf_pg_tac; cart_details = oComm.ResponsivePayment_GiftingProducts(oVariables, Convert.ToBoolean(shipall), template); total = String.Format("{0:c}", oVariables.total_amt + oVariables.tax_amt + oVariables.total_sah); ViewBag.IsBonusSelected = false; if (oVariables.bonus_option == true) { ViewBag.IsBonusSelected = true; } ViewBag.CartSummary = cart_details; ViewBag.Cart = cartId; ViewBag.Total = total; ViewBag.ConfPgTAC = conf_pg_tac; return View(); } oVariables = ShippingModels.AssignBillingToOrderVariable(oVariables, billing); oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { Session["NewSBMDetails"] = null; Session.Add("NewOrderDetails", oVariables); return RedirectToAction("Confirmation", "Home"); } else { if (oVariables.err.Length > 0) { if ((oVariables.order_status == "X") || (oVariables.order_status == "F")) { Session["NewSBMDetails"] = null; Session.Add("NewOrderDetails", oVariables); return RedirectToAction("orderstatus", "Home"); } else { Session.Add("NewSBMDetails", oVariables); ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } } else if (oVariables.isSoftDeclined) { Session["NewSBMDetails"] = null; return RedirectToAction("ThankYou", "home"); } //Setting values if page is getting back to the payment view only. Dictionary<string, string> d = oComm.GetOfferCreatives(oVariables); ViewBag.HeaderImageSrc = oComm.GetDictionaryValue("payment_header", d); if ((string)Request.QueryString["shipall"] != null) { shipall = (string)Request.QueryString["shipall"]; } if ((string)Request.QueryString["template"] != null) { template = (string)Request.QueryString["template"]; } string cartId = oVariables.cart_id.ToString(); conf_pg_tac = oVariables.PageVars[0].conf_pg_tac; cart_details = oComm.ResponsivePayment_GiftingProducts(oVariables, Convert.ToBoolean(shipall), template); total = String.Format("{0:c}", oVariables.total_amt + oVariables.tax_amt + oVariables.total_sah); ViewBag.IsBonusSelected = false; if (oVariables.bonus_option == true) { ViewBag.IsBonusSelected = true; } ViewBag.CartSummary = cart_details; ViewBag.Cart = cartId; ViewBag.Total = total; ViewBag.ConfPgTAC = conf_pg_tac; } } else { return RedirectToAction("orderstatus", "Home"); } } return View(); } else { return RedirectToAction("Three_99", "Elmo", routeValues: ViewContextExtensions.OptionalParamters(Request.QueryString)); } } catch (Exception ex) { oComm.SendEmail("Exception Raised in EM Landers Payment Page (Submit) - " + ex.Message.ToString()); return View(); } finally { oComm = null; oVariables = null; oProcess = null; } }
public static OrderVariables AssignShoppingDetailsToOrderVariable(OrderVariables oVariables, ShoppingOrder billingDetails) { CommonModels oComm = new CommonModels(); //OrderVariables oVariables = new OrderVariables(); oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname = billingDetails.ShippingFirstName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname = billingDetails.ShippingLastName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1 = billingDetails.ShippingAddress1; oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt = billingDetails.ShippingAddress2; oVariables.ShipVars[oVariables.default_shp_id].ship_to_city = billingDetails.ShippingCity; oVariables.ShipVars[oVariables.default_shp_id].ship_to_state = billingDetails.ShippingState; oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode = billingDetails.ShippingZipCode; oVariables.referring_url = HttpContext.Current.Request.Url.ToString(); oVariables.ip_address = oComm.GetIPAddress(); oVariables.phone = billingDetails.ShippingPhone; oVariables.email = billingDetails.ShippingEmail; oVariables.bonus_option = false; if (billingDetails.isBonusSelected) { oVariables.bonus_option = true; } //Assigning Billing Address details to OVariable if (billingDetails.isBillingSameToShipping) { oVariables.bill_to_fname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname; oVariables.bill_to_lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; oVariables.bill_to_address1 = oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1; oVariables.bill_to_apt = oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt; oVariables.bill_to_city = oVariables.ShipVars[oVariables.default_shp_id].ship_to_city; oVariables.bill_to_state = oVariables.ShipVars[oVariables.default_shp_id].ship_to_state; oVariables.bill_to_zipcode = oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode; } else { oVariables.bill_to_fname = billingDetails.BillingFirstName.Trim(); oVariables.bill_to_lname = billingDetails.BillingLastName.Trim(); oVariables.bill_to_address1 = billingDetails.BillingAddress1.Trim(); oVariables.bill_to_apt = (!string.IsNullOrEmpty(billingDetails.BillingAddress2)) ? billingDetails.BillingAddress2.Trim() : ""; oVariables.bill_to_city = billingDetails.BillingCity.Trim(); oVariables.bill_to_state = billingDetails.BillingState.Trim(); oVariables.bill_to_zipcode = billingDetails.BillingZipCode.Trim(); } //Assigning Payment details to OVariable oVariables.credit_rule = "CCC"; oVariables.err = ""; if (oVariables.CCVars.Count > 0) { oVariables.CCVars[0].number = billingDetails.CreditCardNumber.Trim(); oVariables.CCVars[0].type = ""; oVariables.CCVars[0].expdate = billingDetails.CardExpiryMonth.Trim() + billingDetails.CardExpiryYear.Trim(); oVariables.CCVars[0].cvv = billingDetails.SecurityCode.Trim(); oVariables.CCVars[0].zipcode = billingDetails.BillingZipCode.Trim(); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } else { CCProperties oCCVars = new OrderEngine.CCProperties(); oVariables.payment_type = "CC"; oCCVars.number = billingDetails.CreditCardNumber.Trim(); oCCVars.type = ""; oCCVars.expdate = billingDetails.CardExpiryMonth.Trim() + billingDetails.CardExpiryYear.Trim(); oCCVars.cvv = billingDetails.SecurityCode.Trim(); oCCVars.zipcode = (billingDetails.BillingZipCode != null && billingDetails.BillingZipCode != "") ? billingDetails.BillingZipCode.Trim() : "";// billingDetails.BillingZipCode.Trim(); oVariables.credit_rule = "CCC"; oVariables.CCVars.Add(oCCVars); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } return oVariables; }
private void BuildDynamicPixel(OrderVariables oVariables) { CommonModels oComm = new CommonModels(); string vendor_tracking = ""; string aff_id = ""; string aff_id2 = ""; string finalpixel = string.Empty; DataTable pixeltb = new DataTable(); DataTable vendparamstb = new DataTable(); string pixelstring = string.Empty; if (oVariables.vendor_id.ToString().Trim().Length == 4) { try { pixeltb = Dynamic_Pixel(oVariables, "get_vndr_details", oVariables.vendor_id.ToString().Trim().ToUpper()); //Building Pixel if (pixeltb != null && pixeltb.Rows.Count > 0 && pixeltb.Rows[0]["pixel_hardcoded"].ToString().Trim() == "N") { vendparamstb = Dynamic_Pixel(oVariables, "GetVendorPixelData", oVariables.vendor_id.ToString().Trim().ToUpper()); //Raw Pixel pixelstring = pixeltb.Rows[0]["pixel"].ToString().Trim(); if (vendparamstb != null && vendparamstb.Rows.Count >= 1) { string[] vendor_var = new string[vendparamstb.Rows.Count]; string[] sys_var = new string[vendparamstb.Rows.Count]; int i = 0; foreach (DataRow dr in vendparamstb.Rows) { try { vendor_var[i] = dr["vendor_var"].ToString().Trim(); sys_var[i] = dr["system_var"].ToString().Trim(); i = i + 1; } catch (Exception ex) { oComm.SendEmail("BuildDynamicPixel() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } } //pixelstring = pixeltb.Rows[0]["pixel"].ToString().Trim(); if (((string)Request.QueryString["tracking"]) != null) { vendor_tracking = ((string)Request.QueryString["tracking"]).ToString().Trim(); } if (((string)Request.QueryString["aff_id"]) != null) { aff_id = ((string)Request.QueryString["aff_id"]).ToString().Trim(); } if (((string)Request.QueryString["aff_id2"]) != null) { aff_id2 = ((string)Request.QueryString["aff_id2"]).ToString().Trim(); } double base_amt = 0.00; foreach (OrderEngine.ShippingVariables oShipVars in oVariables.ShipVars) if (oShipVars.selected && oShipVars.offer_type.In("B", "O")) foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) base_amt += oOffers.item_cost; for (int j = 0; j < sys_var.Length; j++) { switch (sys_var[j].Trim()) { //[vendor_tracking] case "VDT": pixelstring = pixelstring.Replace(vendor_var[j], vendor_tracking); break; //[order_id] case "OID": pixelstring = pixelstring.Replace(vendor_var[j], oVariables.order_id.ToString()); break; //[aff_id] case "AFI1": pixelstring = pixelstring.Replace(vendor_var[j], aff_id); break; //[aff_id2] case "AFI2": pixelstring = pixelstring.Replace(vendor_var[j], aff_id2); break; //[email] case "EMA": pixelstring = pixelstring.Replace(vendor_var[j], oVariables.email.ToString()); break; //[promotion_code] case "PRC": pixelstring = pixelstring.Replace(vendor_var[j], oVariables.promotion_code.ToString()); break; //[SubTotal] case "SUBTO": pixelstring = pixelstring.Replace(vendor_var[j], (oVariables.total_amt - oVariables.tax_amt).ToString()); break; //[total_amt] case "TOA": pixelstring = pixelstring.Replace(vendor_var[j], oVariables.total_amt.ToString()); break; case "BAMT": pixelstring = pixelstring.Replace(vendor_var[j], base_amt.ToString()); break; case "PRJ": pixelstring = pixelstring.Replace(vendor_var[j], oVariables.project); break; default: break; } } } } else if (pixeltb.Rows[0]["isPostBack"].ToString().Trim() == "N") { vendparamstb = null; //Raw Pixel pixelstring = pixeltb.Rows[0]["pixel"].ToString().Trim(); } } catch (Exception ex) { oComm.SendEmail("BuildDynamicPixel() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } } else { pixelstring = ""; } }
public ActionResult OrderStatus() { OrderVariables oVariables = new OrderVariables(); CommonModels oComm = new CommonModels(); try { int errorCode = 0; if (Session["NewOrderDetails"] != null) { oVariables = new OrderVariables(); oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables != null) { errorCode = oVariables.error_code; } ViewBag.ErrorMessage = GetError(errorCode.ToString()); } else { ViewBag.ErrorMessage = GetError(errorCode.ToString()); } } catch (Exception ex) { if (oVariables != null) { oComm.SendEmail("Page_Load() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } } finally { Session["NewOrderDetails"] = null; oVariables = null; oComm = null; } return View(); }
public ActionResult Four_for_99(FormCollection form, ShippingModels.ShoppingOrder shipping, string[] SelectedBooks) { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["GenderList"] = UtilitiesModels.GetChildGenderNameList(); ViewData["MonthList"] = UtilitiesModels.GetMonthNameList(); ViewData["YearList"] = UtilitiesModels.GetCardExpiryYearList(); OrderProcess oProcess = new OrderProcess(); CommonMethods oComm = new CommonMethods(); OrderVariables oVariables = new OrderVariables(); try { if (shipping.isBillingSameToShipping) { shipping.BillingFirstName = shipping.ShippingFirstName; shipping.BillingLastName = shipping.ShippingLastName; shipping.BillingAddress1 = shipping.ShippingAddress1; shipping.BillingCity = shipping.ShippingCity; shipping.BillingZipCode = shipping.ShippingZipCode; shipping.CCBillZipCode = shipping.BillingZipCode; } if (ModelState.IsValid == false) { var message = string.Join("<br/>", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); ViewBag.ErrorMsg = message.ToString(); return View(); } oVariables = oProcess.GetOfferAndPageDetails("fosina-disney-4for99-secure"); if ((string)Request.QueryString["vendorcode"] != null) { oVariables.vendor_id = (string)Request.QueryString["vendorcode"]; } if ((string)Request.QueryString["key"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["key"]; } if ((string)Request.QueryString["vc"] != null) { oVariables.vendor_id = (string)Request.QueryString["vc"]; } if ((string)Request.QueryString["pc"] != null) { oVariables.promotion_code = (string)Request.QueryString["pc"]; } if ((string)Request.QueryString["aff_id"] != null) { oVariables.vendor_data1 = (string)Request.QueryString["aff_id"]; } if ((string)Request.QueryString["tracking"] != null) { oVariables.vendor_cust_ref_id = (string)Request.QueryString["tracking"]; } if ((string)Request.QueryString["src"] != null) { oVariables.pcode_pos_8 = (string)Request.QueryString["src"]; } if ((string)Request.QueryString["seg"] != null) { oVariables.pcode_segment = (string)Request.QueryString["seg"]; } if ((string)Request.QueryString["aff_id2"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["aff_id2"]; } oVariables.referring_url = System.Web.HttpContext.Current.Request.Url.ToString(); oVariables = ShippingModels.AssignShoppingDetailsToOrderVariable(oVariables, shipping); string choiceBooks = string.Join(",", SelectedBooks); if (!string.IsNullOrEmpty(choiceBooks)) { oVariables.has_shopping_Cart = true; oVariables.shopping_cart_items = choiceBooks; } //Submitting shipping details to order engin for order process //Code commented for passing to payment page. oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { Session.Add("NewOrderDetails", oVariables); return RedirectToAction("Confirmation", "Home"); } else { if (oVariables.err.Length >= 0) { if ((oVariables.order_status == "X") || (oVariables.order_status == "F")) { // page_log += "Order is NOT processed with Order Status X or F. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; // Response.Redirect("../orderstatus.aspx" + oComm.GetURIString(), false); // HttpContext.Current.ApplicationInstance.CompleteRequest(); return RedirectToAction("orderstatus", "Home"); } else if (oVariables.err.Length > 0) { // page_log += "Order is NOT processed with an ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; // lblErrorMsg.Text = oVariables.err; // oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); // string error_msg = string.Empty; // error_msg = "alert('" + oVariables.err + "')"; // ScriptManager.RegisterStartupScript(this, this.GetType(), "client_error", error_msg, true); ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } else if ((oVariables.order_status == "N") || (oVariables.redirect_page.Length > 0)) { // page_log += "Order is NOT processed with NO ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; Session.Add("NewSBMDetails", oVariables); // Response.Redirect("../" + oVariables.redirect_page + oComm.GetURIString() + "&template=club", false); // HttpContext.Current.ApplicationInstance.CompleteRequest(); return RedirectToAction("Payment4_for_99", "Disney"); } else { /* page_log += "Order is NOT processed with YES ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; lblErrorMsg.Text = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); string error_msg = string.Empty; error_msg = "alert('" + oVariables.err + "')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "client_error", error_msg, true); */ ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } } } } else { //page_log += "Order is NOT processed, Order Process returned NULL.<br>"; Session["NewSBMDetails"] = null; return RedirectToAction("orderstatus", "Home"); } //ends Submitting shipping details to order engin for order process //Session["NewSBMDetails"] = oVariables; //Session["ShippingDetails"] = oVariables; //return RedirectToAction("Payment4_for_1", "Seuss"); } catch (Exception ex) { string page_log = "Exception raised. Exception: " + ex.Message.ToString() + "<br>"; CommonModels oCom = new CommonModels(); string s = "";// oCom.LogBrowserCapabilities(Request.Browser); oCom.SendEmail(HttpContext.Request.Url.ToString() + "<br>ex.message = " + ex.Message.ToString() + "<br> Additional Information - " + page_log + ".<br> Browser Details....<br>" + s); return View(); } finally { oVariables = null; oComm = null; oProcess = null; } return View(); }
public ActionResult upsell_offer2(string SubmitButton, FormCollection form) { try { if (Session["NewOrderDetails"] != null) { oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables != null) { // if (!string.IsNullOrEmpty(SubmitButton) && SubmitButton.IndexOf("Yes", StringComparison.OrdinalIgnoreCase) >= 0) // { oVariables.applyDupeCheck = false; oVariables.applyEnhancedCTI = false; oVariables.has_shopping_Cart = true; //oVariables.shopping_cart_items_remove = "19632366,19632367"; oVariables.promotion_code = oVariables.promotion_code.Length >= 6 ? oVariables.promotion_code.Substring(0, 6) : oVariables.promotion_code; oVariables.pcode_pos_7 = oVariables.shopping_cart_items.In("19632368") ? "W" : "E"; oVariables.shopping_cart_items = "19632370,19632371"; oVariables.err = ""; oVariables.payment_type = "CC"; oVariables.total_amt = 0.00; oVariables.total_sah = 0.00; oVariables.order_status = "N"; oVariables.isOrderUpgraded = true; oVariables.cancelOriginalOrder = true; oVariables.originalOrderId = oVariables.order_id; oProcess.OrderSubmit(oVariables); //code for adding upsell by api call commented //isUpsellAdded = addUpsellToCart(order_id, campaign_id, offer_id, upsell_id); //if (isUpsellAdded) //{ // Session["NewOrderDetails"] = oVariables; //} if (oVariables != null) { if (oVariables.order_id > 0) { oVariables.lastPageClientOn = "thankyou"; Session.Add("NewOrderDetails", oVariables); return RedirectToAction("thankyou", "landers"); } else { if (oVariables.err.Length >= 0) { if ((oVariables.order_status == "X") || (oVariables.order_status == "F")) { Session.Add("NewOrderDetails", oVariables); return RedirectToAction("orderstatus", "Home"); } else if (oVariables.err.Length > 0) { ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } else if ((oVariables.order_status == "N") || (oVariables.redirect_page.Length > 0)) { Session.Add("NewSBMDetails", oVariables); return View(); //return RedirectToAction("upsell_offer2", "landers", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); } else { ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } } } } else { Session["NewSBMDetails"] = null; return RedirectToAction("orderstatus", "Home", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); } // } // return RedirectToAction("thankyou", "landers"); } else { ViewBag.ErrorMsg = genericCustomerServiceMsg; } } else { ViewBag.ErrorMsg = genericCustomerServiceMsg; } //return RedirectToAction("upsell_offer2", "landers", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); return View(); } catch (Exception ex) { ViewBag.ErrorMsg = ex.Message.ToString(); if (oVariables != null) { oCom.SendEmail("Page_Load() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } //return RedirectToAction("upsell_offer2", "landers", new { uniqueUri = Request.RequestContext.RouteData.Values["uniqueUri"] }); return View(); } finally { // Session["NewOrderDetails"] = null; oVariables = null; oComm = null; oProcess = null; } }
public string ResponsivePayment_GiftingProducts(OrderVariables oVars, out double taxAmount, out double totalAmount, bool option = false, string template = "", bool upsell = false) { taxAmount = oVars.tax_amt; totalAmount = oVars.total_amt + oVars.tax_amt + oVars.total_sah; //string start_product_list = "<table style='width: 310px; border: none; padding: 0px;'><tr><td style='width: 260px;'><h1 style='color: #333333; padding-left: 20px; width: 260px; float: left;'>Item</h1></td><td style='width: 50px;'><h1 style='color: #333333; padding-left: 20px; width: 50px; float: left;'>Price</h1></td></tr><tr><td colspan='2'><div style='border-bottom: dashed thin #999999; margin-bottom: 10px; clear: both;'></div></td></tr>"; string start_product_list = "<table id='txlCart' border='0' width='99%'><tr><td class='bold ash-txt border-dashed'>Item</td><td class='text-right bold ash-txt border-dashed'>Price</td></tr>"; //string prod_list = "<tr><td style='width: 260px;'><div style='color: #333333; padding-left: 20px; width: 260px; float: left;'>!_product_!</div></td><td style='width: 50px;'><div style='color: #333333; padding-left: 20px; width: 50px; float: left; display:table-cell; vertical-align:middle;'>!_cost_!</div></td></tr>"; string prod_list = "<tr><td class='paddingBT3'>!_product_!</td><td class='text-right'>!_cost_!</td></tr>"; string space_column = "<tr height='5px''><td colspan='2'></td></tr>"; //string dotted_line = "<tr><td colspan='2'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='2'></td></tr><tr>"; //string shipping = "<tr><td style='width: 260px;'><div style='color: #333333; padding-left: 20px; width: 260px; float: left;'>Shipping and Handling</div></td><td style='width: 50px;' valign='middle' align='right'><div style='color: #333333; padding-left: 20px; width: 50px; float: left; display:table-cell; vertical-align:middle;'>!_ship_!</div></td></tr>"; string shipping = "<tr><td class='paddingBT3'>Shipping and Handling</td><td class='text-right'>!_ship_!</td></tr>"; //string coupon_text = "<tr><td style='width: 260px;'><h1 style='color: #333333; padding-left: 20px; width: 260px; float: left; text-align: right;'><strong>Coupon/Discount</strong></h1></td><td style='width: 50px;'><h1 style='color: #333333; padding-left: 20px; width: 50px; float: left;'>-!_discount_!</h1></td></tr>"; string coupon_text = "<tr><td class='paddingBT3'>Coupon/Discount</td><td class='text-right'>-!_discount_!</td></tr>"; //string tax = "<tr><td style='width: 260px;'><h1 style='color: #333333; padding-left: 20px; width: 260px; float: left; text-align: right;'><strong>Tax</strong></h1></td><td style='width: 50px;' valign='middle' align='right'><h1 style='color: #333333; padding-left: 20px; width: 50px; float: left;'>!_tax_!</h1></td></tr>"; //string tax = "<tr><td class='paddingBT3'> Tax</td><td class='text-right'>!_tax_!</td></tr>"; //string total = "<tr><td style='width: 260px;'><h1 style='color: #333333; padding-left: 20px; width: 260px; float: left; text-align: right;'><strong>Total</strong></h1></td><td style='width: 50px;' valign='middle' align='right'><h1 style='color: #333333; padding-left: 20px; width: 50px; float: left;'>!_total_!</h1></td></tr>"; //string total = "<tr><td class='paddingBT3'>Total</td><td class='text-right'>!_total_!</td></tr>"; //string bottom_extra_line = "<tr><td colspan='2'><div style='padding-top: 10px; margin-bottom: 10px;clear: both;'>!_extra_content_!</div></td></tr><tr><td colspan='2'></td></tr><tr>"; string bottom_extra_line = "<tr><td colspan='2' class='paddingBT3'>!_extra_content_!</td></tr>"; string end_product_list = "</table>"; string prod = oVars.proj_desc; bool isQty = false; foreach (ShippingVariables qtyVariables in oVars.ShipVars) { if (qtyVariables.quantity > 1) { isQty = true; } } bool eBooks = false; if (!isQty) { if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); prod_list += space_column; } else { prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { eBooks = oOffers.offer_item == "EBOOK" ? true : false; //prod_list += "<tr><td style='width: 260px;'><div style='color: #333333; padding-left: 20px; width: 260px; float: left;'>" + // (eBooks ? "<strong>" + oOffers.item_desc + "</strong>" : oOffers.item_desc) + // "</div></td><td style='width: 50px;' valign='middle' align='right'><div style='color: #333333; padding-left: 20px; width: 50px; float: left; display:table-cell; vertical-align:middle;'>" + // ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : "<strong>" + // GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost)) + "</div></td></tr>"; prod_list += "<tr><td class='paddingBT3'>" + (eBooks ? "<strong>" + oOffers.item_desc + "</strong>" : oOffers.item_desc) + "</td><td class='text-right'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost)) : String.Format("{0:c}", oOffers.item_cost)) + "</td></tr>"; } prod_list += space_column; } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td class='paddingBT3'>" + tmp_prodlist + "</td><td class='text-right'>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price)) + "</td></tr>"; prod_list += space_column; } } } } start_product_list += prod_list; // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. // if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", String.Format("{0:c}", oVars.total_sah)); } if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.total_sah))); } //start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } //start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); //start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); if (eBooks) { if (oVars.opt_out == "Y") start_product_list += bottom_extra_line.Replace("!_extra_content_!", "<img src='Assets/images/payment/ebooks_em_payment_banner_1.jpg' />"); else start_product_list += bottom_extra_line.Replace("!_extra_content_!", "<img src='Assets/images/payment/ebooks_em_payment_banner.jpg' />"); } return start_product_list += end_product_list; } else { start_product_list = "<table style='border: none; padding: 0px; width:99%;'>" + "<tr><td><strong>Item</strong></td>" + "<td><strong>Price</strong></td>" + "<td><strong>Quantity</strong></td>" + "<td style='padding-left:30px'><strong>Subtotal</strong></td>" + "</tr><tr><td colspan='4'><div style='border-bottom: dashed thin #999999; margin-bottom: 10px; clear: both;'></div></td></tr>"; prod_list = "<tr><td><div style='color: #333333; float: left;'>!_product_!</div></td>" + "<td><div style='color: #333333; float: left; display:table-cell; vertical-align:middle;'>!_cost_!</div></td>" + "<td><div style='color: #333333; padding-left:20px; float: left; display:table-cell; vertical-align:middle;'>!_quantity_!</div></td>" + "<td><div style='color: #333333; padding-left: 10px; float: right; display:table-cell; vertical-align:middle;'>!_subtotal_!</div></td></tr>"; space_column = "<tr height='5px''><td colspan='4'></td></tr>"; //dotted_line = "<tr><td colspan='4'><div style='border-bottom: dashed thin #999999; padding-top: 10px; margin-bottom: 10px;clear: both;'></div></td></tr><tr><td colspan='4'></td></tr><tr>"; coupon_text = "<tr><td><strong>Coupon/Discount</strong></td><td><strong>-!_discount_!</strong></td></tr>"; shipping = "<tr><td valign='middle' colspan='3' width='99%'><strong>Shipping and Handling</strong></td>" + "<td valign='middle' style='padding-left:50px;float:right;'><strong>!_ship_!</strong></td></tr>"; //tax = "<tr><td valign='middle' colspan='3' width='99%'><strong>Tax</strong></td>" // + "<td valign='middle' style='padding-left:50px;float:right;'><strong>!_tax_!</strong></td></tr>"; //total = "<tr><td valign='middle' colspan='3' width='99%'><strong>Total</strong></td>" // + "<td valign='middle' style='float:right;'><strong>!_total_!</strong></td></tr>"; end_product_list = "</table>"; prod = oVars.proj_desc; if (option) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } if (template == "gift") { prod_list = prod_list.Replace("!_product_!", prod).Replace("!_cost_!", ((oVars.ShipVars[0].unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVars.ShipVars[0].unit_price))); prod_list += space_column; } else { prod_list = ""; foreach (OrderEngine.ShippingVariables oShipVars in oVars.ShipVars) { if (oShipVars.selected) { if ((OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { prod_list += "<tr><td><div style='color: #333333; float: left;'>" + oOffers.item_desc + "</div></td>" + "<td><div style='color: #333333; float: left; display:table-cell; vertical-align:middle;'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost)) + "</div></td>" + "<td align='center'><div style='color: #333333; padding-left: 20px; float: left; display:table-cell; vertical-align:middle;'>" + oShipVars.quantity + "</div></td>" + "<td><div style='color: #333333; padding-left: 10px; float: right; display:table-cell; vertical-align:middle;'>" + ((oOffers.item_cost == 0) ? ((GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity) : "<strong>" + GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity)) + "</div></td>" + "</tr>"; } prod_list += space_column; } else { string tmp_prodlist = ""; foreach (OrderEngine.OfferProperties oOffers in oShipVars.OfferVars) { tmp_prodlist += oOffers.item_desc + "<br />"; } prod_list += "<tr><td style='width: 260px;'><div style='color: #333333; padding-left: 20px; width: 260px; float: left;'>" + tmp_prodlist + "</div></td><td style='width: 50px;' valign='middle' align='right'><div style='color: #333333; padding-left: 20px; width: 50px; float: left; display:table-cell; vertical-align:middle;'>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price)) + "</div></td></tr>"; prod_list += space_column; } } } } start_product_list += prod_list; // start_product_list += dotted_line; if (oVars.discount_amt > 0) { start_product_list += coupon_text.Replace("!_discount_!", String.Format("{0:c}", oVars.discount_amt)); } // This will display Shipping and Handing ONLY when there is NO s&h item listed in the offers. // if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", String.Format("{0:c}", oVars.total_sah)); } if (!oVars.ship_item_listed) { start_product_list += shipping.Replace("!_ship_!", ((oVars.total_sah == 0) ? "<strong>$0.00</strong>" : String.Format("{0:c}", oVars.total_sah))); } //start_product_list += tax.Replace("!_tax_!", String.Format("{0:c}", oVars.tax_amt)); //start_product_list += total.Replace("!_total_!", String.Format("{0:c}", oVars.total_amt + oVars.tax_amt + oVars.total_sah)); return start_product_list += end_product_list; } }
public static OrderVariables AssignShippingToOrderVariable(OrderVariables oVariables, ShippingAddress newShippingAddress) { CommonModels oComm = new CommonModels(); OrderProcess oProcess = new OrderProcess(); //OrderVariables oVariables = new OrderVariables(); oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname = newShippingAddress.ShippingFirstName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname = newShippingAddress.ShippingLastName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1 = newShippingAddress.ShippingAddress1; oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt = newShippingAddress.ShippingAddress2; oVariables.ShipVars[oVariables.default_shp_id].ship_to_city = newShippingAddress.ShippingCity; oVariables.ShipVars[oVariables.default_shp_id].ship_to_state = newShippingAddress.ShippingState; oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode = newShippingAddress.ShippingZipCode; oVariables.ShipVars[oVariables.default_shp_id].child_dob = newShippingAddress.ChildDOB != null ? newShippingAddress.ChildDOB.ToString() : ""; //oVariables.ShipVars[oVariables.default_shp_id].child_fname = newShippingAddress.ChildName; #region Code for Child Name Gender and DOB //======================================== string chName = ""; chName = string.IsNullOrEmpty(newShippingAddress.ChildName) ? "" : newShippingAddress.ChildName.Trim(); string[] name = chName.Split(' '); int cnt = name.Count(); string fname = ""; for (int i = 0; i < name.Count() - 1; i++) { fname += name[i] + " "; } string lname = ""; if (cnt > 1) { lname = name[cnt - 1]; } if (fname.Trim().Length == 0) fname = name.Length > 0 ? name[0] : ""; if (lname.Trim().Length == 0) lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; //oVariables.ShipVars[oVariables.default_shp_id].child_dob = oProcess.ValidateDateTime(newShippingAddress.ChildDOB.ToString()); oVariables.ShipVars[oVariables.default_shp_id].child_fname = fname.Trim(); oVariables.ShipVars[oVariables.default_shp_id].child_lname = lname.Trim(); if (string.IsNullOrEmpty(newShippingAddress.ChildGender) || newShippingAddress.ChildGender == "") oVariables.ShipVars[oVariables.default_shp_id].child_gender = "0"; else oVariables.ShipVars[oVariables.default_shp_id].child_gender = newShippingAddress.ChildGender; //oVariables.referring_url = HttpContext.Current.Request.Url.ToString(); #endregion //================================================= oVariables.ip_address = oComm.GetIPAddress(); oVariables.phone = newShippingAddress.ShippingPhone; oVariables.email = newShippingAddress.ShippingEmail; oVariables.bonus_option = false; if (newShippingAddress.isBonusSelected) { oVariables.bonus_option = true; } //Setting billing Address by default same as shipping address. // later on payment page it will be updated if shipping and biling not same oVariables.bill_to_fname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname; oVariables.bill_to_lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; oVariables.bill_to_address1 = oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1; oVariables.bill_to_apt = oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt; oVariables.bill_to_city = oVariables.ShipVars[oVariables.default_shp_id].ship_to_city; oVariables.bill_to_state = oVariables.ShipVars[oVariables.default_shp_id].ship_to_state; oVariables.bill_to_zipcode = oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode; return oVariables; }
public ActionResult Three_99(FormCollection form, ShippingModels.ShippingAddress shipping) { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["GenderList"] = UtilitiesModels.GetChildGenderNameList(); OrderProcess oProcess = new OrderProcess(); CommonMethods oComm = new CommonMethods(); OrderVariables oVariables = new OrderVariables(); try { if (ModelState.IsValid == false) { var message = string.Join("<br>", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); ViewBag.ErrorMsg = message.ToString(); return View(); } //var value = HttpContext.Request.Params.Get("vendorcode"); //oVariables = oProcess.GetOfferAndPageDetails("seuss-winter-595-responsive"); oVariables = oProcess.GetOfferAndPageDetails("fosina-elmo-399-secure"); #region "Commented by Samrat_Globsyn @ 07.11.2016" //if ((string)Request.QueryString["vendorcode"] != null) { oVariables.vendor_id = (string)Request.QueryString["vendorcode"]; } //if ((string)Request.QueryString["key"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["key"]; } //if ((string)Request.QueryString["vc"] != null) { oVariables.vendor_id = (string)Request.QueryString["vc"]; } //if ((string)Request.QueryString["pc"] != null) { oVariables.promotion_code = (string)Request.QueryString["pc"]; } //if ((string)Request.QueryString["aff_id"] != null) { oVariables.vendor_data1 = (string)Request.QueryString["aff_id"]; } if ((string)Request.QueryString["tracking"] != null) { oVariables.vendor_cust_ref_id = (string)Request.QueryString["tracking"]; } //if ((string)Request.QueryString["src"] != null) { oVariables.pcode_pos_8 = (string)Request.QueryString["src"]; } //if ((string)Request.QueryString["seg"] != null) { oVariables.pcode_segment = (string)Request.QueryString["seg"]; } if ((string)Request.QueryString["aff_id2"] != null) { oVariables.vendor_data2 = (string)Request.QueryString["aff_id2"]; } //oVariables.referring_url = System.Web.HttpContext.Current.Request.Url.ToString(); #endregion var offerService = new OfferService(); oVariables = offerService.MapQueryStringToOrderVariables(oVariables: oVariables); oVariables = ShippingModels.AssignShippingToOrderVariable(oVariables, shipping); //Submitting shipping details to order engin for order process //Code commented for passing to payment page. oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { Session.Add("NewOrderDetails", oVariables); return RedirectToAction("Confirmation", "Home"); } else { if (oVariables.err.Length >= 0) { // page_log += "Order is NOT processed. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; if ((oVariables.order_status == "X") || (oVariables.order_status == "F")) { // page_log += "Order is NOT processed with Order Status X or F. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; // Response.Redirect("../orderstatus.aspx" + oComm.GetURIString(), false); // HttpContext.Current.ApplicationInstance.CompleteRequest(); Session.Add("NewOrderDetails", oVariables); return RedirectToAction("orderstatus", "Home"); } else if (oVariables.err.Length > 0) { // page_log += "Order is NOT processed with an ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; // lblErrorMsg.Text = oVariables.err; // oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); // string error_msg = string.Empty; // error_msg = "alert('" + oVariables.err + "')"; // ScriptManager.RegisterStartupScript(this, this.GetType(), "client_error", error_msg, true); //oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } else if ((oVariables.order_status == "N") || (oVariables.redirect_page.Length > 0)) { // page_log += "Order is NOT processed with NO ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; Session.Add("NewSBMDetails", oVariables); // Response.Redirect("../" + oVariables.redirect_page + oComm.GetURIString() + "&template=club", false); // HttpContext.Current.ApplicationInstance.CompleteRequest(); return RedirectToAction("Payment_399", "Elmo"); } else { /* page_log += "Order is NOT processed with YES ERROR. Error: " + oVariables.err + " | Status: " + oVariables.order_status + "<br>"; lblErrorMsg.Text = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); string error_msg = string.Empty; error_msg = "alert('" + oVariables.err + "')"; ScriptManager.RegisterStartupScript(this, this.GetType(), "client_error", error_msg, true); */ ViewBag.ErrorMsg = oVariables.err; oVariables.err = oVariables.err.Replace("<br>", "\\r\\n"); } } } } else { //page_log += "Order is NOT processed, Order Process returned NULL.<br>"; Session["NewSBMDetails"] = null; return RedirectToAction("orderstatus", "Home"); } //ends Submitting shipping details to order engin for order process //Session["NewSBMDetails"] = oVariables; //Session["ShippingDetails"] = oVariables; //return RedirectToAction("Payment4_for_1", "Seuss"); } catch (Exception ex) { string page_log = "Exception raised. Exception: " + ex.Message.ToString() + "<br>"; CommonModels oCom = new CommonModels(); string s = "";// oCom.LogBrowserCapabilities(Request.Browser); oCom.SendEmail(HttpContext.Request.Url.ToString() + "<br>ex.message = " + ex.Message.ToString() + "<br> Additional Information - " + page_log + ".<br> Browser Details....<br>" + s); return View(); } finally { oVariables = null; oComm = null; oProcess = null; } return View(); }
public ActionResult Confirmation() { OrderVariables oVariables = new OrderVariables(); OrderProcess oProcess = new OrderProcess(); CommonModels oComm = new CommonModels(); string template = ""; string shipall = ""; string orderSummary = ""; string shipping_address = ""; string billing_address = ""; try { if (Session["NewOrderDetails"] != null) { oVariables = new OrderVariables(); oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables != null) { ViewBag.fireFaceBookConfirmationPixel = (Session["fireFaceBookConfirmationPixel"] == null || (Session["fireFaceBookConfirmationPixel"] != null && Session["fireFaceBookConfirmationPixel"].ToString() == "true")) ? true : false; ViewBag.fireFaceBookUpsell2Pixel = (Session["fireFaceBookUpsell2Pixel"] != null && Session["fireFaceBookUpsell2Pixel"].ToString() == "true") ? true : false; ViewBag.fireFaceBookUpsell1Pixel = (Session["fireFaceBookUpsell1Pixel"] != null && Session["fireFaceBookUpsell1Pixel"].ToString() == "true") ? true : false; shipall = (string)Request.QueryString["shipall"] ?? "false"; ViewBag.product = oVariables.proj_desc; ViewBag.special_text = oVariables.special_text; ViewBag.order_id = oVariables.order_id.ToString(); ViewBag.amt = oVariables.total_amt.ToString(); ViewBag.Project = oVariables.project; string CCNumber = oVariables.CCVars[0] != null ? oVariables.CCVars[0].number : ""; ViewBag.CreditCardNumber = EncryptCreditCard(CCNumber); string ccExpiryDate = oVariables.CCVars[0] != null ? oVariables.CCVars[0].expdate : ""; ViewBag.CardExpiry = FormatCCExpiryDate(ccExpiryDate); shipping_address = oComm.Confirmation_ShippingAddress(oVariables); ViewBag.ShippingAddress = shipping_address; billing_address = oComm.Confirmation_BillingAddress(oVariables, template); ViewBag.BillingAddress = billing_address; orderSummary = oComm.ResponsiveConfirmation_GiftingProducts(oVariables); ViewBag.Cart = orderSummary; string email = oVariables.email.ToString(); ViewBag.email = email; if (!string.IsNullOrEmpty(email)) { //ProcessConfirmationEmail(oVariables, shipping_address, billing_address, shipall); //NewConfirmationEmailtoExpertSender(oVariables, shipping_address, billing_address, shipall); BuildDynamicPixel(oVariables); //internalPixel = "<img src='https://ping.earlymoments.com/conversion.ashx?o=" + oVariables.order_id + "&e=" + oVariables.email + "' width='1' height='1' border='0' /><iframe src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=img' width='1' height='1' border='0' />"; //internalPixel = "<iframe src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=img' width='1' height='1' border='0' />"; //Session["IsPostBack"] = true; //if (!oVariables.vendor_id.Contains("QIN") && !oVariables.vendor_id.Contains("FLT")) if (oVariables.hasOfferVid == 0) { FirePostBackPixel(oVariables); } } //string[] campaignId = ConfigurationManager.AppSettings["CampaignId"] != null ? ConfigurationManager.AppSettings["CampaignId"].ToString().Split(',') : null; //if (campaignId != null && campaignId.Contains(oVariables.campaign_id)) // ConfirmAddressDetails(oVariables.ShipVars, oVariables.order_id); } } return View(); } catch (Exception ex) { oComm.SendEmail("Page_Load() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); return View(); } finally { Session["NewOrderDetails"] = null; Session["fireFaceBookUpsell2Pixel"] = null; Session["fireFaceBookConfirmationPixel"] = null; Session["fireFaceBookPixel"] = null; oVariables = null; oComm = null; oProcess = null; } }
private void NewConfirmationEmailtoExpertSender(OrderVariables oVariables, string ship_address, string bill_address, string shipall) { StreamReader emailReader; var oComm = new CommonModels(); try { if (oVariables.order_id <= 0) return; var filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "assets\\emails\\newOC.txt"; emailReader = new StreamReader(filePath); var emailHtml = emailReader.ReadToEnd(); if (emailHtml.Length <= 0) return; var tempBillFname = oVariables.bill_to_fname.Length > 0 ? oVariables.bill_to_fname.ToUpper().Substring(0, 1) + oVariables.bill_to_fname.ToLower().Substring(1) : ""; var tempBillLname = oVariables.bill_to_lname.Length > 0 ? oVariables.bill_to_lname.ToUpper().Substring(0, 1) + oVariables.bill_to_lname.ToLower().Substring(1) : ""; string optoutText = @"<p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:35px; margin-right:35px; margin-top:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">If you no longer want to receive this order, please click on the following link within 24 hours: <a href='https://www.earlymoments.com/optout' target = '_blank' > Cancel Order </a><br /><br /> If you are unable to click on the above link, please copy and paste the below link in the browser: https://www.earlymoments.com/optout</span></p>"; var projectSpecificText = string.Empty; if (oVariables.project.In("DBU")) { projectSpecificText = @"<p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:35px; margin-right:35px; margin-top:0px; color:#1a5eab; background-color:yellow;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;""><span style=""font-size:18px; font-weight:bold;"">Your companion ebooks are waiting for you!</span><br />Your Disney ebooks are available now through the official Early Moments <a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red' target='_blank'>iPad app</a>. Download the FREE Early Moments app from <a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red' target='_blank'>iTunes</a>, and follow the instructions to login for the first time.<br /><br /><a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red' target='_blank'><img src='https://enrollments.earlymoments.com/assets/images/available_on_the_app_store.png' alt='Earlymoments.com' width='130' height='35' border='0' /></a><br /><br />If you are not using an iPad, <a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://ebooks.earlymoments.com/default.aspx?src=cemail&source=7636&brand=e&data=!_OrderNumber_!&type=red' target='_blank'>click here</a> and follow the instructions to use our eReader.<br /></span></p>"; projectSpecificText = projectSpecificText.Replace("!_OrderNumber_!", Convert.ToString(oVariables.order_id)); } emailHtml = emailHtml.Replace("!_BillName_!", tempBillFname); emailHtml = emailHtml.Replace("!_OrderNumber_!", Convert.ToString(oVariables.order_id)); var tmpStr = @"<table width=""90%"" border=""0"" cellspacing=""0"" cellpadding=""8""><tr bgcolor=""#9fbcd8""><td colspan=""2"" valign=""middle""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:16px; line-height: 1.3; margin-left:0px;margin-right:0px; margin-top:0px; margin-bottom:0px; color:#143884; font-weight:bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">ORDER SUMMARY</span></p></td></tr><tr><td width=""50%"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:0px; color:#1a5eab; font-weight:bold;"">Item</p></td><td align=""center"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:0px; color:#1a5eab;font-weight:bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">Price</span></p></td></tr>"; var prod = oVariables.proj_desc; if (Convert.ToBoolean(shipall)) { prod += "<br>(<span style='font-size:9px;'>Will be shipped all at once</span>)"; } foreach (var oShipVars in oVariables.ShipVars) { if (oShipVars.selected) { if ((oComm.OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { foreach (var oOffers in oShipVars.OfferVars) { tmpStr += @"<tr><td width=""50%"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">" + oOffers.item_desc + @"</span></p></td><td align=""center"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:0px; color:#c65696; font-weight: bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">" + ((oOffers.item_cost == 0) ? ((oComm.GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity) : "<strong>" + oComm.GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity)) + @"</span></p></td></tr>"; } } else { string tmpProdlist = ""; foreach (var oOffers in oShipVars.OfferVars) { tmpProdlist += oOffers.item_desc + "<br />"; } tmpStr += @"<tr><td width=""50%"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">" + tmpProdlist + @"</td><td align=""center"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price * oShipVars.quantity)) + @"</span></p></td></tr>"; } } } string shipping = @"<tr><td width=""50%"" valign=""top"" bgcolor=""#dbe6f0""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">Shipping & Handling</span></p></td><td align=""center"" valign=""bottom"" bgcolor=""#dbe6f0""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:0px; color:#c65696;font-weight: bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">!_ship_!</span></p></td></tr>"; if (!oVariables.ship_item_listed) { tmpStr += shipping.Replace("!_ship_!", ((oVariables.total_sah == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVariables.total_sah))); } string taxString = @"<tr><td width=""50%"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">Tax (estimated)</span></p></td><td align=""center"" valign=""middle"" bgcolor=""#dbe6f0""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:0px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">!_tax_!</span></p></td></tr>"; tmpStr += taxString.Replace("!_tax_!", String.Format("{0:c}", oVariables.tax_amt)); string grandTotalText = @"<tr bgcolor=""#9fbcd8""><td width=""50%"" valign=""middle""><p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:25px; margin-right:0px; margin-top:0px; margin-bottom:10px; color:#143884; font-weight:bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">GRAND TOTAL</span></p></td><td align=""center"" valign=""middle""><p style=""text-align:center; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:5px; margin-right:5px; margin-top:0px; margin-bottom:10px; color:#143884; font-weight:bold;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;"">!_grandTotal_!</span></p></td></tr></table>"; tmpStr += grandTotalText.Replace("!_grandTotal_!", String.Format("{0:c}", oVariables.total_amt + oVariables.total_sah + oVariables.tax_amt)); emailHtml = emailHtml.Replace("!_item_list_!", tmpStr); emailHtml = emailHtml.Replace("!_Discount_!", String.Format("{0:c}", oVariables.discount_amt)); if (oVariables.discount_amt > 0) emailHtml = emailHtml.Replace("!_hidden_!", "block"); else emailHtml = emailHtml.Replace("!_hidden_!", "none"); emailHtml = emailHtml.Replace("!_Tax_!", String.Format("{0:c}", oVariables.tax_amt)); emailHtml = emailHtml.Replace("!_GrandTotal_!", String.Format("{0:c}", oVariables.total_amt + oVariables.total_sah + oVariables.tax_amt)); emailHtml = emailHtml.Replace("!_ShipAddress_!", ship_address); emailHtml = emailHtml.Replace("!_BillAddress_!", bill_address); emailHtml = emailHtml.Replace("!_conf_pg_tac_!", oVariables.PageVars[0].conf_pg_tac); emailHtml = emailHtml.Replace("!_reward_code_!", ""); emailHtml = emailHtml.Replace("!_special_text_!", oVariables.special_text); emailHtml = emailHtml.Replace("!_email_!", oVariables.email); string pixel = "<iframe src='https://services.earlymoments.com/ping/p.ashx?source=7629&brand=e&data=" + oVariables.email.Trim() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7629&brand=e&data=" + oVariables.email.Trim() + "&type=img' width='1' height='1' border='0' />"; emailHtml = emailHtml.Replace("!_link_!", pixel); emailHtml = emailHtml.Replace("*[tr_specialText]*", projectSpecificText); emailHtml = emailHtml.Replace("*[tr_optOutText]*", oVariables.opt_out == "Y" ? optoutText : ""); emailHtml = emailHtml.Replace("*[tr_customerFirstName]*", tempBillFname); emailHtml = emailHtml.Replace("*[tr_orderSummary]*", tmpStr); emailHtml = emailHtml.Replace("*[tr_specialPromotionalText]*", ""); emailHtml = emailHtml.Replace("*[tr_childName]*", oVariables.ShipVars[oVariables.default_shp_id].child_fname.Trim().Length == 0 ? "your child" : oVariables.ShipVars[oVariables.default_shp_id].child_fname); emailHtml = emailHtml.Replace("*[tr_orderNumber]*", oVariables.order_id.ToString()); var adSpaceHTML = @"<p style=""text-align:left; font-family:'Open Sans', Helvetica, tahoma; font-size:14px; line-height: 1.3; margin-left:35px; margin-right:35px; margin-top:5px; color:#1a5eab;""><span style=""font-family:'Open Sans', Helvetica, tahoma; !important;""><strong> ***NOTICE: This order qualifies for a CASH BACK REBATE!*** <a href=""http://click.email.earlymoments.com/?qs=d4b5be4b2347ace6d8fe6a38c7b3bbfb0035b5c3bf0f285c63a0c9f929518fe74f384500f81401f5"" target=""_blank"">Click Here</a></strong></span></p>"; emailHtml = emailHtml.Replace("*[tr_adSpace]*", adSpaceHTML); var expertSender = new ExpertSender(); var subscriber = expertSender.AddSubscriber(oVariables.email, oVariables.bill_to_fname, oVariables.bill_to_lname, oVariables.vendor_id, oVariables.ip_address, oVariables.order_id.ToString()); ////Response.Write("subscriber: " + subscriber); ////string __email = ConfigurationManager.AppSettings["tempConfEmail"]; var emailTran = expertSender.PrepareTransactionalEmail(oVariables.email, emailHtml, oVariables.order_id.ToString(), oVariables.proj_desc); ////Response.Write("emailTran: " + emailTran); } catch (Exception ex) { oComm.SendEmail("New-ProcessConfirmationEmail() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } }
public ActionResult thankyou() { string template = ""; string shipall = ""; string orderSummary = ""; string shipping_address = ""; string billing_address = ""; try { if (Session["NewOrderDetails"] != null) { oVariables = new OrderVariables(); oVariables = Session["NewOrderDetails"] as OrderVariables; if (oVariables != null) { shipall = ((string)Request.QueryString["shipall"] != null) ? (string)Request.QueryString["shipall"] : "false"; ViewBag.product = oVariables.proj_desc; ViewBag.special_text = oVariables.special_text; ViewBag.order_id = oVariables.order_id.ToString(); ViewBag.amt = oVariables.total_amt.ToString(); ViewBag.Project = oVariables.project; string CCNumber = oVariables.CCVars[0] != null ? oVariables.CCVars[0].number : ""; ViewBag.CreditCardNumber = EncryptCreditCard(CCNumber); string ccExpiryDate = oVariables.CCVars[0] != null ? oVariables.CCVars[0].expdate : ""; ViewBag.CardExpiry = FormatCCExpiryDate(ccExpiryDate); shipping_address = oCom.Confirmation_ShippingAddress(oVariables); ViewBag.ShippingAddress = shipping_address; billing_address = oCom.Confirmation_BillingAddress(oVariables, template); ViewBag.BillingAddress = billing_address; orderSummary = oCom.ResponsiveConfirmation_GiftingProducts(oVariables, false, "", false); ViewBag.Cart = orderSummary; string email = oVariables.email.ToString(); ViewBag.email = email; string spltext = ""; if (!string.IsNullOrEmpty(oVariables.special_text)) spltext = oVariables.special_text; ViewBag.SpecialText = spltext; if (!string.IsNullOrEmpty(email)) { //ProcessConfirmationEmail(oVariables, shipping_address, billing_address, shipall); NewConfirmationEmailtoExpertSender(oVariables, shipping_address, billing_address, shipall); BuildDynamicPixel(oVariables); //internalPixel = "<img src='https://ping.earlymoments.com/conversion.ashx?o=" + oVariables.order_id + "&e=" + oVariables.email + "' width='1' height='1' border='0' /><iframe src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=img' width='1' height='1' border='0' />"; //internalPixel = "<iframe src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7630&brand=e&data=" + oVariables.order_id.ToString() + "&type=img' width='1' height='1' border='0' />"; //Session["IsPostBack"] = true; FirePostBackPixel(oVariables); } } else { ViewBag.ErrorMsg = genericCustomerServiceMsg; } } else { ViewBag.ErrorMsg = genericCustomerServiceMsg; } return View(); } catch (Exception ex) { oCom.SendEmail("Page_Load() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); return View(); } finally { Session["NewOrderDetails"] = null; oVariables = null; oComm = null; oProcess = null; } }
public static OrderVariables AssignShippingBillingToOrderVariables(OrderVariables oVariables, ShippingBillingOrder newShippingAddress) { if (newShippingAddress != null && newShippingAddress.stepNumber == 1) { CommonModels oComm = new CommonModels(); OrderProcess oProcess = new OrderProcess(); //OrderVariables oVariables = new OrderVariables(); oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname = newShippingAddress.ShippingFirstName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname = newShippingAddress.ShippingLastName; oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1 = newShippingAddress.ShippingAddress1; oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt = newShippingAddress.ShippingAddress2; oVariables.ShipVars[oVariables.default_shp_id].ship_to_city = newShippingAddress.ShippingCity; oVariables.ShipVars[oVariables.default_shp_id].ship_to_state = newShippingAddress.ShippingState; oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode = newShippingAddress.ShippingZipCode; oVariables.ShipVars[oVariables.default_shp_id].child_dob = newShippingAddress.ChildDOB != null ? newShippingAddress.ChildDOB.ToString() : ""; //oVariables.referring_url = HttpContext.Current.Request.Url.ToString(); #region Code for Child Name Gender and DOB //======================================== string chName = ""; chName = string.IsNullOrEmpty(newShippingAddress.ChildName) ? "" : newShippingAddress.ChildName.Trim(); string[] name = chName.Split(' '); int cnt = name.Count(); string fname = ""; for (int i = 0; i < name.Count() - 1; i++) { fname += name[i] + " "; } string lname = ""; if (cnt > 1) { lname = name[cnt - 1]; } if (fname.Trim().Length == 0) fname = name.Length > 0 ? name[0] : ""; if (lname.Trim().Length == 0) lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; // oVariables.ShipVars[oVariables.default_shp_id].child_dob = oProcess.ValidateDateTime(newShippingAddress.ChildDOB.ToString()); oVariables.ShipVars[oVariables.default_shp_id].child_fname = fname.Trim(); oVariables.ShipVars[oVariables.default_shp_id].child_lname = lname.Trim(); if (string.IsNullOrEmpty(newShippingAddress.ChildGender) || newShippingAddress.ChildGender == "") oVariables.ShipVars[oVariables.default_shp_id].child_gender = "0"; else oVariables.ShipVars[oVariables.default_shp_id].child_gender = newShippingAddress.ChildGender; //oVariables.referring_url = HttpContext.Current.Request.Url.ToString(); #endregion //================================================= oVariables.ip_address = oComm.GetIPAddress(); oVariables.phone = newShippingAddress.ShippingPhone; oVariables.email = newShippingAddress.ShippingEmail; oVariables.bonus_option = false; if (newShippingAddress.isBonusSelected) { oVariables.bonus_option = true; } //Setting billing Address by default same as shipping address. // later on payment page it will be updated if shipping and biling not same oVariables.bill_to_fname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_fname; oVariables.bill_to_lname = oVariables.ShipVars[oVariables.default_shp_id].ship_to_lname; oVariables.bill_to_address1 = oVariables.ShipVars[oVariables.default_shp_id].ship_to_address1; oVariables.bill_to_apt = oVariables.ShipVars[oVariables.default_shp_id].ship_to_apt; oVariables.bill_to_city = oVariables.ShipVars[oVariables.default_shp_id].ship_to_city; oVariables.bill_to_state = oVariables.ShipVars[oVariables.default_shp_id].ship_to_state; oVariables.bill_to_zipcode = oVariables.ShipVars[oVariables.default_shp_id].ship_to_zipcode; return oVariables; } else if (newShippingAddress != null && newShippingAddress.stepNumber == 2) { //As we are setting billing and shipping address same on landing page if (newShippingAddress.isBillingSameToShipping == false) { oVariables.bill_to_fname = newShippingAddress.BillingFirstName.Trim(); oVariables.bill_to_lname = newShippingAddress.BillingLastName.Trim(); oVariables.bill_to_address1 = newShippingAddress.BillingAddress1.Trim(); oVariables.bill_to_apt = (!string.IsNullOrEmpty(newShippingAddress.BillingAddress2)) ? newShippingAddress.BillingAddress2.Trim() : ""; oVariables.bill_to_city = newShippingAddress.BillingCity.Trim(); oVariables.bill_to_state = newShippingAddress.BillingState.Trim(); oVariables.bill_to_zipcode = newShippingAddress.BillingZipCode.Trim(); } //Assigning Payment details to OVariable oVariables.credit_rule = "CCC"; oVariables.err = ""; if (oVariables.CCVars.Count > 0) { oVariables.CCVars[0].number = newShippingAddress.CreditCardNumber.Trim(); oVariables.CCVars[0].type = ""; oVariables.CCVars[0].expdate = newShippingAddress.CardExpiryMonth.Trim() + newShippingAddress.CardExpiryYear.Trim(); oVariables.CCVars[0].cvv = newShippingAddress.SecurityCode.Trim(); oVariables.CCVars[0].zipcode = newShippingAddress.CCBillZipCode.Trim(); // oVariables.bill_to_zipcode;// newShippingAddress.BillingZipCode.Trim(); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } else { CCProperties oCCVars = new OrderEngine.CCProperties(); oVariables.payment_type = "CC"; oCCVars.number = newShippingAddress.CreditCardNumber.Trim(); oCCVars.type = ""; oCCVars.expdate = newShippingAddress.CardExpiryMonth.Trim() + newShippingAddress.CardExpiryYear.Trim(); oCCVars.cvv = newShippingAddress.SecurityCode.Trim(); oCCVars.zipcode = newShippingAddress.CCBillZipCode.Trim(); // oVariables.bill_to_zipcode;// (billingDetails.BillingZipCode != null && billingDetails.BillingZipCode != "") ? billingDetails.BillingZipCode.Trim() : oVariables.bill_to_zipcode; // billingDetails.BillingZipCode.Trim(); oVariables.credit_rule = "CCC"; oVariables.CCVars.Add(oCCVars); oVariables.total_amt = 0.0; oVariables.total_sah = 0.0; } return oVariables; } else return null; }
private void ProcessConfirmationEmail(OrderVariables oVariables, string ship_address, string bill_address, string shipall) { var oComm = new CommonModels(); try { if (oVariables.order_id <= 0) return; var oProcess = new OrderEngine.OrderProcess(); var tempBillFname = oVariables.bill_to_fname.Length > 0 ? oVariables.bill_to_fname.ToUpper().Substring(0, 1) + oVariables.bill_to_fname.ToLower().Substring(1) : ""; string tempBillLname = oVariables.bill_to_lname.Length > 0 ? oVariables.bill_to_lname.ToUpper().Substring(0, 1) + oVariables.bill_to_lname.ToLower().Substring(1) : ""; const string optoutText = "If you no longer want to receive this order, please click on the following link within 24 hours: <a href='http://www.earlymoments.com/optout'" + "target='_blank'>Cancel Order</a><br /><br />If you are unable to click on the above link, please copy and paste the below link" + " in the browser: http://www.earlymoments.com/optout<br /><br />"; string projectSpecificText = ""; if (oVariables.project.In("DBU")) { projectSpecificText = "<br><div style='background-color: Yellow; padding: 15px;'><strong>Your companion ebooks are waiting for you!</strong><br />Your Disney ebooks are available now through the official Early Moments " + "<a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red'" + " target='_blank'>iPad app</a>. Download the FREE Early Moments app from <a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red' target='_blank'>iTunes</a>, and follow the instructions to login for the first time.<br />" + "<a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://itunes.apple.com/us/app/early-moments/id661335739?mt=8&source=7635&brand=e&data=!_OrderNumber_!&type=red' target='_blank'><img src='https://enrollments.earlymoments.com/assets/images/available_on_the_app_store.png' alt='Earlymoments.com' width='130' height='35' border='0' /></a>" + "<br /><br />If you are not using an iPad, <a href='https://services.earlymoments.com/ping/redirect.ashx?newUrl=https://ebooks.earlymoments.com/default.aspx?src=cemail&source=7636&brand=e&data=!_OrderNumber_!&type=red' target='_blank'>click here</a> and follow the instructions to use our eReader.<br /></div>"; projectSpecificText = projectSpecificText.Replace("!_OrderNumber_!", Convert.ToString(oVariables.order_id)); } const string nonOptputText = "Visit us online at <a href='http://www.earlymoments.com' target='_blank'>www.EarlyMoments.com</a><br />"; string tmpStr = "<tr bgcolor='#eeeeee'><td style='width: 293px;'><div style='color: #333333; float: left;'><strong>Item Description</strong></div></td><td width='60px' valign='middle' align='right'><div style='color: #333333; float: left; display:table-cell; vertical-align:middle;'><strong>Item Price</strong></div></td></tr>"; string space_column = "<tr height='5px''><td colspan='2'></td></tr>"; foreach (OrderEngine.ShippingVariables oShipVars in oVariables.ShipVars) { if (oShipVars.selected) { if ((oComm.OfferItemsDisplayType(oShipVars.OfferVars) > 1) || (oShipVars.OfferVars.Count == 1)) { tmpStr = oShipVars.OfferVars.Aggregate(tmpStr, (current, oOffers) => current + ("<tr><td style='width: 293px;' valign='top' align='left'>" + oOffers.item_desc + "</td><td style='width: 60px;' valign='top' align='right'><div style='float: right; display:table-cell; vertical-align:middle;'>" + ((oOffers.item_cost == 0) ? ((oComm.GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) == "") ? String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity) : "<strong>" + oComm.GetPriceDisplayType(oOffers.oeprop, oOffers.item_cost) + "</strong>") : String.Format("{0:c}", oOffers.item_cost * oShipVars.quantity)) + "</div></td></tr>")); tmpStr += space_column; } else { string tmpProdlist = oShipVars.OfferVars.Aggregate("", (current, oOffers) => current + (oOffers.item_desc + "<br />")); tmpStr += "<tr><td style='width: 293px;' valign='top' align='left'>" + tmpProdlist + "</td><td style='width: 60px;' valign='top' align='right'><div style='float: right; display:table-cell; vertical-align:middle;'>" + ((oShipVars.unit_price == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oShipVars.unit_price * oShipVars.quantity)) + "</div></td></tr>"; tmpStr += space_column; } } } const string shipping = "<tr><td style='width: 293px;' valign='top' align='left'>Shipping and Handling</td><td style='width: 60px;' valign='top' align='right'><div style='float: right; display:table-cell; vertical-align:middle;'>!_ship_!</div></td></tr>"; if (!oVariables.ship_item_listed) { tmpStr += shipping.Replace("!_ship_!", ((oVariables.total_sah == 0) ? "<strong>FREE</strong>" : String.Format("{0:c}", oVariables.total_sah))); } var pixel = "<iframe src='https://services.earlymoments.com/ping/p.ashx?source=7629&brand=e&data=" + oVariables.email.Trim() + "&type=ifr' height='1' width='1' frameborder='0'></iframe><br /><img src='https://services.earlymoments.com/ping/p.ashx?source=7629&brand=e&data=" + oVariables.email.Trim() + "&type=img' width='1' height='1' border='0' />"; try { oComm.ProcessConfirmationEmails(oVariables.email , tempBillFname , tempBillLname , oVariables.proj_desc , tmpStr , oVariables.special_text , (oVariables.opt_out == "Y" ? optoutText : nonOptputText) , bill_address , ship_address , oVariables.order_id.ToString() , pixel , String.Format("{0:c}", oVariables.tax_amt) , String.Format("{0:c}", oVariables.total_amt + oVariables.total_sah + oVariables.tax_amt) , projectSpecificText); } catch (Exception ex) { oComm.SendEmail("", "", "EM Confirmation Page: Important", "Error while logging Confirmation email to Database - error: " + ex.Message.ToString(), ""); } } catch (Exception ex) { oComm.SendEmail("ProcessConfirmationEmail() <br />Exception Raised from Confirmaiton Page in EM Landers. Exception: " + ex.Message.ToString() + ".<br />More Data (Offer URL): " + oVariables.referring_url + ". <br />More Data (Order Id):" + oVariables.order_id); } }