private WorldIndexService CreateWorldIndexService() { //shouldn't this be a Guid? string userID = User.Identity.GetUserId(); var worldIndexService = new WorldIndexService(userID); return(worldIndexService); }
public ActionResult Create([Bind(Include = "FeatureID,Name,Summary,FullText,Mechanics,Source")] Feature feature) { if (ModelState.IsValid) { db.Features.Add(feature); db.SaveChanges(); WorldIndexService worldIndexService = CreateWorldIndexService(); worldIndexService.UpdateFeatures(); return(RedirectToAction("Index")); } return(View(feature)); }
public ActionResult Create([Bind(Include = "SpellID,Name,SpellLevel,SpellSchool,CastTime,RangeArea,Duration,Concentration,Components,Verbal,Somatic,Material,SpellEffectType,Summary,FullText,Mechanics")] Spell spell) { if (ModelState.IsValid) { db.Spells.Add(spell); db.SaveChanges(); WorldIndexService worldIndexService = CreateWorldIndexService(); worldIndexService.UpdateSpells(); return(RedirectToAction("Index")); } return(View(spell)); }
//public ActionResult Create([Bind(Include = "PCID,NameShort,NameFull,Level,Class,Species,Age,Background,PersonalHistory,Personality,CurHP,CurHD,MaxHP,HitDice,ProficiencyBonus,STR,DEX,CON,INT,WIS,CHA,Athletics,Acrobatics,SleightofHand,Stealth,Arcana,History,Investigation,Nature,Religion,AnimalHandling,Insight,Medicine,Perception,Survival,Deception,Intimidation,Performance,Persuasion,Player,OwnerID")] PlayerCharacter playerCharacter) public ActionResult Create(CharacterBuild playerCharacter) { if (ModelState.IsValid) { PlayerCharacterService characterService = CreatePlayerChararacterService(); db.PlayerCharacters.Add(characterService.BuildPlayerCharacter(playerCharacter)); db.SaveChanges(); WorldIndexService worldIndexService = CreateWorldIndexService(); worldIndexService.UpdatePlayerCharacters(); return(RedirectToAction("Index")); } return(View(playerCharacter)); }
public ActionResult Create([Bind(Include = "ItemID,Name,Type,Rarity,Summary,FullText,Mechanics,Notes,Source")] Item item) { if (ModelState.IsValid) { db.Items.Add(item); db.SaveChanges(); WorldIndexService worldIndexService = CreateWorldIndexService(); //worldIndexService.UpdateItems(); worldIndexService.AddItem(item); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(item)); }