Esempio n. 1
0
        public void LoadPlayers(PersonnelSetting ps)
        {
            Quarterback.Players = ps.Quarterback.Players;
            //Quarterback.Players.Clear();
            //Quarterback.Players.AddRange(ps.Quarterback.Players);

            for (int i = 0; i < Receivers.Count(); i++)
            {
                Receivers[i].Players = ps.Receivers[i].Players;
                //Receivers[i].Players.Clear();
                //Receivers[i].Players.AddRange(ps.Receivers[i].Players);
            }

            for (int i = 0; i < Runningbacks.Count(); i++)
            {
                Runningbacks[i].Players = ps.Runningbacks[i].Players;
                //Runningbacks[i].Players.Clear();
                //Runningbacks[i].Players.AddRange(ps.Runningbacks[i].Players);
            }

            for (int i = 0; i < OffensiveLinemen.Count(); i++)
            {
                OffensiveLinemen[i].Players = ps.OffensiveLinemen[i].Players;
                //OffensiveLinemen[i].Players.Clear();
                //OffensiveLinemen[i].Players.AddRange(ps.OffensiveLinemen[i].Players);
            }

            for (int i = 0; i < TightEnds.Count(); i++)
            {
                TightEnds[i].Players = ps.TightEnds[i].Players;
                //TightEnds[i].Players.Clear();
                //TightEnds[i].Players.AddRange(ps.TightEnds[i].Players);
            }

            for (int i = 0; i < Cornerbacks.Count(); i++)
            {
                Cornerbacks[i].Players = ps.Cornerbacks[i].Players;
                //Cornerbacks[i].Players.Clear();
                //Cornerbacks[i].Players.AddRange(ps.Cornerbacks[i].Players);
            }

            for (int i = 0; i < Linebackers.Count(); i++)
            {
                Linebackers[i].Players = ps.Linebackers[i].Players;
                //Linebackers[i].Players.Clear();
                //Linebackers[i].Players.AddRange(ps.Linebackers[i].Players);
            }

            for (int i = 0; i < DefensiveLinemen.Count(); i++)
            {
                DefensiveLinemen[i].Players = ps.DefensiveLinemen[i].Players;
                //DefensiveLinemen[i].Players.Clear();
                //DefensiveLinemen[i].Players.AddRange(ps.DefensiveLinemen[i].Players);
            }

            for (int i = 0; i < Safeties.Count(); i++)
            {
                Safeties[i].Players = ps.Safeties[i].Players;
                //Safeties[i].Players.Clear();
                //Safeties[i].Players.AddRange(ps.Safeties[i].Players);
            }
        }
Esempio n. 2
0
        public IDictionary <string, string> AsNvpDictionary()
        {
            var dictionary = new Dictionary <string, string>
            {
                { "returnUrl", ReturnUrl },
                { "cancelUrl", CancelUrl },
                { "memo", Memo }
            };


            if (Sender != null)
            {
                dictionary.Add("senderEmail", Sender.Email);
                dictionary.Add("senderFirstName", Sender.FirstName);
                dictionary.Add("senderLastName", Sender.LastName);
            }



            for (int i = 0; i < Receivers.Count(); i++)
            {
                dictionary.Add(string.Format("receiverList.receiver({0}).email", i), Receivers[i].Email);
                dictionary.Add(string.Format("receiverList.receiver({0}).amount", i), FormatDecimal(Receivers[i].Amount));

                if (Receivers[i].IsPrimaryReceiver.HasValue)
                {
                    dictionary.Add(string.Format("receiverList.receiver({0}).primary", i),
                                   Receivers[i].IsPrimaryReceiver.Value ? "true" : "false");
                }

                if (Receivers[i].FirstName != null)
                {
                    dictionary.Add(string.Format("receiverList.receiver({0}).firstName", i), Receivers[i].FirstName);
                }

                if (Receivers[i].LastName != null)
                {
                    dictionary.Add(string.Format("receiverList.receiver({0}).lastName", i), Receivers[i].LastName);
                }
            }

            //Optional parameters
            if (IpnNotificationUrl != null)
            {
                dictionary.Add("ipnNotificationUrl", IpnNotificationUrl);
            }

            if (LocaleCode != null)
            {
                dictionary.Add("localeCode", LocaleCode);
            }

            if (CurrencyCode != null)
            {
                dictionary.Add("currencyCode", CurrencyCode);
            }

            if (FundingConstraints != null)
            {
                for (int i = 0; i < FundingConstraints.Count(); i++)
                {
                    dictionary.Add(string.Format("fundingList.fundingConstraint({0}).constraint", i), FundingConstraints[i].ToString().ToUpper());
                }
            }

            if (FeesPayer.HasValue)
            {
                dictionary.Add("feesPayer", FeesPayer.Value.ToString().ToUpper());
            }

            if (InvoiceFee.HasValue)
            {
                dictionary.Add("invoiceFee", FormatDecimal(InvoiceFee.Value));
            }

            if (Custom != null)
            {
                dictionary.Add("custom", Custom);
            }

            if (TrackingId != null)
            {
                dictionary.Add("trackingId", TrackingId);
            }

            if (GuaranteeOffered.HasValue)
            {
                dictionary.Add("guaranteeOffered", GuaranteeOffered.Value.ToString().ToUpper());
            }

            if (OrderItems != null)
            {
                for (int i = 0; i < OrderItems.Count(); i++)
                {
                    dictionary.Add(string.Format("orderItemList.orderItem({0}).description", i), OrderItems[i].Description);
                    if (OrderItems[i].Sku != null)
                    {
                        dictionary.Add(string.Format("orderItemList.orderItem({0}).sku", i), OrderItems[i].Sku);
                        dictionary.Add(string.Format("orderItemList.orderItem({0}).quantity", i), FormatDecimal(OrderItems[i].Quantity));
                        dictionary.Add(string.Format("orderItemList.orderItem({0}).unitPrice", i), FormatDecimal(OrderItems[i].UnitPrice));
                        dictionary.Add(string.Format("orderItemList.orderItem({0}).taxPercentage", i), FormatDecimal(OrderItems[i].TaxPercentage));
                    }
                }
            }

            if (ShowReceiptPage.HasValue)
            {
                dictionary.Add("showReceiptPage", ShowReceiptPage.Value ? "true" : "false");
            }

            return(dictionary);
        }