internal accountType[] GetCustomerAccounts(string customerId)
    {
        CustomerAccountDataSet  dsAccounts = new CustomerAccountDataSet();
        AccountTableAdapter     ad1        = new AccountTableAdapter();
        AccountTypeTableAdapter ad2        = new AccountTypeTableAdapter();

        ad1.Fill(dsAccounts.Account, customerId);
        ad2.Fill(dsAccounts.AccountType);

        List <accountType> result = new List <accountType>();

        foreach (CustomerAccountDataSet.AccountRow rowAccount in dsAccounts.Account)
        {
            accountType account = new accountType();

            account.accountNumber = rowAccount.AccountNumber;
            account.balance       = rowAccount.Balance;
            account.customerId    = rowAccount.CustomerId;
            account.dateOpened    = rowAccount.DateOpened;

            account.lastTransactionAt = rowAccount.IsLastTransactionDateNull() ? DateTime.MinValue : rowAccount.LastTransactionDate;

            CustomerAccountDataSet.AccountTypeRow rowAccountType = rowAccount.AccountTypeRow;
            account.accountType1                       = new accountTypeType();
            account.accountType1.id                    = rowAccountType.AccountTypeId;
            account.accountType1.fees                  = rowAccountType.IsFeesNull() ? 0 : (float)rowAccountType.Fees;
            account.accountType1.interestRate          = rowAccountType.IsInterestRateNull() ? 0 : (float)rowAccountType.InterestRate;
            account.accountType1.maxMonthlyTransaction = rowAccountType.IsMaxMonthlyTransactionNull() ? 0 : rowAccountType.MaxMonthlyTransaction;
            account.accountType1.type                  = rowAccountType.AccountType;

            result.Add(account);
        }

        return(result.ToArray());
    }
Esempio n. 2
0
 public User(String fName, String lName, int acc, int principle)
 {
     this.fName       = fName;
     this.lName       = lName;
     this.acc         = (accountType)acc;
     BankOfAmerica    = new Banking.Bank("Bank of America", 0, 0, 0, 0, 0, principle);
     Chase            = new Banking.Bank("Chase", 0, 0, 0, 0, 0, principle);
     WellsFargo       = new Banking.Bank("Wells Fargo", 0, 0, 0, 0, 0, principle);
     RoseBank         = new Banking.Bank("RoseBank", 0, 0, 0, 0, 0, principle);
     ProsperityBank   = new Banking.Bank("Prosperity Bank", 0, 0, 0, 0, 0, principle);
     Allegiance       = new Banking.Bank("Allegiance", 0, 0, 0, 0, 0, principle);
     Capital          = new Banking.Bank("Capital", 0, 0, 0, 0, 0, principle);
     AllyBank         = new Banking.Bank("Ally Bank", 0, 0, 0, 0, 0, principle);
     OneMainFinancial = new Banking.Bank("One Main Financial", 0, 0, 0, 0, 0, principle);
     CitiBank         = new Banking.Bank("Citi Bank", 0, 0, 0, 0, 0, principle);
     AIG          = new Banking.Bank("AIG", 0, 0, 0, 0, 0, principle);
     GoldmanSachs = new Banking.Bank("GoldmanSachs", 0, 0, 0, 0, 0, principle);
     callAcc();
     sortBest();
 }
Esempio n. 3
0
        public static void createAccount()
        {
            String Fristname = null;
            String Lastname = null;
            String Type = null;

            Console.WriteLine("Give Personal Data");

            Console.WriteLine("Give Firstname:");
            Fristname = Console.ReadLine();

            Console.WriteLine("Give Lastname:");
            Lastname = Console.ReadLine();

            Console.WriteLine("Give Pesel:");
            pesel = Console.ReadLine();

            Console.WriteLine("Account Type (S/P):");

            Type = Console.ReadLine();

            if (Type == "P")
                accType = accountType.PREMIUM;
            else
                accType = accountType.SILVER;

            Ice.ObjectPrx obj = ic.stringToProxy("bankManager:ssl -h " + ip +  " -p 10001");
            BankManagerPrx bankManager = BankManagerPrxHelper.checkedCast(obj);

            if (bankManager == null)
                throw new ApplicationException("Invalid manager proxy");

            accountID = "";
            PersonalData myData = createPersonalData(Fristname, Lastname, pesel);
            bankManager.createAccount(myData, accType, out accountID);

            Console.WriteLine("YOUR ACCOUNT ID DO NOT LOSE IT!:  " + accountID);
            Console.WriteLine("8==>");
        }
        public async Task <ActionResult <user> > Postuser(userLogin u)
        {
            List <user> users = await _context.Users.ToListAsync();

            user user = (user)users.Find(p => p.email == u.email);

            if (user == null)
            {
                return(NotFound());
            }
            else if (user.email == u.email && user.pass == u.pass)
            {
                accountType a = await _context.Accounts.FindAsync(user.accountId);

                user.account = a;
                return(user);
            }
            else
            {
                return(NotFound());
            }
        }
Esempio n. 5
0
 public BankAccount(long accountNumber, double value, accountType type)
 {
     this.accountNumber = accountNumber;
     this.value         = value;
     this.type          = type;
 }
Esempio n. 6
0
        static void Main(string[] args)
        {
            //var taxDocuments = db.TaxDocuments.Where(x => x.Typ == TaxDocument.Enum_TaxDocumentType.Invoice && x.Zruseno == false && x.CreatedUtc > new DateTime(2018, 12, 05)).ToList();
            var dataPack      = new dataPackType();
            var dataPackItems = new List <dataPackItemType>();

            var staList = new List <shipToAddressType>();

            staList.Add(new shipToAddressType
            {
                name   = "Jmeno",
                city   = "Obec",
                street = "Ulice 12/13",
                zip    = "12345"
            });

            var account = new accountType();

            account.accountNo = "123456789";
            account.bankCode  = "0800";

            //--- Invoice Items
            var invoiceItemList = new List <invoiceItemType>();

            invoiceItemList.Add(new invoiceItemType
            {
                text         = "Dodávka",
                quantity     = 1,
                rateVAT      = vatRateType.high,
                homeCurrency = new typeCurrencyHomeItem
                {
                    unitPrice = "500"
                }
            });

            //--- DataPackItem
            var dataPackItem = new dataPackItemType
            {
                id      = "AD002",
                version = dataPackItemVersionType.Item20,
                Item    = new invoiceType
                {
                    invoiceHeader = new invoiceHeaderType
                    {
                        invoiceType = invoiceTypeType.issuedInvoice,
                        symVar      = "2793", //TODO elektrina
                        number      = new numberType
                        {
                            numberRequested = new numberTypeNumberRequested {
                                Value = "1900010"
                            }
                        },
                        date              = DateTime.Now,
                        dateTax           = DateTime.Now,
                        dateAccounting    = DateTime.Now,
                        classificationVAT = new classificationVATType {
                            classificationVATType1 = classificationVATTypeClassificationVATType.inland
                        },
                        text            = "Fakturace dodávky plynu", //TODO elektrina
                        partnerIdentity = new address
                        {
                            address1 = new addressType
                            {
                                name   = "Jmeno",
                                city   = "Obec",
                                street = "Ulice",
                                zip    = "12345"
                            },                                 //TODO elektrina
                            shipToAddress = staList.ToArray(), //TODO elektrina
                        },
                        account = account != null ? account : null,
                        note    = "Načteno z XML",
                    },
                    invoiceDetail = new invoiceDetailType
                    {
                        Items = invoiceItemList.ToArray()
                    }
                },
                ItemElementName = ItemChoiceType6.invoice
            };

            dataPackItems.Add(dataPackItem);

            dataPack.dataPackItem = dataPackItems.ToArray();

            var serializer = new XmlSerializer(typeof(dataPackType));

            using (var stream = new StreamWriter("C:\\user\\test.xml"))
                serializer.Serialize(stream, dataPack);
        }