예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            addModifyForm addCustomerForm = new addModifyForm();

            addCustomerForm.addPackage = true;
            DialogResult result = addCustomerForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                dataGridView1.DataSource = PackagesDB.GetPackages();
            }
        }
예제 #2
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            var    cells           = dataGridView1.CurrentRow.Cells;
            string rowId           = cells[0].Value.ToString();
            var    selectedPackage = PackagesDB.GetPackage(rowId);

            addModifyForm modifyPackageForm = new addModifyForm();

            modifyPackageForm.addPackage = false;
            modifyPackageForm.modifyPack = selectedPackage;
            DialogResult result = modifyPackageForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                dataGridView1.DataSource = PackagesDB.GetPackages();
            }
        }