Exemplo n.º 1
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            CategoryDialog cDialog = new CategoryDialog(_categoryService, Operation.Add, null);

            cDialog.ShowDialog();

            LoadCategories();
        }
Exemplo n.º 2
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select category from the list!",
                                "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Category selectedCategory = listBox1.SelectedItem as Category;

            CategoryDialog cDialog = new CategoryDialog(_categoryService, Operation.Edit, selectedCategory);

            cDialog.ShowDialog();

            LoadCategories();
        }