Example #1
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;
        }
Example #2
0
        public string getTransferInfoHtml(int eftId, int langId, DbWithControllerWithMaster helperController, TransferHtmlType transferType)
        {
            var eftItem = getEftList(langId).Where(a => a.bankEftId == eftId).FirstOrDefault();
            if (eftItem != null)
            {
                switch (transferType)
                {
                    case TransferHtmlType.mail:
                    case TransferHtmlType.orderDetail:
                        return helperController.RenderRazorViewToString("TransferMailHtml", eftItem);

                }

            }

            return "";
        }