Ejemplo n.º 1
0
        private void createInvestmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;
            InvestmentsForm form = new InvestmentsForm();

            form.MdiParent = this;
            form.Show();
        }
Ejemplo n.º 2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0 && e.RowIndex < dataGridView1.RowCount)
                {
                    int disbursementId = 0;

                    if (int.TryParse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(), out disbursementId))
                    {
                        Disbursement disbToEdit = manager.My_db.Disbursements.FirstOrDefault(x => x.Id == disbursementId);

                        if (disbToEdit != null)
                        {
                            Investment invToEdit = disbToEdit.Investment;

                            if (invToEdit != null)
                            {
                                InvestmentsForm invForm = new InvestmentsForm();

                                invForm.EditingExistingInvestment = true;
                                invForm.InvestmenToEdit           = invToEdit;
                                invForm.StartPosition             = FormStartPosition.CenterScreen;

                                invForm.ShowDialog();

                                loadInvestments();
                            }
                        }
                    }
                }
            }
            catch (Exception _ex)
            {
                ErrorMessage.showErrorMessage(_ex);
            }
        }