private void buttonRemoveCats_Click(object sender, EventArgs e)
        {
            CategoryBusiness categoryBusiness = new CategoryBusiness();

            int    selectedCategoryId = (int)comboBoxSelectCat.SelectedValue;
            var    selectedCategory   = categoryBusiness.GetCategoryById(selectedCategoryId);
            string result             = categoryBusiness.Remove(selectedCategory);

            MessageBox.Show(result);

            showCategories.ShowCategories(dataGridViewShowCats);
        }
Пример #2
0
        public void Remove(int id)
        {
            try
            {
                var bc = new CategoryBusiness();
                bc.Remove(id);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
Пример #3
0
 private void buttonRemoveCategory_Click(object sender, EventArgs e)
 {
     categoryBusiness.Remove(selectedCategory);
     getCategories();
 }