コード例 #1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            frmExpenseEdit frm = new frmExpenseEdit();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                clearForm();
            }
        }
コード例 #2
0
        private void grdExpense_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (e.RowIndex >= 0)
            {
                var id = Convert.ToInt64(senderGrid.Rows[e.RowIndex].Cells[0].Value);
                if (id > 0)
                {
                    frmExpenseEdit frm = new frmExpenseEdit()
                    {
                        Mode = Models.EntryMode.Edit, ExpenseId = id
                    };
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        bindGrid();
                    }
                }
            }
        }