コード例 #1
0
        private void addUnit_Click(object sender, EventArgs e)
        {
            var dialogResult = new AddOrEditSimpleEntity(new Unit(), _connectionString).ShowDialog(this);

            if (dialogResult == DialogResult.OK)
            {
                FillOrRefreshGridOfUnits();
            }
        }
コード例 #2
0
        private void editUnit_Click(object sender, EventArgs e)
        {
            var selectedUnitRow = dataGridViewUnits.SelectedRows[0];
            var selectedUnit    = ((Unit)selectedUnitRow.DataBoundItem);
            var dialogResult    = new AddOrEditSimpleEntity(selectedUnit, _connectionString).ShowDialog(this);

            if (dialogResult == DialogResult.OK)
            {
                FillOrRefreshGridOfUnits();
            }
        }