private void btnCaAdd_Click(object sender, EventArgs e) { Category newCat = new Category(); newCat.CategoryID = -1; newCat.CategoryName = txtCatName.Text; newCat.Description = rtxtDescription.Text; int check = newCat.isValid(); if (check < -1) { MessageBox.Show(newCat.getErrorMessage(check)); } else { this.dataModel.insertNewRow(newCat); //this.datamodel.resetControl(); MessageBox.Show("Completed"); } }