private void CatEdit_Click(object sender, RoutedEventArgs e) { dataAccess data = new dataAccess(); categories cat = new categories(); if (CategoryName.Text == null || CategoryName.Text == "") { MessageBox.Show("Enter the category name"); } else if (CategoryDescription.Text == null || CategoryDescription.Text == "") { MessageBox.Show("Enter the category description"); } else { cat.CategoryID = int.Parse(CategoryNumber.Text); cat.CategoryName = CategoryName.Text; cat.Description = CategoryDescription.Text; data.EditCategory(cat); MessageBox.Show("Category Edited " + cat.CategoryName); } }