Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            frmModifySup addSupplierForm = new frmModifySup();

            addSupplierForm.addSuppliers = true;
            DialogResult result = addSupplierForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                dataGridView1.DataSource = SuppliersDB.GetSuppliers();
            }
        }
Esempio n. 2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            var    cells  = dataGridView1.CurrentRow.Cells;
            string rowId  = cells[0].Value.ToString();
            string rowId1 = cells[1].Value.ToString();
            //int rowId = Convert.ToInt32(cells[0].Value);
            var selectedSupplierID = SuppliersDB.GetSuppliers(rowId);

            frmModifySup modifySupplierFrm = new frmModifySup();

            modifySupplierFrm.addSuppliers    = false;
            modifySupplierFrm.modifySuppliers = selectedSupplierID;
            DialogResult result = modifySupplierFrm.ShowDialog();

            if (result == DialogResult.OK)
            {
                dataGridView1.DataSource = SuppliersDB.GetSuppliers();
            }
        }