private void createButton_Click(object sender, EventArgs e) { var nextForm = GuaranteeController.CreateNew(this); this.Hide(); nextForm.Show(); LocationHelper.PassLocationToNextForm(this, nextForm); }
private void guaranteesDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { var guaranteeId = (int)senderGrid.Rows[e.RowIndex].Cells["Id"].Value; Form guaranteeForm = GuaranteeController.ViewGuaranteeItem(guaranteeId, this); this.Hide(); guaranteeForm.Show(); } }
private void createButton_Click(object sender, EventArgs e) { Decimal.TryParse(amountTextBox.Text, out var amount); Int32.TryParse(periodTextBox.Text, out var days); var guaranteeAddResult = GuaranteeController.AddGuarantee(new Guarantee { Name = Resources.BankGuarantee + organizationsComboBox.Text, Amount = amount, Days = days, StartDate = DateTime.Now, OrganizationId = ComponentBindingHelper.GetComboboxItemKey(organizationsComboBox) }); if (guaranteeAddResult.Executed) { _closeApp = false; this.Close(); } else { MessageBox.Show(guaranteeAddResult.ErrorText); } }
private void Confirm(bool confirmed) { var confirmation = new GuaranteeConfirmation { GuaranteeId = _guarantee.Id, ContractAmount = contractAmountNumericUpDown.Value, GuaranteeAmountLessThanContract = guaranteeAmountLessRadioButton.Checked, IsProtocolPublished = protocolPublishedRadioButton.Checked, IsRiskTerritory = riskTerritoryRadioButton.Checked, Confirmed = confirmed }; var result = GuaranteeController.Confirm(confirmation); if (result.Executed) { confirmPanel.Enabled = false; this.Text = confirmed ? Resources.Confirmed : Resources.Declined; } else { MessageBox.Show(result.ErrorText); } }
private void backButton_Click(object sender, EventArgs e) { GuaranteeController.ViewGuaranteeItemClosed(this); _backNavigation = true; this.Close(); }