public ActionResult Billing(int pageId)
        {
            checkoutProcess checkoutItem = (checkoutProcess)Session["checkoutProcess"];
            checkoutItem.clearDataOnStepAndBindCurrentStep(checkoutStep.billing);

            // Validation
            var validation = checkoutItem.validationOnCurrentStep(db);
            if (!validation.Item1)
            {
                return redirectToValidation(validation, checkoutItem);
            }

            // Kayıtlı Üye
            if (checkoutItem.cartItem.isRegisteredUser)
            {
                addressShared ads = new addressShared(db);
                userShared us = new userShared(db);

                helperRegisterBilling helperPage = new helperRegisterBilling();
                sharedCheckoutItemLoad(pageId, helperPage, checkoutItem);
                helperPage.addressList = ads.getAddressListTemplate(checkoutItem.cartItem.userId).OrderByDescending(a => a.addressId).ToList();
                helperPage.selectedBillingAddressId = checkoutItem.billingAddressId;

                helperPage.userguid = checkoutItem.cartItem.userGuid;

                Session["checkoutProcess"] = checkoutItem;
                return View("BillingRegister", helperPage);
            }
            else // Üye olmadan Ödeme
            {
                helperUnRegisterBilling helperPage = new helperUnRegisterBilling();
                sharedCheckoutItemLoad(pageId, helperPage, checkoutItem);

                if (checkoutItem.billingAddress != null)
                {
                    helperPage.addressItem = checkoutItem.billingAddress;
                }
                else
                {
                    if (checkoutItem.isBillingSameAddress && checkoutItem.deliveryAddress != null)
                    {
                        helperPage.addressItem = checkoutItem.deliveryAddress;
                    }
                    else
                    {
                        helperPage.addressItem = new Models.tbl_address();
                    }
                }

                helperPage.addressItem.isPersonal = true;

                Session["checkoutProcess"] = checkoutItem;
                return View("BillingUnRegister", helperPage);

            }
        }
        public ActionResult AddressIndex(int pageId)
        {
            pageShared ps = new pageShared(db);
            userShared us = new userShared(db);
            addressShared ash = new addressShared(db);

            var pageItem = ps.getPageById(pageId);
            var mainAccountPage = db.tbl_page.Include("tbl_category").Where(a => a.pageTypeId == (int)pageType.account).FirstOrDefault();

            helperAddress pageHelper = new helperAddress();

            ps.pageTitleBind(pageItem, pageHelper, langId);
            pageHelper.setTitle(pageItem.name);
            pageHelper.detail = pageItem.detail;

            pageHelper.leftMenuList = generateLeftMenu(mainAccountPage, pageItem.url);
            pageHelper.breadCrumbItem = getBreadCrumbTwoPage(mainAccountPage.name, mainAccountPage.url, pageItem.name, pageItem.url);

            topCart cartItem = (topCart)ViewData["topCart"];
            var userItem = us.getUserById(cartItem.userId);

            pageHelper.userguid = userItem.guid;
            pageHelper.addressList = ash.getAddressListTemplate(userItem.userId);

            return View(pageHelper);
        }
        public JsonResult DeliveryRegisterModal(int pageId, int addressId)
        {
            checkoutProcess checkoutItem = (checkoutProcess)Session["checkoutProcess"];

            // Kayıtlı Üye
            if (checkoutItem.cartItem.isRegisteredUser)
            {
                addressShared ads = new addressShared(db);
                userShared us = new userShared(db);
                helperRegisterDelivery helperPage = new helperRegisterDelivery();

                sharedCheckoutItemLoad(pageId, helperPage, checkoutItem);

                helperPage.addressList = ads.getAddressListTemplate(checkoutItem.cartItem.userId).OrderByDescending(a => a.addressId).ToList();
                helperPage.userguid = checkoutItem.cartItem.userGuid;
                helperPage.selectedDeliveryAddressId = addressId;

                string htmlText = RenderRazorViewToString("DeliveryRegisterModal", helperPage);
                return Json(new { html = htmlText }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return null;
            }
        }