Esempio n. 1
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Укажите сумму для создания счета:");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Выберите тип счета: 1. До востребования 2. Депозит");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,                          // обработчик добавления средств на счет
                      WithdrawSumHandler,                     // обработчик вывода средств
                      (o, e) => Console.WriteLine(e.Message), // обработчик начислений процентов в виде лямбда-выражения
                      CloseAccountHandler,                    // обработчик закрытия счета
                      OpenAccountHandler);                    // обработчик открытия счета
        }
Esempio n. 2
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Укажите сумму для создания счета:");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Выберите тип счета: 1. До востребования 2. Депозит");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message),
                      CloseAccountHandler,
                      OpenAccountHandler);
        }
Esempio n. 3
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Write("Укажите сумму счёта: ");
            decimal sum = Convert.ToDecimal(ReadLine());

            Write("Выберите тип счёта\n1) До востребования.\n2) Депозитный.\nНомер счёта: ");
            int         type = Convert.ToInt32(ReadLine());
            AccountType accountType;

            switch (type)
            {
            case 1:
                accountType = AccountType.Ordinary;
                break;

            case 2:
                accountType = AccountType.Deposite;
                break;

            default:
                accountType = AccountType.Deposite;
                WriteLine("Выбран депозитный счёт по умолчанию.");
                break;
            }
            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithDrawHandler,
                      (o, e) => WriteLine(e.Message),
                      OpenAccountHandler,
                      CloseAccountHandler
                      );
        }
Esempio n. 4
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.Write("\nInitial amount on account: ");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("\nSelect an account type: 1.Demand 2.Deposit ");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message),
                      CloseAccountHandler,
                      OpenAccountHandler);
        }
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Input sum for opening account");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Choose account type: 1 Ordinary 2. Deposit");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message),
                      CloseAccountHandler,
                      OpenAccountHandler);
        }
Esempio n. 6
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("\nKind Of Account:\n1.Credit\t\t2.Deposit\t\t3.Demand");
            Console.Write("\nChoose number: ");
            int type = Convert.ToInt32(Console.ReadLine());

            Console.Write("Full Name: ");
            string nameClient = Convert.ToString(Console.ReadLine());

            Console.Write("Passport: ");
            string passportClient = Convert.ToString(Console.ReadLine());

            Console.Write("Adress: ");
            string adressClient = Convert.ToString(Console.ReadLine());

            Console.Write("Sum = ");
            decimal sum         = Convert.ToDecimal(Console.ReadLine());
            string  accountType = "";
            int     period      = 0;

            switch (type)
            {
            case 1: accountType = "Credit"; break;

            case 2:
                accountType = "Deposit";
                Console.WriteLine("Period: 30. 30 Days\t\t90. 90 Days\t\t180. 180 Days");
                period = Convert.ToInt32(Console.ReadLine());
                break;

            case 3: accountType = "Demand"; break;
            }
            bank.Open(nameClient, adressClient, accountType, sum, passportClient, period);
        }
Esempio n. 7
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Enter summ for creat account: ");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Choise type of account: 1. On demand 2. Deposit");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,                          // обработчик добавления средств на счет
                      WithdrawSumHandler,                     // обработчик вывода средств
                      (o, e) => Console.WriteLine(e.Message), // обработчик начислений процентов в виде лямбда-выражения
                      CloseAccountHandler,                    // обработчик закрытия счета
                      OpenAccountHandler);                    // обработчик открытия счета
        }
Esempio n. 8
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Specify the amount to create the account");
            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Choose account type: 1.Call account 2. Depoiste");
            AccountType accountType;
            int         type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message),//Interest calculation handler as lambda expression
                      CloseAccountHandler,
                      OpenAccountHandler);
        }
Esempio n. 9
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Укажите начальную сумма счета");
            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Выберите тип счета: 1-до востребования; 2 - депозит.");
            AccountType accountType = 0;
            int         type        = Convert.ToInt32(Console.ReadLine());

            switch (type)
            {
            case 1:
            {
                accountType = AccountType.Ordinary;
                break;
            }

            case 2:
            {
                accountType = AccountType.Deposit;
                break;
            }
            }
            bank.Open(accountType, sum, AddSumHandler, WithdrawSumHandler, (o, e) => Console.WriteLine(e.Message), CloseAccountHandler, OpenAccountHandler);
        }
Esempio n. 10
0
        public static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Type sum for account creation: ");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Choose a type of an account: 1. Demand 2.Deposit");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message),
                      CloseAccountHandler,
                      OpenAccountHandler);
        }
Esempio n. 11
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Point sum for creating account:");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Choose type of account: 1. demand 2. deposit");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType,
                      sum,
                      AddSumHandler,                          //hadler for adding cash  on the account
                      WithdrawSumHandler,
                      (o, e) => Console.WriteLine(e.Message), // handler for counting procents
                      CloseAccountHandler,                    //handler for closing
                      OpenAccountHandler);
        }
Esempio n. 12
0
 protected void ButtonOpen(object sender, EventArgs a)
 {
     try
     {
         sum = Convert.ToDouble(Entry1.Text);
         bank.Open(accountType,
                   sum,
                   AddSumHandler,
                   WithdrawSumHandler,
                   (o, e) => Console.WriteLine(e.Message),
                   CloseAccountHandler,
                   OpenAccountHandler,
                   TransferHandler);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Esempio n. 13
0
        private static void OpenAccount(Bank <Account> bank)
        {
            Console.WriteLine("Enter the amount to create an account:");

            decimal sum = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Select an account type: 1. Demand 2. Deposit");
            AccountType accountType;

            int type = Convert.ToInt32(Console.ReadLine());

            if (type == 2)
            {
                accountType = AccountType.Deposit;
            }
            else
            {
                accountType = AccountType.Ordinary;
            }

            bank.Open(accountType, sum);
        }