Ejemplo n.º 1
0
        public IActionResult Index()
        {
            RegisterViewModel model = new RegisterViewModel();

            if (_cookieService.checkUserLogin())
            {
                return(Redirect("~/anasayfa"));
            }
            model.termsconditionMessage = _defaultValuesService.getDefaultValue("uyeliksozlesmesi");
            return(View(model));
        }
Ejemplo n.º 2
0
        public PaymentViewModel getPaymentInformation()
        {
            PaymentViewModel model  = new PaymentViewModel();
            Guid             userId = _usersService.getUserInformation(_cookieService.getSessionEmail()).userId;

            model.agreementMessage = _defaultValuesService.getDefaultValue("satissozlesmesi");
            int        activeYear = DateTime.Now.Year;
            List <int> yearList   = new List <int>();

            yearList.Add(activeYear);
            for (int i = 1; i < 10; i++)
            {
                yearList.Add(activeYear + i);
            }
            model.creditCardYearList = yearList.Select(s => new SelectListItem()
            {
                Text  = s.ToString(),
                Value = s.ToString()
            }).ToList();
            model.companiesForInvoice = _mainContext.companies.Where(w => w.userId == userId).Select(s => new SelectListItem()
            {
                Text  = s.companyTitle + " - " + s.adress,
                Value = s.id.ToString()
            }).ToList();
            model.paymentStatus       = PaymentResultsStatusEnum.none;
            model.creditCardMonthList = ((CreditCardMonthEnum[])Enum.GetValues(typeof(CreditCardMonthEnum))).Select(c => new SelectListItem()
            {
                Value = ((int)c).ToString(), Text = c.GetDescription()
            }).ToList();
            var myBasket = _basketService.myBasketList();

            model.totalPrice                    = myBasket.basketList.Sum(i => i.totalPrice);
            model.totalPriceWithoutTax          = myBasket.basketList.Sum(i => i.priceWithoutTax);
            model.bankAccounts                  = new BankAccountsListViewModel();
            model.bankAccounts.bankAccountsList = _mapper.Map <IList <BankAccountsViewModel> >(_mainContext.bankAccounts.Where(w => w.status == GeneralStatusEnum.Active).ToList());
            return(model);
        }