public ActionResult FightingArtAdd() { AddEditFightingArtViewModel vModel = new AddEditFightingArtViewModel { AuthedUser = UserManager.FindById(User.Identity.GetUserId()), DataObject = new FightingArt() }; return(View("~/Views/Manage/FightingArtAdd.cshtml", vModel)); }
public ActionResult FightingArtEdit(int id, AddEditFightingArtViewModel vModel) { ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IFightingArt obj = TemplateCache.Get <IFightingArt>(id); if (obj == null) { string message = "That does not exist"; return(RedirectToRoute("Index", new { StatusMessage = message })); } if (vModel.DataObject.CalculateCostRatio() > 0) { ViewData.Add("Message", "The Calculated Cost must be equal to or below zero."); return(View("~/Views/Manage/FightingArtEdit.cshtml", vModel)); } obj.Name = vModel.DataObject.Name; obj.ActorCriteria = vModel.DataObject.ActorCriteria; obj.Aim = vModel.DataObject.Aim; obj.Armor = vModel.DataObject.Armor; obj.DistanceChange = vModel.DataObject.DistanceChange; obj.DistanceRange = vModel.DataObject.DistanceRange; obj.Health = vModel.DataObject.Health; obj.HelpText = vModel.DataObject.HelpText; obj.Impact = vModel.DataObject.Impact; obj.PositionResult = vModel.DataObject.PositionResult; obj.Recovery = vModel.DataObject.Recovery; obj.RekkaKey = vModel.DataObject.RekkaKey; obj.RekkaPosition = vModel.DataObject.RekkaPosition; obj.Setup = vModel.DataObject.Setup; obj.Stamina = vModel.DataObject.Stamina; obj.VictimCriteria = vModel.DataObject.VictimCriteria; obj.ResultQuality = vModel.DataObject.ResultQuality; obj.AdditiveQuality = vModel.DataObject.AdditiveQuality; obj.QualityValue = vModel.DataObject.QualityValue; obj.Readiness = vModel.DataObject.Readiness; obj.ActionVerb = vModel.DataObject.ActionVerb; obj.ActionPredicate = vModel.DataObject.ActionPredicate; if (obj.Save(authedUser.GameAccount, authedUser.GetStaffRank(User))) { LoggingUtility.LogAdminCommandUsage("*WEB* - EditFightingArt[" + obj.Id.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); } else { } return(RedirectToAction("Index")); }
public ActionResult Add(AddEditFightingArtViewModel vModel) { string message = string.Empty; ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IFightingArt newObj = vModel.DataObject; if (newObj.Create(authedUser.GameAccount, authedUser.GetStaffRank(User)) == null) { message = "Error; Creation failed."; } else { LoggingUtility.LogAdminCommandUsage("*WEB* - AddFightingArt[" + newObj.Id.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); } return(RedirectToAction("Index", new { Message = message })); }
public ActionResult FightingArtEdit(int id) { string message = string.Empty; IFightingArt obj = TemplateCache.Get <IFightingArt>(id); if (obj == null) { message = "That does not exist"; return(RedirectToRoute("ErrorOrClose", new { Message = message })); } AddEditFightingArtViewModel vModel = new AddEditFightingArtViewModel { AuthedUser = UserManager.FindById(User.Identity.GetUserId()), DataObject = obj, }; return(View("~/Views/Manage/FightingArtEdit.cshtml", vModel)); }
public ActionResult FightingArtAdd(AddEditFightingArtViewModel vModel) { string message = string.Empty; ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IFightingArt newObj = vModel.DataObject; if (newObj.CalculateCostRatio() > 0) { ViewData.Add("Message", "The Calculated Cost must be equal to or below zero."); return(View("~/Views/Manage/FightingArtAdd.cshtml", vModel)); } if (newObj.Create(authedUser.GameAccount, authedUser.GetStaffRank(User)) == null) { message = "Error; Creation failed."; } else { LoggingUtility.LogAdminCommandUsage("*WEB* - AddFightingArt[" + newObj.Id.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle); } return(RedirectToAction("FightingArts", new { Message = message })); }