Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            errProvider.Clear();
            frmAddEdit addForm = new frmAddEdit();

            addForm.ShowDialog();
            this.itemNamesTableAdapter.ResetTable(this.itemNamesDataSet.ItemNames);
        }
Esempio n. 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            errProvider.Clear();
            if (dgvItems.SelectedRows.Count == 0)
            {
                errProvider.SetError(dgvItems, "Please select a row.");
                return;
            }
            string     item = dgvItems.SelectedRows[0].Cells[0].Value.ToString();
            frmAddEdit edit = new frmAddEdit();

            edit.SetEditItem(item);
            edit.ShowDialog();
            this.itemNamesTableAdapter.ResetTable(this.itemNamesDataSet.ItemNames);
        }