public IActionResult Create(string type, string itemName, string speed, string damageDie, string damageType, string attackRange) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } Item item = new Item(); Weapon weapon = new Weapon(); item.Name = itemName; item.Type = type; item.Cost = 200; weapon.Speed = int.Parse(speed); weapon.DamageDie = int.Parse(damageDie); weapon.DamageType = damageType; weapon.AttackRange = int.Parse(attackRange); string id = DB.CreateWeapon(item, weapon); ViewBag.UserTitle = user.UserName; return(RedirectToAction("Show", new { id = id })); }
public IActionResult Show(string id) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } return(View(DB.GetBandit(id))); }
public IActionResult New() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } return(View()); }
public IActionResult Destroy(string itemId) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } DB.DeleteItem(itemId); return(RedirectToAction("Index")); }
public IActionResult Show(string id) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } ViewBag.UserTitle = user.UserName; return(View(DB.GetClass(id))); }
public IActionResult New() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } ViewBag.UserTitle = user.UserName; return(View("New")); }
public IActionResult Create(string banditName, string banditClass) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } string id = DB.CreateBandit(banditName, int.Parse(banditClass)); return(RedirectToAction("Show", new { id = id })); }
public IActionResult New() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } Byte[] dataOut; HttpContext.Session.TryGetValue("Id", out dataOut); return(View("New", dataOut)); }
public IActionResult Index() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } List <ItemStats> items = DB.GetAllItemStats(); return(View(items)); }
public IActionResult Index() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } List <Bandit> bandits = DB.GetAll(); return(View(bandits)); }
public IActionResult Show(string id) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } ViewBag.Item = DB.GetItem(id); ViewBag.ItemStats = DB.GetItemStats(ViewBag.Item.Type_Id.ToString(), ViewBag.Item.Type); ViewBag.UserTitle = user.UserName; return(View()); }
public IActionResult Create(string className, string totalHealth, string currentHealth, string strength, string dexterity) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } string id = DB.CreateClass(className, totalHealth, currentHealth, strength, dexterity);; ViewBag.UserTitle = user.UserName; return(RedirectToAction("Show", new { id = id })); }
public IActionResult Index() { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } List <Classes> allClasses = DB.GetAllClasses(); ViewBag.UserTitle = user.UserName; return(View(allClasses)); }
public IActionResult Create(string type, string itemName, string speed, string damageDie, string damageType, string attackRange) { User user = IdCheck.Check(HttpContext.Session.Id); if (user == null) { return(RedirectToAction("Index", "User", new { errorcode = 1 })); } ItemStats item = new ItemStats(); item.Type = type; item.Name = itemName; item.Speed = int.Parse(speed); item.DamageDie = int.Parse(damageDie); item.DamageType = damageType; item.AttackRange = int.Parse(attackRange); string id = DB.CreateItem(item); return(RedirectToAction("Show", new { id = id })); }