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); } }
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("Данный банковский счет не зарегистрирован"); } }
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) ); }
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("Ошибка сервиса. Пожалуйста, повторите позже"); } }
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); } }