示例#1
0
        private void btn_transferToUser2_Click(object sender, EventArgs e)
        {
            AccountOperations op = new AccountOperations();

            string  cardNumber  = tb_recCardNumber.Text;
            decimal moneyAmount = Convert.ToDecimal(tb_moneyAmount2.Text, CultureInfo.InvariantCulture);

            try
            {
                op.TransferMoneyToUserByCardNumber(client, accId, long.Parse(cardNumber), moneyAmount);
                MessageBox.Show("Средства успешно переведены");

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств со счета";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordAccountOperation
                (
                    userAccId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount2.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
示例#2
0
        private void btn_transferToUser1_Click_1(object sender, EventArgs e)
        {
            AccountOperations op = new AccountOperations();

            decimal moneyAmount = Convert.ToDecimal(tb_moneyAmount1.Text, CultureInfo.InvariantCulture);
            string  accountId   = tb_recAccountId.Text;

            try
            {
                op.TransferMoneyToUserByAccId(client, accId, accountId, moneyAmount);
                MessageBox.Show("Средства успешно переведены");

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств со счета";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordAccountOperation
                (
                    userAccId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount1.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show("Данный банковский счет не зарегистрирован");
            }
        }
示例#3
0
        private void btn_transferSomewhere_Click(object sender, EventArgs e)
        {
            AccountOperations op = new AccountOperations();

            string  paymentDest = tb_transferDestination.Text;
            decimal moneyAmount = Convert.ToDecimal(tb_moneyAmount3.Text, CultureInfo.InvariantCulture);

            try
            {
                op.TransferMoneySomeWhereFromAcc(client, accId, moneyAmount);
                MessageBox.Show("Средства успешно переведены");

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств со счета";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordAccountOperation
                (
                    userAccId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount3.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show("Ошибка сервиса. Пожалуйста, повторите позже");
            }
        }
示例#4
0
        private void btn_addMoney_Click(object sender, EventArgs e)
        {
            if (Convert.ToDecimal(tb_addMoney.Text, CultureInfo.InvariantCulture) > 80000 || tb_addMoney.Text == "")
            {
                MessageBox.Show("Максимальная сумма пополнения 80 000р");
                return;
            }

            BankAccountManagement.AddMoneyToAccount(accInfo["id"], tb_addMoney.Text);
            //lbl_accBalance.Text = "Баланс:";
            //cash += Convert.ToDouble(tb_addMoney.Text);
            //lbl_accBalance.Text += "  " + cash;
            MessageBox.Show("Средства зачислены");

            DateTime today     = DateTime.Now;
            DateTime todayDate = DateTime.Today;

            string transactionType = "Пополнение средств";
            string time            = today.ToString("HH:mm:ss");

            // Записываем в архив
            OperationsRecorder.RecordAccountOperation
            (
                userAccId,
                todayDate.ToString("dd/MM/yyyy"),
                time,
                transactionType,
                Convert.ToDecimal(tb_addMoney.Text, CultureInfo.InvariantCulture)
            );
        }
示例#5
0
        private void btn_transferMoneyToCard_Click(object sender, EventArgs e)
        {
            try
            {
                var cardId = lv_clientCards.Items[lv_clientCards.SelectedIndices[0]].Name;

                //if (!IsDebitCard(cardId))
                //{
                //    MessageBox.Show("Вы патаетесь пополнить баланс кредитной карты");
                //    return;
                //}

                if (!CheckCardAndAccBalance(cardId, Convert.ToDecimal(tb_moneyAmount.Text, CultureInfo.InvariantCulture)))
                {
                    MessageBox.Show("Вы превысили баланс аккаунта");
                    return;
                }

                BankAccountManagement.TransferMoneyToCard(cardId, accInfo["id"], tb_moneyAmount.Text);

                cardCash += Convert.ToDecimal(tb_moneyAmount.Text, CultureInfo.InvariantCulture);
                cardInfo  = BankAccountManagement.GetCardInfo(cardId);

                this.BeginInvoke((MethodInvoker)(() => UpdateForm()));
                MessageBox.Show("Средства зачислены");

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств на карту";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordAccountOperation
                (
                    userAccId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show("Выберите карту из списка");
                MessageBox.Show(exc.Message);
            }
        }
示例#6
0
        private void btn_transferToUser2_Click(object sender, EventArgs e)
        {
            if (tb_moneyAmount2.Text == "" || tb_recCardNumber.Text == "")
            {
                MessageBox.Show("Заполните все поля");
                return;
            }

            AccountOperations op = new AccountOperations();

            decimal moneyAmount    = Convert.ToDecimal(tb_moneyAmount2.Text, CultureInfo.InvariantCulture);
            string  recieverCardId = tb_recCardNumber.Text;

            try
            {
                op.TransferMoneyFromCardToCard(client, cardId, long.Parse(recieverCardId), moneyAmount);
                MessageBox.Show("Средства успешно переведены");

                cardRecordId = BankAccountManagement.GetUserCardId(cardId);

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств с карты";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordCardOperation
                (
                    cardRecordId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount2.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }
        }
示例#7
0
        private void btn_transferSomewhere_Click(object sender, EventArgs e)
        {
            if (tb_moneyAmount3.Text == "" || tb_transferDestination.Text == "")
            {
                MessageBox.Show("Заполните все поля");
                return;
            }

            AccountOperations op = new AccountOperations();

            decimal moneyAmount = Convert.ToDecimal(tb_moneyAmount3.Text, CultureInfo.InvariantCulture);

            try
            {
                op.TransferMoneySomeWhereFromCard(client, cardId, moneyAmount);
                MessageBox.Show("Средства успешно переведены");

                cardRecordId = BankAccountManagement.GetUserCardId(cardId);

                DateTime today     = DateTime.Now;
                DateTime todayDate = DateTime.Today;

                string transactionType = "Перевод средств с карты";
                string time            = today.ToString("HH:mm:ss");

                // Записываем в архив
                OperationsRecorder.RecordCardOperation
                (
                    cardRecordId,
                    todayDate.ToString("dd/MM/yyyy"),
                    time,
                    transactionType,
                    Convert.ToDecimal(tb_moneyAmount3.Text, CultureInfo.InvariantCulture)
                );
            }
            catch (Exception exc)
            {
                MessageBox.Show("Такой банковской карты нет в базе данных");
            }
        }