private void clientOpenNewCardButton_Click(object sender, EventArgs e) { string message = "Карта действительна 2 года, начиная с сегодня.\nВыпустить карту?"; string caption = "Подтверждение выпуска карты"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons); if (result == System.Windows.Forms.DialogResult.Yes) { try { qta.ВыпуститьКарту(clientID); MessageBox.Show("Карта выпущена"); this.списокКартКлиентаTableAdapter.Fill(this.bankDataSet.СписокКартКлиента, clientID); of.updatePotentialClientsGrid(); } catch (Exception) { MessageBox.Show("Карта не была выпущена", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { clientShowCardOperationsButton.Visible = true; } updateClientCards(); updateClientStatus(); }
private void addNewCreditRequestButton_Click(object sender, EventArgs e) { if (newRequestDurationComboBox.SelectedItem == null) { MessageBox.Show("Не выбран срок кредита", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (newRequestDurationComboBox.SelectedItem.ToString() == "1 год") { duration = 12; } else if (newRequestDurationComboBox.SelectedItem.ToString() == "2,5 года") { duration = 30; } else if (newRequestDurationComboBox.SelectedItem.ToString() == "5 лет") { duration = 60; } else { duration = 120; } QueriesTableAdapter ta = new QueriesTableAdapter(); try { decimal percent = decimal.Parse(newRequestPercentTextBox.Text); bool? status = false; ta.УзнатьСтатусКлиента(id, ref status); if (status == true) { percent /= 2; } ta.ПодатьЗаявкуНаКредит(id, decimal.Parse(newRequestSumComboBox.Text), percent, duration, of.operatorID); MessageBox.Show("Заявка на кредит отправлена"); if (status == true) { MessageBox.Show("Процент в заявке на кредит уменьшен вдвое,\nтак как статус клиента - Премиум"); } of.updatePotentialClientsGrid(); if (cfif != null) { cfif.updateClientCreditRequests(); } Close(); } catch (Exception) { MessageBox.Show("Заявка на кредит не была отправлена", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void addNewContributionButton_Click(object sender, EventArgs e) { QueriesTableAdapter ta = new QueriesTableAdapter(); try { decimal percent = decimal.Parse(newContributionPercentTextBox.Text); bool? status = false; ta.УзнатьСтатусКлиента(id, ref status); if (status == true) { percent *= 2; } if (duration == 0) { ta.ОткрытьБессрочныйВклад(id, percent); MessageBox.Show("Открыт бессрочный вклад"); } else { ta.ОткрытьВклад(id, percent, duration); if (duration == 1) { MessageBox.Show("Открыт вклад на " + duration + " год"); } else { MessageBox.Show("Открыт вклад на " + duration + " лет"); } } if (status == true) { MessageBox.Show("Процент вклада удвоен, так как статус клиента - Премиум"); } of.updatePotentialClientsGrid(); cfif.updateClientStatus(); if (cfif != null) { cfif.updateClientContributions(); } Close(); } catch (Exception) { MessageBox.Show("Вклад не был открыт", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void addNewClientButton_Click(object sender, EventArgs e) { if (newClientNameTextBox.Text == "") { MessageBox.Show("Введите ФИО клиента", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (newClientTownTextBox.Text == "") { MessageBox.Show("Введите город клиента", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (newClientIncomeTextBox.Text == "") { MessageBox.Show("Введите доход клиента", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } double income; bool isNum = double.TryParse(newClientIncomeTextBox.Text, out income); if (!isNum) { MessageBox.Show("Доход клиента должен быть числом", "Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Warning); newClientIncomeTextBox.Clear(); return; } QueriesTableAdapter ta = new QueriesTableAdapter(); try { ta.ДобавитьКлиента(newClientNameTextBox.Text, newClientTownTextBox.Text, decimal.Parse(newClientIncomeTextBox.Text)); MessageBox.Show("Клиент добавлен"); of.updateClientsGrid(); of.updatePotentialClientsGrid(); Close(); } catch (Exception) { MessageBox.Show("Клиент не был добавлен", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }