Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var dialog = new AddEditGinLoad();
            var result = dialog.ShowAdd();

            if (result != DialogResult.Cancel)
            {
                refresh();
            }
        }
Пример #2
0
        private void btnEditSelected_Click(object sender, EventArgs e)
        {
            var             dialog = new AddEditGinLoad();
            DataGridViewRow row    = null;

            if (dataGridLoads.SelectedRows.Count > 0)
            {
                row = dataGridLoads.SelectedRows[0];
                GinLoadEntity doc    = (GinLoadEntity)row.DataBoundItem;
                var           result = dialog.ShowEdit(doc);
                if (result != DialogResult.Cancel)
                {
                    refresh();
                }
            }
            else
            {
                MessageBox.Show("Please select a row to edit.");
            }
        }