public bool CreateCategory(CreateCategoryModel ccm) { Category c = new Category(); c.Name = ccm.Name; c.Description = ccm.Description; c.IconPath = ccm.IconPath; db.Categories.AddObject(c); db.SaveChanges(); return true; }
public override bool Execute() { if (categoryServices.GetAllCategories().Count() == 0) { CreateCategoryModel ccm = new CreateCategoryModel(); ccm.Name = "Party"; ccm.Description = "This is A Party Event Description"; ccm.IconPath = "/Content/Images/party.png"; categoryServices.CreateCategory(ccm); ccm.Name = "Disaster"; ccm.Description = "This is A Disaster Event Description"; ccm.IconPath = "/Content/Images/disaster.png"; categoryServices.CreateCategory(ccm); ccm.Name = "Traffic"; ccm.Description = "This is A Traffic Event Description"; ccm.IconPath = "/Content/Images/traffic.png"; categoryServices.CreateCategory(ccm); } return true; }