public EVEveApi GetAPIInformation(int keyId, string vCode) { EVEveApi vapi = new EVEveApi(); EveApi api = new EveApi(keyId, vCode); APIKeyInfo keyInfo = api.getApiKeyInfo(); vapi.KeyId = keyId; vapi.VerificationCode = vCode; vapi.IsActive = false; if (keyInfo.Characters == null || keyInfo.Characters.Count == 0) { throw new ApplicationException(Translator.T("The API information for the account doesn't exist or it is expired")); } foreach (var character in keyInfo.Characters) { EVEveCharacter vchar = new EVEveCharacter(); vchar.Name = character.Name; vchar.EveId = character.CharacterID; vchar.CorpName = character.CorporationName; vchar.CorpId = character.CorporationID; vchar.CorpTicker = GetCorpTicker(keyId, vCode, character.CorporationID.ToString()); vapi.Characters.Add(vchar); } return(vapi); }
public ActionResult CheckAPI(string keyID, string vCode) { try { AgenteAPI agente = new AgenteAPI(); EVEveApi api = agente.CheckAPIInformation(int.Parse(keyID), vCode); return(PartialView("PVNewEVEAccount", api)); } catch (Exception ex) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, ex.Message)); } }