Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var checkoutEligibleSession = Session[CommonManager.GetCheckoutEligibleSessionName()];

            if (checkoutEligibleSession != null)
            {
                var checkoutEligible = (bool)checkoutEligibleSession;
                if (!checkoutEligible)
                {
                    Response.Redirect("MyAccountInformation.aspx");
                }
                else
                {
                    var customerId      = Session[CommonManager.GetCustIdSessionName()];
                    var customerDetails = new CustomerModel().GetCustomerDetails(CustomerGetType.id, Convert.ToInt32(customerId));
                    if (customerDetails != null)
                    {
                        addLine1.Value = customerDetails.First().addressLine1;
                        addLine2.Value = customerDetails.First().addressLine2;
                        city.Value     = customerDetails.First().city;
                    }
                }
            }

            var cartSession = Session[CommonManager.GetCartItemsSessionName()];

            if (cartSession != null)
            {
                var cart = (List <int>)cartSession;
                GetRelatedItemsGridDetails(cart, ItemType.All);
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var activationCode = Request.QueryString["ActivationCode"];
                if (!String.IsNullOrEmpty(activationCode))
                {
                    new CustomerModel().ActivateUser(activationCode);

                    successActMsgBox.Visible = true;
                    errorActMsgBox.Visible   = false;
                }

                var checkout = Request.QueryString["Checkout"];
                if (!String.IsNullOrEmpty(checkout))
                {
                    var customerList = new CustomerModel().GetCustomerDetails(CustomerGetType.email, 0, activationCode);
                    if (customerList.Count > 0)
                    {
                        var customer = customerList.First();
                        Session.Add(CommonManager.GetCustIdSessionName(), customer.Id);
                        Session.Add(CommonManager.GetCustNameSessionName(), customer.username);
                        Session.Add(CommonManager.GetCustEmailSessionName(), new AESManager().DecryptString(activationCode));
                        Session.Add(CommonManager.GetCheckoutEligibleSessionName(), false);

                        string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/";
                        Response.Redirect(baseUrl + "CheckoutBillingInfoUpdate.aspx");
                    }
                }
            }
            catch (Exception)
            {
                successActMsgBox.Visible = false;
                errorActMsgBox.Visible   = true;
            }
        }