Example #1
0
        private void ButtonModify_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection rowSelected = dataGridView1.SelectedRows;

            switch (rowSelected.Count)
            {
            case 0:
                this.Enabled = false;
                Dialog dialog = new Dialog("No one elemented has been selected");
                dialog.ShowDialog();
                this.Enabled = true;
                break;

            case 1:

                TransactionView transactionSelected = (TransactionView)rowSelected[0].DataBoundItem;

                this.Enabled = false;

                TransactionSettings settings = new TransactionSettings(transactionSelected);
                settings.OnExecutionResult += ModifyTransaction;
                settings.ShowDialog();
                this.Enabled = true;

                break;

            default:
                this.Enabled = false;
                Dialog dialog2 = new Dialog("Only 1 item must be selected");
                dialog2.ShowDialog();
                this.Enabled = true;
                break;
            }
        }
Example #2
0
        private void Button_NewTransaction(OutlayTypesEnum typeOutlay)
        {
            TransactionSettings settings = new TransactionSettings(dateSelected, typeOutlay);

            settings.OnExecutionResult += AddNewTransaction;

            this.Enabled = false;
            settings.Show();
            this.Enabled = true;
        }