diff --git a/LootBoxSimulator/Program.cs b/LootBoxSimulator/Program.cs index 5bb2026..62eb0e4 100644 --- a/LootBoxSimulator/Program.cs +++ b/LootBoxSimulator/Program.cs @@ -40,8 +40,28 @@ void ChangeCategory() { if(!int.TryParse(Console.ReadLine(), out int CategoryID)) return; String CategoryName = Console.ReadLine(); - if(!String.IsNullOrEmpty(CategoryName)) return; + if(String.IsNullOrEmpty(CategoryName)) return; var categoryDao = db.Categories.Find(CategoryID); categoryDao.Name = CategoryName; db.SaveChanges(); +} + +void RemoveCategory() +{ + Console.WriteLine("Please enter a Category ID to remove"); + if(!int.TryParse(Console.ReadLine(), out int CategoryID)) return; + var categoryDao = db.Categories.Find(CategoryID); + db.Categories.Remove(categoryDao); + db.SaveChanges(); +} + +void AddCategory() +{ + Console.WriteLine("Please enter a Category Name for new category"); + String CategoryName = Console.ReadLine(); + if(String.IsNullOrEmpty(CategoryName)) return; + CategoryDao categoryDao = new CategoryDao(); + categoryDao.Name = CategoryName; + db.Categories.Add(categoryDao); + db.SaveChanges(); } \ No newline at end of file