Ejemplo n.º 1
0
        public static Armor GetArmorByName(string name)
        {
            ArmorService _armorService = new ArmorService(EquipmentGlobals.ConnectionString);
            armor        tempArmor     = _armorService.GetArmorByName(name);

            return(MapThisToArmorObject(tempArmor));
        }
Ejemplo n.º 2
0
 private void lab()
 {
     try
     {
         var result = ArmorService.PurchaseArmor(_userId);
         resultLabel.Text = result.Message;
         updateStatistics(result.Hero);
     }
     catch (Exception exception)
     {
         resultLabel.Text = formatErrorMessage(exception.Message);
     }
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }