Beispiel #1
0
        public void AddProcessToCategory(int categoryId, int processId, string processName)
        {
            Category        c = _context.Categories.Find(categoryId);
            ProcessCategory processCategory = new ProcessCategory(processId, processName, c);

            _context.Processes.Add(processCategory);
            _context.SaveChanges();
            _view.AddSingleProcessToProcessByCategoryList(processCategory);
        }
Beispiel #2
0
        public void AddCategory(string title)
        {
            Category category = new Category(title);

            try
            {
                _context.Categories.Add(category);
                _context.SaveChanges();
                _view.UpdateCategories(category);
            }
            catch (Exception e)
            {
                _view.ShowError(e.Message);
            }
        }