Example #1
0
        /// <summary>
        /// Opens the form for adding new categories as a dialog
        /// -passes the propery with the the category group id
        /// </summary>
        /// <param name="sender">Standard sender object</param>
        /// <param name="e">Standard event object</param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // Opens a dialog of the form for adding new categories
            using (AddCategoryUI addNewCategory = new AddCategoryUI(CategoryType))
            {
                addNewCategory.ShowDialog();
            }

            // Refreshes the list so the new category is displayed
            this.dgvCategoryNames.DataSource = _categoryService.CategoryHandlers[this.CategoryType].LoadAll();
        } 
Example #2
0
        /// <summary>
        /// Opens the form for adding new categories as a dialog
        /// -passes the propery with the the category group id
        /// </summary>
        /// <param name="sender">Standard sender object</param>
        /// <param name="e">Standard event object</param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // Opens a dialog of the form for adding new categories
            using (AddCategoryUI addNewCategory = new AddCategoryUI(CategoryType))
            {
                addNewCategory.ShowDialog();
            }

            // Refreshes the list so the new category is displayed
            this.dgvCategoryNames.DataSource = _categoryService.CategoryHandlers[this.CategoryType].LoadAll();
        }