public static Armor GetArmorByName(string name) { ArmorService _armorService = new ArmorService(EquipmentGlobals.ConnectionString); armor tempArmor = _armorService.GetArmorByName(name); return(MapThisToArmorObject(tempArmor)); }
private void lab() { try { var result = ArmorService.PurchaseArmor(_userId); resultLabel.Text = result.Message; updateStatistics(result.Hero); } catch (Exception exception) { resultLabel.Text = formatErrorMessage(exception.Message); } }
public IHttpActionResult GetById(int armorId) { ArmorService armorService = CreateArmorService(); var armor = armorService.GetArmorById(armorId); if (armor.GameId != null) { armor.GameURL = "https://" + HttpContext.Current.Request.Url.Authority + "/api/Game?GameId=" + armor.GameId; } if (armor.HistoryId != null) { armor.HistoryURL = "https://" + HttpContext.Current.Request.Url.Authority + "/api/History?HistoryId=" + armor.HistoryId; } return(Ok(armor)); }
public IHttpActionResult GetByGameId(int gameId) { ArmorService armorService = CreateArmorService(); var armors = armorService.GetArmorsByGameId(gameId); foreach (ArmorListItem h in armors) { if (h.GameId != null) { h.GameURL = "https://" + HttpContext.Current.Request.Url.Authority + "/api/Game?GameId=" + h.GameId; } if (h.HistoryId != null) { h.HistoryURL = "https://" + HttpContext.Current.Request.Url.Authority + "/api/History?HistoryId=" + h.HistoryId; } } return(Ok(armors)); }