void refreshGrid() { ClassCountries country = new ClassCountries(); dataGridViewCountries.DataSource = country.retrieveAllData(); }
void SaveEditedData() { ClassCountries country = new ClassCountries(); country.CountryID = Convert.ToInt16(textBoxCountryID.Text.Trim()); country.CountryName = textBoxCName.Text.Trim(); country.CountryCode = textBoxCCode.Text.Trim(); country.Active = checkBoxActive.Checked ? 1 : 0;// Ternary Operator if (country.EditCountry()) { // Refresh DataGrid MessageBox.Show("Country Data Saved!", "ADPC: Country Data"); clearScreen(); refreshGrid(); // Refresh Screen for new Changes to take effects EnableEditMode = 0; EditMode(); } else { labelError.Text = "Error Saving Data"; } }