public ActionResult Index()
        {
            if (!WalletProvider.WalletsAreEnabled())
            {
                NoticeProvider.PushNotice(AppLogic.GetString("checkout.wallet.disabled"), NoticeType.Warning);
                return(RedirectToAction(ActionNames.Index, ControllerNames.Account));
            }

            var customer = HttpContext.GetCustomer();

            if (!CustomerHasAvailableAddresses(customer))
            {
                NoticeProvider.PushNotice(
                    message: AppLogic.GetString("account.aspx.92"),
                    type: NoticeType.Warning);

                return(RedirectToAction(ActionNames.Index, ControllerNames.Account));
            }

            return(View(new WalletIndexViewModel(
                            paymentTypes: WalletProvider
                            .GetPaymentProfiles(customer)
                            .Select(p => new WalletPaymentType
            {
                CardType = p.CardType,
                CardImage = DisplayTools.GetCardImage(
                    imagePath: VirtualPathUtility.ToAbsolute(string.Format("~/skins/{0}/images/", SkinProvider.GetSkinNameById(customer.SkinID).ToLower())),
                    cardName: p.CardType),
                CardNumber = p.CreditCardNumberMasked,
                ExpirationMonth = p.ExpirationMonth,
                ExpirationYear = p.ExpirationYear,
                PaymentProfileId = p.PaymentProfileId
            }))));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            if (!WalletProvider.WalletsAreEnabled())
            {
                NoticeProvider.PushNotice("Wallets are not enabled.", NoticeType.Warning);
                return(RedirectToAction(ActionNames.Index, ControllerNames.Account));
            }

            var customer = HttpContext.GetCustomer();

            if (!CustomerHasAvailableAddresses(customer))
            {
                NoticeProvider.PushNotice(
                    message: "You must have a billing address configured before you can add a credit card to your account.",
                    type: NoticeType.Warning);

                return(RedirectToAction(ActionNames.Index, ControllerNames.Account));
            }

            return(View(new WalletIndexViewModel(
                            paymentTypes: WalletProvider
                            .GetPaymentProfiles(customer)
                            .Select(p => new WalletPaymentType
            {
                CardType = p.CardType,
                CardImage = DisplayTools.GetCardImage(
                    imagePath: VirtualPathUtility.ToAbsolute(string.Format("~/skins/{0}/images/", SkinProvider.GetSkinNameById(customer.SkinID).ToLower())),
                    cardName: p.CardType),
                CardNumber = p.CreditCardNumberMasked,
                ExpirationMonth = p.ExpirationMonth,
                ExpirationYear = p.ExpirationYear,
                PaymentProfileId = p.PaymentProfileId
            }))));
        }
Esempio n. 3
0
        public ActionResult CreditCardDetail()
        {
            var customer = HttpContext.GetCustomer();

            var showCardStartDateFields = AppLogic.AppConfigBool("ShowCardStartDateFields");

            var walletsAreEnabled  = customer.IsRegistered && WalletProvider.WalletsAreEnabled();
            var displayWalletCards = walletsAreEnabled && WalletProvider.GetPaymentProfiles(customer).Any();

            string name           = customer.FullName(),
                   number         = null,
                   cardType       = null,
                   expirationDate = null,
                   startDate      = null;

            var checkoutContext = PersistedCheckoutContextProvider.LoadCheckoutContext(customer);

            if (checkoutContext.CreditCard != null)
            {
                name = checkoutContext.CreditCard.Name ?? customer.FullName();

                number = GetCreditCardNumberForDisplay(checkoutContext.CreditCard.Number);

                cardType = checkoutContext.CreditCard.CardType;

                expirationDate = GetCreditCardDateForDisplay(checkoutContext.CreditCard.ExpirationDate);

                startDate = GetCreditCardDateForDisplay(checkoutContext.CreditCard.StartDate);
            }

            var skinProvider = new SkinProvider();

            return(PartialView(ViewNames.CreditCardDetailPartial, new CheckoutCreditCardViewModel
            {
                Name = name,
                Number = number,
                CardType = cardType,
                ExpirationDate = expirationDate,
                StartDate = startDate,
                ShowStartDate = showCardStartDateFields,
                WalletsAreEnabled = walletsAreEnabled,
                DisplayWalletCards = displayWalletCards,
                LastFour = (!string.IsNullOrEmpty(number) && number.Length > 4)
                                        ? number.Substring(number.Length - 4)
                                        : null,
                CardImage = !string.IsNullOrEmpty(cardType)
                                        ? DisplayTools.GetCardImage(
                    imagePath: Url.SkinUrl("images/"),
                    cardName: cardType)
                                        : null
            }));
        }
        public static DataTable GetAccountsComboBox()
        {
            DataTable result = DisplayTools.getComboBoxPattern();

            for (int i = 0; i < Core.CurrentProfile.Accounts.Length; i++)
            {
                DataRow row = result.NewRow();
                row["value"]   = i;
                row["display"] = Core.CurrentProfile.Accounts[i].Name + " - " + Core.CurrentProfile.Accounts[i].Balance.ToString() + " - " + Core.CurrentProfile.Accounts[i].ACurrency.Simbol;
                result.Rows.Add(row);
            }
            return(result);
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            //double[,] matrix =
            //{
            //    {1, -2, 5, 9},
            //    {1, -1, 3, 2},
            //    {3, -6, -1, 25}
            //};

            //double[,] matrix =
            //{
            //    {1, 2, 1, 8},
            //    {2, 1, -1, 1},
            //    {2, -1, 1, 3}
            //};

            double[,] matrix =
            {
                { 1, 2, 3, 4, 5 },
                { 6, 7, 8, 9, 1 },
                { 2, 3, 5, 6, 7 }
            };

            //double[,] matrix =
            //{
            //    {9, 3, 4, 7},
            //    {4, 3, 4, 8},
            //    {1, 1, 1, 3}
            //};

            //double[,] matrix =
            //{
            //    {1, -3, 1, 4},
            //    {2, -8, 8, -2},
            //    {-6, 3, -15, 9}
            //};

            Console.WriteLine("Kiinduló állapot: ");
            DisplayTools.ToConsole(matrix);
            Logic l = new Logic(matrix);

            l.Process();
            Console.WriteLine("Eredmény: ");
            DisplayTools.ToConsole(l.CalculateResult());

            Console.ReadKey();
        }
        public ActionResult SelectWallet()
        {
            var customer        = HttpContext.GetCustomer();
            var paymentProfiles = WalletProvider.GetPaymentProfiles(customer);

            return(PartialView(new WalletSelectViewModel(
                                   walletPaymentTypes: paymentProfiles
                                   .Select(profile => new WalletPaymentType
            {
                PaymentProfileId = profile.PaymentProfileId,
                CardType = profile.CardType,
                CardNumber = profile.CreditCardNumberMasked,
                ExpirationMonth = profile.ExpirationMonth,
                ExpirationYear = profile.ExpirationYear,
                CardImage = Url.Content(string.Format("~/skins/{0}/Images/{1}",
                                                      SkinProvider.GetSkinNameById(customer.SkinID),
                                                      DisplayTools.GetCardImage(string.Empty, profile.CardType)))
            }))));
        }
        public static DataTable GetTargetsComboBox()
        {
            DataTable result   = DisplayTools.getComboBoxPattern();
            DataRow   emptyRow = result.NewRow();

            emptyRow["value"]   = 0;
            emptyRow["display"] = "Toate";
            result.Rows.Add(emptyRow);
            if (Core.CurrentProfile.HasCategories)
            {
                for (int i = 0; i < Core.CurrentProfile.Targets.Length; i++)
                {
                    DataRow row = result.NewRow();
                    row["value"]   = Core.CurrentProfile.Targets[i].Id;
                    row["display"] = Core.CurrentProfile.Targets[i].Name;
                    result.Rows.Add(row);
                }
            }
            return(result);
        }
 // Because some engines have hardcoded resolution lists...
 public virtual List <ResolutionItem> GetVideoModes()
 {
     return(DisplayTools.GetVideoModes());
 }
Esempio n. 9
0
 public override List <ResolutionItem> GetVideoModes()
 {
     return(DisplayTools.GetFixedVideoModes(rmodes));
 }