Пример #1
0
        public string getAddressHtml(int addressId, AddressHtmlType addressType, DbWithControllerWithMaster helperController)
        {
            string addressHtml = "";
            var addressItem = db.tbl_address.Where(a => a.addressId == addressId).FirstOrDefault();
            addressHtml = getAddressHtml(addressItem, addressType, helperController);

            return addressHtml;
        }
Пример #2
0
        public string getAddressHtml(tbl_address addressItem, AddressHtmlType addressType, DbWithControllerWithMaster helperController)
        {
            if (addressItem != null)
            {

                switch (addressType)
                {
                    case AddressHtmlType.agreement:
                        var item = getAddressAccountTemplate(addressItem);
                        return item.content;

                    case AddressHtmlType.mail:
                    case AddressHtmlType.orderDetail:

                        return helperController.RenderRazorViewToString("AddressMailHtml", addressItem);

                    case AddressHtmlType.adminOrderDetail:
                        return "";
                }

            }

            return "";
        }
Пример #3
0
        internal orderInfo getOrderInfoByCheckoutProcess(checkoutProcess checkoutItem, orderSummary helperPage, DbWithControllerWithMaster helperController, BasketHtmlType htmlType, AddressHtmlType addressType, TransferHtmlType transferType, int langId)
        {
            var ads = new addressShared(db);
            var us = new userShared(db);
            var item = new ViewModel.Checkout.Summary.orderInfo();

            // Kayıtlı Üye
            if (checkoutItem.cartItem.isRegisteredUser)
            {

                //customerNameSurname
                item.customerNameSurname = checkoutItem.cartItem.nameSurname;

                //customerEmail
                var userId = checkoutItem.cartItem.userId;
                item.customerEmail = us.getUserById(userId).email;

                //customer Delivery Adress
                item.deliveryHtml = ads.getAddressHtml(checkoutItem.deliveryAddressId, addressType, helperController);

                //customerPhone
                item.customerPhone = ads.getAddresPhoneByAddressId(checkoutItem.deliveryAddressId);

                // customer Billing Addres
                item.billingHtml = ads.getAddressHtml(checkoutItem.billingAddressId, addressType, helperController);
            }
            else
            {
                //customerNameSurname
                item.customerNameSurname = checkoutItem.trackInfo.name + " " + checkoutItem.trackInfo.surname;

                //customerEmail
                item.customerEmail = checkoutItem.trackInfo.email;

                //customer Delivery Adress
                item.deliveryHtml = ads.getAddressHtml(checkoutItem.deliveryAddress, addressType, helperController);

                //customerPhone
                item.customerPhone = checkoutItem.deliveryAddress.phone;

                // customer Billing Addres
                item.billingHtml = ads.getAddressHtml(checkoutItem.billingAddress, addressType, helperController);
            }

            item.orderDate = DateTime.Now.ToString("dd.MM.yyyy");
            item.customerBasket = getBasketListWithPlainHtml(helperPage, helperController, htmlType);
            item.transferAccountHtml = getTransferInfoHtml(checkoutItem.transferInfo.selectedTransferId, langId, helperController, transferType);

            return item;
        }