protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { this.BindData(); } }
protected override void OnInit(EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } BindOrders(); BindRecurringPayments(); base.OnInit(e); }
protected void Checkout() { ApplyCheckoutAttributes(); if (NopContext.Current.User == null || NopContext.Current.User.IsGuest) { string loginURL = SEOHelper.GetLoginPageUrl(true, true); Response.Redirect(loginURL); } else { Response.Redirect("~/checkout.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !CustomerManager.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (this.Cart.Count == 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (NopContext.Current.User == null || NopContext.Current.User.IsGuest) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string title = GetLocaleResourceString("PageTitle.Account"); SEOHelper.RenderTitle(this, title, true); }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (Cart.Count == 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } //validation var scWarnings = this.ShoppingCartService.GetShoppingCartWarnings(Cart, NopContext.Current.User.CheckoutAttributes, true); if (scWarnings.Count > 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } else { foreach (ShoppingCartItem sci in this.Cart) { List <String> sciWarnings = this.ShoppingCartService.GetShoppingCartItemWarnings( sci.ShoppingCartType, sci.ProductVariantId, sci.AttributesXml, sci.CustomerEnteredPrice, sci.Quantity); if (sciWarnings.Count > 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } } } if (!Page.IsPostBack) { if (!this.ShippingService.ShoppingCartRequiresShipping(Cart)) { pnlShippingAddress.Visible = false; pnlShippingMethods.Visible = false; } SelectPane(CheckoutStepEnum.ShippingAddress); } }
protected void btnEdit_Click(object sender, EventArgs e) { var forumTopic = ForumManager.GetTopicById(this.TopicId); if (forumTopic != null) { if (!ForumManager.IsUserAllowedToEditTopic(NopContext.Current.User, forumTopic)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string editForumTopicURL = SEOHelper.GetEditForumTopicUrl(forumTopic.ForumTopicId); Response.Redirect(editForumTopicURL); } }
protected void btnMoveTopic_Click(object sender, EventArgs e) { var forumTopic = this.ForumService.GetTopicById(this.TopicId); if (forumTopic != null) { if (!this.ForumService.IsUserAllowedToMoveTopic(NopContext.Current.User, forumTopic)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string moveForumTopicURL = SEOHelper.GetMoveForumTopicUrl(forumTopic); Response.Redirect(moveForumTopicURL); } }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { this.FillCountryDropDowns(); this.FillStateProvinceDropDowns(); this.FillTimeZones(); this.BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } CommonHelper.SetResponseNoCache(Response); if (!Page.IsPostBack) { if (!AmazonHelper.ValidateRequest(Request.QueryString, String.Format("{0}AmazonSimplePayReturn.aspx", CommonHelper.GetStoreLocation()), "GET")) { Response.Redirect(CommonHelper.GetStoreLocation()); } int orderId = Convert.ToInt32(CommonHelper.QueryStringInt("referenceId")); Order order = OrderManager.GetOrderById(orderId); if (order == null) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (SimplePaySettings.SettleImmediately) { if (OrderManager.CanMarkOrderAsPaid(order)) { OrderManager.MarkOrderAsPaid(order.OrderId); } } else { if (OrderManager.CanMarkOrderAsAuthorized(order)) { OrderManager.MarkAsAuthorized(order.OrderId); } } Response.Redirect("~/checkoutcompleted.aspx"); } }
/// <summary> /// Logout customer /// </summary> private void logout() { IoC.Resolve <ICustomerService>().Logout(); string loginURL = string.Empty; if (HozestERPContext.Current != null) { if (HozestERPContext.Current.IsAdmin) { loginURL = SEOHelper.GetAdminAreaLoginPageUrl(); } else { loginURL = SEOHelper.GetLoginPageUrl(); } HttpContext.Current.Response.Redirect(loginURL); } }
/// <summary> /// Logout customer /// </summary> private void logout() { CustomerManager.Logout(); string loginURL = string.Empty; if (NopContext.Current != null) { if (NopContext.Current.IsAdmin) { loginURL = SEOHelper.GetAdminAreaLoginPageUrl(); } else { loginURL = SEOHelper.GetLoginPageUrl(); } HttpContext.Current.Response.Redirect(loginURL); } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (!this.SettingManager.GetSettingValueBoolean("Checkout.UseOnePageCheckout")) { Response.Redirect("~/checkout.aspx"); } string title = GetLocaleResourceString("PageTitle.CheckoutOnePage"); SEOHelper.RenderTitle(this, title, true); if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } }
protected void btnEdit_Click(object sender, EventArgs e) { int forumPostId = 0; int.TryParse(lblForumPostId.Text, out forumPostId); var forumPost = ForumManager.GetPostById(forumPostId); if (forumPost != null) { if (!ForumManager.IsUserAllowedToEditPost(NopContext.Current.User, forumPost)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string url = SEOHelper.GetEditForumPostUrl(forumPost.ForumPostId); Response.Redirect(url); } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if (NopContext.Current.User == null || NopContext.Current.User.IsGuest) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!this.ForumService.AllowPrivateMessages) { Response.Redirect(CommonHelper.GetStoreLocation()); } string title = GetLocaleResourceString("PageTitle.ViewPM"); SEOHelper.RenderTitle(this, title, true); }
protected void btnSubmitVoteRecord_Click(object sender, EventArgs e) { var customer = NopContext.Current.User; if (rblPollAnswers.SelectedItem != null && customer != null && !customer.IsGuest) { int pollAnswerId = Convert.ToInt32(rblPollAnswers.SelectedItem.Value); if (!PollManager.PollVotingRecordExists(this.PollId, customer.CustomerId)) { PollManager.CreatePollVotingRecord(pollAnswerId, customer.CustomerId); } BindData(true); } else { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } }
protected void Page_Load(object sender, EventArgs e) { CommonHelper.SetResponseNoCache(Response); if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !CustomerManager.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } ShoppingCart cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart); if (cart.Count == 0) { Response.Redirect(SEOHelper.GetShoppingCartUrl()); } this.btnNextStep.Attributes.Add("onclick", "this.disabled = true;" + Page.ClientScript.GetPostBackEventReference(this.btnNextStep, "")); }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } order = OrderManager.GetOrderById(this.OrderId); if (order == null || order.Deleted || NopContext.Current.User.CustomerId != order.CustomerId) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { this.BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } CommonHelper.SetResponseNoCache(Response); if (!Page.IsPostBack) { int orderId = Convert.ToInt32(Request.Form["x"]); Order order = this.OrderService.GetOrderById(orderId); if (order == null) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } string authkey = Request.Form["authkey"]; int transact = Int32.Parse(Request.Form["transact"]); int currency = DibsHelper.GetCurrencyNumberByCode(this.CurrencyService.PrimaryStoreCurrency.CurrencyCode); int amount = (int)((double)order.OrderTotal * 100); if (!authkey.Equals(FlexWinHelper.CalcAuthKey(transact, amount, currency))) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (this.OrderService.CanMarkOrderAsPaid(order)) { this.OrderService.MarkOrderAsPaid(order.OrderId); } Response.Redirect("~/checkoutcompleted.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { //comment this line to process return Response.Redirect(CommonHelper.GetStoreLocation()); if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } CommonHelper.SetResponseNoCache(Response); if (!Page.IsPostBack) { Order order = this.OrderService.GetOrderById(CommonHelper.QueryStringInt("Order_IDP")); if (order == null || NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (HostedPaymentSettings.AuthorizeOnly) { if (this.OrderService.CanMarkOrderAsAuthorized(order)) { this.OrderService.MarkAsAuthorized(order.OrderId); } } else { if (this.OrderService.CanMarkOrderAsPaid(order)) { this.OrderService.MarkOrderAsPaid(order.OrderId); } } Response.Redirect("~/checkoutcompleted.aspx"); } }
protected void btnReply_Click(object sender, EventArgs e) { var forumTopic = this.ForumService.GetTopicById(this.TopicId); if (forumTopic != null) { if (NopContext.Current.User == null && this.ForumService.AllowGuestsToCreatePosts) { this.CustomerService.CreateAnonymousUser(); } if (!this.ForumService.IsUserAllowedToCreatePost(NopContext.Current.User, forumTopic)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } string newForumPostURL = SEOHelper.GetNewForumPostUrl(forumTopic.ForumTopicId); Response.Redirect(newForumPostURL); } }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } CommonHelper.SetResponseNoCache(Response); if (!Page.IsPostBack) { if (!PayPointHelper.ValidateResponseSign(Request.Url)) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (!CommonHelper.QueryStringBool("valid")) { Response.Redirect(CommonHelper.GetStoreLocation()); } int orderId = CommonHelper.QueryStringInt("trans_id"); Order order = this.OrderService.GetOrderById(orderId); if (order == null) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (this.OrderService.CanMarkOrderAsPaid(order)) { this.OrderService.MarkOrderAsPaid(order.OrderId); } Response.Redirect("~/checkoutcompleted.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } order = OrderManager.GetOrderById(this.OrderId); if (order == null || order.Deleted || NopContext.Current.User.CustomerId != order.CustomerId) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { this.BindData(); } //buttons lbPDFInvoice.Visible = SettingManager.GetSettingValueBoolean("Features.SupportPDF"); }
protected void Page_Load(object sender, EventArgs e) { //comment this line to process return Response.Redirect(CommonHelper.GetStoreLocation()); CommonHelper.SetResponseNoCache(Response); if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { if (!CommonHelper.QueryStringBool("trnApproved")) { Response.Redirect(CommonHelper.GetStoreLocation()); } int orderId = CommonHelper.QueryStringInt("trnOrderNumber"); Order order = this.OrderService.GetOrderById(orderId); if (order == null) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (this.OrderService.CanMarkOrderAsPaid(order)) { this.OrderService.MarkOrderAsPaid(order.OrderId); } Response.Redirect("~/checkoutcompleted.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (!Page.IsPostBack) { var orderCollection = NopContext.Current.User.Orders; if (orderCollection.Count == 0) { Response.Redirect(CommonHelper.GetStoreLocation()); } else { var lastOrder = orderCollection[0]; lblOrderNumber.Text = lastOrder.OrderId.ToString(); hlOrderDetails.NavigateUrl = string.Format("{0}OrderDetails.aspx?OrderID={1}", CommonHelper.GetStoreLocation(), lastOrder.OrderId).ToLowerInvariant(); } } }
private void BindData() { pnlError.Visible = false; var forumTopic = this.ForumService.GetTopicById(this.ForumTopicId); if (forumTopic == null) { Response.Redirect(SEOHelper.GetForumMainUrl()); } if (!this.ForumService.IsUserAllowedToMoveTopic(NopContext.Current.User, forumTopic)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } ctrlForumBreadcrumb.ForumTopicId = forumTopic.ForumTopicId; ctrlForumBreadcrumb.BindData(); ctrlForumSelector.SelectedForumId = forumTopic.ForumId; ctrlForumSelector.BindData(); }
protected void PostCartToGoogle(object sender, ImageClickEventArgs e) { //user validation if (NopContext.Current.User == null && this.CustomerService.AnonymousCheckoutAllowed) { //create anonymous record this.CustomerService.CreateAnonymousUser(); } if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !this.CustomerService.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } //USD for US dollars, GBP for British pounds, SEK for Swedish krona, EUR for Euro etc GCheckoutButton1.Currency = this.CurrencyService.PrimaryStoreCurrency.CurrencyCode; var Req = GCheckoutButton1.CreateRequest(); var googleCheckoutPaymentProcessor = new GoogleCheckoutPaymentProcessor(); NopSolutions.NopCommerce.BusinessLogic.Orders.ShoppingCart cart = this.ShoppingCartService.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart); var Resp = googleCheckoutPaymentProcessor.PostCartToGoogle(Req, cart); if (Resp.IsGood) { Response.Redirect(Resp.RedirectUrl); } else { Response.Clear(); Response.Write("Resp.RedirectUrl = " + Resp.RedirectUrl + "<br />"); Response.Write("Resp.IsGood = " + Resp.IsGood + "<br />"); Response.Write("Resp.ErrorMessage = " + Server.HtmlEncode(Resp.ErrorMessage) + "<br />"); Response.Write("Resp.ResponseXml = " + Server.HtmlEncode(Resp.ResponseXml) + "<br />"); Response.End(); } }
protected void btnPaypalExpress_Click(object sender, EventArgs e) { if ((NopContext.Current.User == null) || (NopContext.Current.User.IsGuest && !CustomerManager.AnonymousCheckoutAllowed)) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } var payPalExpress = new PayPalExpressPaymentProcessor(); var ppePaymentMethod = PaymentMethodManager.GetPaymentMethodBySystemKeyword("PayPalExpress"); if (ppePaymentMethod != null && ppePaymentMethod.IsActive) { decimal?cartTotal = ShoppingCartManager.GetShoppingCartTotal(cart, ppePaymentMethod.PaymentMethodId, NopContext.Current.User, false); if (cartTotal.HasValue) { string expressCheckoutURL = payPalExpress.SetExpressCheckout(cartTotal.Value, CommonHelper.GetStoreLocation(false) + "paypalexpressreturn.aspx", CommonHelper.GetStoreLocation(false)); Response.Redirect(expressCheckoutURL); } } }
protected void Page_Load(object sender, EventArgs e) { string title = GetLocaleResourceString("PageTitle.AddressEdit"); SEOHelper.RenderTitle(this, title, true); CommonHelper.SetResponseNoCache(Response); if (NopContext.Current.User == null) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } var address = CustomerManager.GetAddressById(this.AddressId); if (address != null) { var addressCustomer = address.Customer; if (addressCustomer == null || addressCustomer.CustomerId != NopContext.Current.User.CustomerId) { string loginURL = SEOHelper.GetLoginPageUrl(true); Response.Redirect(loginURL); } if (DeleteAddress) { CustomerManager.DeleteAddress(address.AddressId); Response.Redirect(SEOHelper.GetMyAccountUrl()); } } if (!Page.IsPostBack) { this.BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if ((NopContext.Current.User == null) || NopContext.Current.User.IsGuest) { Response.Redirect(SEOHelper.GetLoginPageUrl(true)); } CommonHelper.SetResponseNoCache(Response); if (!Page.IsPostBack) { Order order = OrderManager.GetOrderById(CommonHelper.QueryStringInt("OrderId")); if (order == null) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (NopContext.Current.User.CustomerId != order.CustomerId) { Response.Redirect(CommonHelper.GetStoreLocation()); } string md5 = CommonHelper.QueryString("MD5"); if (String.IsNullOrEmpty(md5) || !md5.Equals(HostedPaymentHelper.CalcMd5Hash(String.Format("{0}SveaHostedPaymentReturn.aspx{1}{2}", CommonHelper.GetStoreHost(false), Regex.Replace(Request.Url.Query, "&MD5=.*", String.Empty), HostedPaymentSettings.Password)))) { Response.Redirect(CommonHelper.GetStoreLocation()); } if (OrderManager.CanMarkOrderAsPaid(order)) { OrderManager.MarkOrderAsPaid(order.OrderId); } Response.Redirect("~/checkoutcompleted.aspx"); } }