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 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 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 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 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; } }
protected void btnDownload_Click(object sender, System.EventArgs e) { Timer1.Enabled = true; //Label1.Text = "Refreshed at " + //DateTime.Now.ToString(); bool blnServiceStarted; bool blnNoError; try { objCommonMethods = new CommonMethods(); objCController = new CController(); objIController = (CController)objCController; objCMWException = new CMWException(); objCommonMethods = new CommonMethods(); objIController.SetFilePath(strProjectDBPath); Shared.udtNetworkType = objIController.GetNetworkType(strProjectDBPath); ResgistrySettings RegSettings; RegSettings = objIController.GetRegistrySettings(); Shared.ProjectDBPath = strProjectDBPath; Shared.ApplicationPath = RegSettings.InstallationPath; objDownloadSettings = new DownloadSettings(); //start downloader Service blnServiceStarted = objCommonMethods.StartDownloaderService(); //Communication Type objDownloadSettings.TCP = true; objDownloadSettings.ipAddress = "159.99.185.100"; //Port number objDownloadSettings.portNumber = Constants.portNumber; //Gateway type objDownloadSettings.enumDownloadGateway = GateWay.E3NGA; //NetworkType objDownloadSettings.enumNetworkType = Shared.udtNetworkType; //Node type objDownloadSettings.enumBoardTypeID = BoardTypeID.ILI_S_E3; //Node Number objDownloadSettings.NodeNumber = 2; //Firmware path objDownloadSettings.FirmwarePath = ""; //7100 network card objDownloadSettings.Do7100CardDownload = false; //RPT card objDownloadSettings.DoRPTDownload = false; //LCD-SLP load objDownloadSettings.DoLCDSLPDownload = false; //LCD-SLP Graphics objDownloadSettings.DoLCDSLPGraphicsDownload = false; //Project Path objDownloadSettings.ProjectPath = Shared.ProjectDBPath; //Level 4 Password objDownloadSettings.L4Password = "******"; //Download Type objDownloadSettings.DownloadTypes = (int)DownloadTypes.CAMOnly | (int)DownloadTypes.ConfigOnly | (int)DownloadTypes.LabelsOnly; //Installer ID objDownloadSettings.InstallerID = "1234"; //Virtual Switch objDownloadSettings.LoadVirtualSwitch = false; //Site Specific key objDownloadSettings.SiteSpecificKey = 1234; //Application path objDownloadSettings.ApplicationPath = Shared.ApplicationPath; OnCommandCompleted = new DelegateCommandCompleted(Query_OnCommandCompleted); objCallback = new CallbackClass(); objCallback.OnHostToClient += new RemoteCallback(Status_Changed); //call back delegate RemoteCallback wire = new RemoteCallback(objCallback.HandleToClient); //Parameters to be passed between the client and CAMWorksDownloader service. CallbackEventArgs objCallBckArgs = new CallbackEventArgs(); objCallBckArgs.CallBack = wire; objCallBckArgs.IsError = false; objCallBckArgs.Finished = false; objCallBckArgs.CommandId = CommandName.ConfigDownload; objCallBckArgs.State = 0; objCallBckArgs.Sender = GetType().ToString(); objCallBckArgs.Parameters = objDownloadSettings; blnNoError = objIController.DownloadConfigData(objCallBckArgs); if (!blnNoError) { arListStatus.Add(objCMWException.GetExceptions(objCMWException.LastException, "")); // IsDownloadSuucessful = false; OnCommandCompleted(); } //objCMWException = null; objCallBckArgs = null; objDownloadSettings = null; } catch (Exception Ex) { } }
public ActionResult four_for_1_spring2(string SubmitButton, FormCollection form, ShippingModels.ShippingBillingOrder shipping) { ViewData["StatesList"] = UtilitiesModels.GetStateNameList(); ViewData["GenderList"] = UtilitiesModels.GetChildGenderNameList(); ViewData["MonthList"] = UtilitiesModels.GetMonthNameList(); ViewData["YearList"] = UtilitiesModels.GetCardExpiryYearList(); OrderProcess oProcess = new OrderProcess(); CommonMethods oComm = new CommonMethods(); CommonModels oCom = new CommonModels(); OrderVariables oVariables = new OrderVariables(); string cart_details, conf_pg_tac, total = ""; string shipall = "false"; string template = ""; string pixel = ""; try { if (!string.IsNullOrEmpty(SubmitButton)) { switch (SubmitButton.ToLower()) { case "rush my books": oVariables = oProcess.GetOfferAndPageDetails("fosina-seuss-4for1-secure-activity"); shipping.stepNumber = 1; var offerService = new OfferService(); oVariables = offerService.MapQueryStringToOrderVariables(oVariables: oVariables); oVariables = ShippingModels.AssignShippingBillingToOrderVariables(oVariables, shipping); oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { Session.Add("NewOrderDetails", oVariables); if (oVariables.upsellId != 0) { Session["fireFaceBookConfirmationPixel"] = "false"; return RedirectToAction("OrderDetails", "AdditionalOffers"); } else { Session["fireFaceBookConfirmationPixel"] = "true"; return RedirectToAction("Confirmation", "Home"); } } 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); shipping.stepNumber = 2; #region LoadPaymentSection try { if (Session["NewSBMDetails"] != null) { oVariables = (OrderVariables)Session["NewSBMDetails"]; Dictionary<string, string> d = oCom.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 = oCom.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("four_for_1_spring", "seuss", routeValues: ViewContextExtensions.OptionalParamters(Request.QueryString)); } } catch (Exception ex) { oCom.SendEmail("Exception Raised in EM Landers Payment Page - " + ex.Message.ToString()); return View(); } finally { oComm = null; oVariables = null; } #endregion } else { 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"); } break; case "submit order": #region Payment Submit if (!string.IsNullOrEmpty(shipping.SecurityCaptch) && Session["rndtext"] != null) { string strCaptch = Session["rndtext"] as string; if (!strCaptch.Equals(shipping.SecurityCaptch)) { ViewBag.ErrorMsg = "Invalid Security Captch."; // return View(); } } else { //if (string.IsNullOrEmpty(billing.SecurityCaptch)) //{ ViewBag.ErrorMsg = "Security Captch 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 = oCom.GetOfferCreatives(oVariables); ViewBag.HeaderImageSrc = oCom.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 = oCom.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; // billing.SecurityCaptch = ""; // ViewData.Model = billing; //return View(ViewData.Model); return View(); } shipping.stepNumber = 2; oVariables = ShippingModels.AssignShippingBillingToOrderVariables(oVariables, shipping); oVariables = oProcess.OrderSubmit(oVariables); if (oVariables != null) { if (oVariables.order_id > 0) { Session["NewSBMDetails"] = null; Session.Add("NewOrderDetails", oVariables); if (oVariables.upsellId != 0) { Session["fireFaceBookConfirmationPixel"] = "false"; return RedirectToAction("OrderDetails", "AdditionalOffers"); } else { Session["fireFaceBookConfirmationPixel"] = "true"; 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 = oCom.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 = oCom.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("four_for_1_spring2", "seuss", routeValues: ViewContextExtensions.OptionalParamters(Request.QueryString)); } } catch (Exception ex) { oCom.SendEmail("Exception Raised in EM Landers Payment Page (Submit) - " + ex.Message.ToString()); return View(); } finally { oComm = null; oVariables = null; oProcess = null; } #endregion break; } } } catch (Exception ex) { string page_log = "Exception raised. Exception: " + ex.Message.ToString() + "<br>"; 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 override string ToString() { return(string.Format("%s/%s:%d packet: %d", remoteHost, CommonMethods.ipIntToString(remoteIP), remotePort & 0xFFFF, packetSent)); }
protected void Page_Load(object sender, EventArgs e) { //if (!Page.IsPostBack) //{ objCommonMethods = new CommonMethods(); objCController = new CController(); objIController = (CController)objCController; objCMWException = new CMWException(); objCommonMethods = new CommonMethods(); objIController.SetFilePath(strProjectDBPath); objPanels = objIController.ReadPanelIds(); WebDataGrid1.DataSource = GetDataTable(); if (!Page.IsPostBack) { WebDataGrid1.DataSource = GetDataTable(); //this.WebDataGrid1.DataSourceID = "AccessDataSource1"; } else { WebDataGrid1.DataSource = ""; //this.WebDataGrid1.DataSourceID = ""; WebDataGrid1.StyleSetName = this.DDList1.SelectedValue; WebDataGrid1.DataSource = GetDataTable(); //this.WebDataGrid1.DataSourceID = "AccessDataSource1"; } //} // WebProgressBar1.Value = intProgress; if (intProgress <= 100) WebProgressBar1.Value = intProgress; }
public bool isFalling() { return(!CommonMethods.onGround(rb2d.position, player.getStats().GroundDistanceCheck)); }
protected void btnDislikeOnClick(object sender, EventArgs e) { Panel pl = ((Button)sender).Parent as Panel; if (pl != null) { LinkButton authorName = pl.FindControl("authorLinkButton") as LinkButton; Label postID = pl.FindControl("postID") as Label; string authorID = new CommonMethods().getAcc(postID.Text); if (votingChecker(authorName.Text)) { string accID = new CommonMethods().getAcc(postID.Text); int voteCount = 1; string voter = Session["username"].ToString(); SqlConnection con8 = new DBManager().getConnection(); string sql8 = "SELECT [voteCount] FROM [CZ2006 - Life Planner].[dbo].[Voting] WHERE postID = @postID AND voter = @voter;"; SqlCommand cmd8 = new SqlCommand(sql8, con8); cmd8.Parameters.AddWithValue("@postID", postID.Text); cmd8.Parameters.AddWithValue("@voter", voter); con8.Open(); SqlDataReader dr = cmd8.ExecuteReader(); //checker for one-time voting if (dr.Read()) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert!", "alert('Sorry! You have voted this post once before already!');", true); return; } con8.Close(); SqlConnection con7 = new DBManager().getConnection(); string sql7 = "INSERT INTO [CZ2006 - Life Planner].[dbo].[Voting] (postID, voter, author, voteCount) VALUES (@postID, @voter, @author, @voteCount);"; SqlCommand cmd7 = new SqlCommand(sql7, con7); cmd7.Parameters.AddWithValue("@postID", postID.Text); cmd7.Parameters.AddWithValue("@voter", Session["username"].ToString()); cmd7.Parameters.AddWithValue("@author", authorName.Text); cmd7.Parameters.AddWithValue("@voteCount", voteCount); con7.Open(); cmd7.ExecuteNonQuery(); con7.Close(); int numDislikesBalance = new CommonMethods().getNumDislikesBalance(postID.Text); int uponVote = 1; int newNumDislikesBalance = numDislikesBalance + uponVote; new CommonMethods().updateNumLikesBalance(postID.Text, newNumDislikesBalance); Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert!", "alert('You have disliked this post ):');", true); return; } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert!", "alert('You cannot vote on your own post.');", true); return; } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert!", "alert('Not found!');", true); return; } }
/// <summary> /// 新的版本值 /// </summary> /// <param name="val">当前值</param> /// <returns></returns> private object NewConcurrencyValue(object val) { Type objType = val.GetType(); if (DefaultType.EqualType(objType, DefaultType.IntType)) { return((int)val + 1); } if (DefaultType.EqualType(objType, DefaultType.DoubleType)) { return((double)val + 1); } if (DefaultType.EqualType(objType, DefaultType.FloatType)) { return((float)val + 1); } if (DefaultType.EqualType(objType, DefaultType.DateTimeType)) { return(DateTime.Now); } if (DefaultType.EqualType(objType, DefaultType.DecimalType)) { return((decimal)val + 1); } if (DefaultType.EqualType(objType, DefaultType.ByteType)) { return((byte)val + 1); } if (DefaultType.EqualType(objType, DefaultType.SbyteType)) { return((sbyte)val + 1); } if (DefaultType.EqualType(objType, DefaultType.ShortType)) { return((short)val + 1); } if (DefaultType.EqualType(objType, DefaultType.LongType)) { return((long)val + 1); } if (DefaultType.EqualType(objType, DefaultType.ULongType)) { return((ulong)val + 1); } if (DefaultType.EqualType(objType, DefaultType.UShortType)) { return((ushort)val + 1); } if (DefaultType.EqualType(objType, DefaultType.UIntType)) { return((uint)val + 1); } if (DefaultType.EqualType(objType, DefaultType.StringType)) { return(CommonMethods.GuidToString(Guid.NewGuid())); } if (DefaultType.EqualType(objType, DefaultType.GUIDType)) { return(Guid.NewGuid()); } return(null); }
public TokenModel GetToken(HttpContext httpContext) { return(CommonMethods.GetTokenDataModel(httpContext)); }
/// <summary> /// Generate BarCrum Tree Items /// </summary> /// <param name="objlist">TreeItem Collection</param> private void GenerateBar(IEnumerable <SystemMenuTreeList> objlist) { try { Binding languageBinding = new Binding() { Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, Path = new PropertyPath(BreadcrumbItem.LanguageProperty) }; LocalizeItemSelector localizeItemSelector; foreach (var item in objlist) { localizeItemSelector = new LocalizeItemSelector(); CommonMethods.AddLocalizeItem(localizeItemSelector, "ja", item.NameJa != null ? item.NameJa : PropertyValueNotSet); CommonMethods.AddLocalizeItem(localizeItemSelector, "en", item.NameEn != null ? item.NameEn : PropertyValueNotSet); CommonMethods.AddLocalizeItem(localizeItemSelector, "th", item.NameTh != null ? item.NameTh : PropertyValueNotSet); CommonMethods.AddLocalizeItem(localizeItemSelector, "zh", item.NameTh != null ? item.NameTh : PropertyValueNotSet); if (item.PId == 0) { withChildBreadcrumbItem = new BreadcrumbItem(); withChildBreadcrumbItem.Header = localizeItemSelector.setLocalizeValue(withChildBreadcrumbItem, BreadcrumbItem.HeaderProperty); withChildBreadcrumbItem.PageUri = item.PageUri; withChildBreadcrumbItem.SetBinding(BreadcrumbItem.LanguageProperty, languageBinding); this.Items.Add(withChildBreadcrumbItem); var Parents1 = ItemSource.OrderBy(p => p.DisplayIndex).Where(p => p.PId == item.Id); if (Parents1.Any()) { GenerateBar(Parents1); } } else { withoutChildBreadcrumbItem = new BreadcrumbItem(); withoutChildBreadcrumbItem.PageUri = item.PageUri; withoutChildBreadcrumbItem.SetBinding(BreadcrumbItem.LanguageProperty, languageBinding); withoutChildBreadcrumbItem.Header = localizeItemSelector.setLocalizeValue(withoutChildBreadcrumbItem, BreadcrumbItem.HeaderProperty); if (!DicBreadCrumbItemAddressBar.ContainsKey(item.Id)) { DicBreadCrumbItemAddressBar.Add(item.Id, withoutChildBreadcrumbItem); } if (DicBreadCrumbItemAddressBar.ContainsKey(item.PId)) { DicBreadCrumbItemAddressBar[item.PId].Items.Add(withoutChildBreadcrumbItem); } else { withChildBreadcrumbItem.Items.Add(withoutChildBreadcrumbItem); } var Parents = ItemSource.OrderBy(p => p.DisplayIndex).Where(p => p.PId == item.Id); if (Parents.Any()) { GenerateBar(Parents); } } } } catch (Exception) { throw; } }
private void btnLuu_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtSoThe.Text)) { MessageBox.Show("Hãy nhập số thẻ!", "Thông báo", MessageBoxButtons.OK); txtSoThe.Focus(); return; } else { the.soThe = txtSoThe.Text; } //Check ngay nhan if (CommonMethods.KiemTraNhapNgay(txtNgayNhanThe.Text)) { the.ngayNhan = DateTime.ParseExact(txtNgayNhanThe.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); } else { if (txtNgayGiaoThe.Text != " / /") { MessageBox.Show("Nhập sai định dạng ngày tháng!", "Thông báo", MessageBoxButtons.OK); } else { MessageBox.Show("Hãy nhập ngày nhận thẻ!", "Thông báo", MessageBoxButtons.OK); } txtNgayNhanThe.Focus(); return; } //check ngay giao if (CommonMethods.KiemTraNhapNgay(txtNgayGiaoThe.Text)) { the.ngayGiao = DateTime.ParseExact(txtNgayGiaoThe.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); try { ThongTinTheDAL.GiaoThe(the); this.Close(); } catch { ErrorMessageDAL.DataAccessError(); } } else { if (txtNgayGiaoThe.Text != " / /") { MessageBox.Show("Nhập sai định dạng ngày tháng!", "Thông báo", MessageBoxButtons.OK); txtNgayGiaoThe.Focus(); return; } try { ThongTinTheDAL.NhanThe(the); this.Close(); } catch { ErrorMessageDAL.DataAccessError(); } } }
public ExMonk() { Name = "Ex-Monk"; ClassAlignments = CommonMethods.GetAlignments(); }