Exemple #1
0
        public CharacterPage()
        {
            InitializeComponent();

            _vm = App.ServiceProvider.GetService <CharacterPageViewModel>();

            DataContext = _vm;
        }
Exemple #2
0
        public async Task <IActionResult> Index(int id)
        {
            var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);

            var character = await _characterService.GetByIdAsync(id);

            var sections = await _characterService.GetSectionsAsync(id, userId);

            if (character == null)
            {
                return(StatusCode((int)HttpStatusCode.NotFound));
            }

            var model = new CharacterPageViewModel
            {
                Character = _mapper.Map <CharacterViewModel>(character),
                Sections  = sections.Select(s => s.Translate())
            };

            return(View(model));
        }
Exemple #3
0
 public CharacterPage(Character character)
 {
     InitializeComponent();
     BindingContext = new CharacterPageViewModel(character);
 }
Exemple #4
0
        public async Task <IActionResult> Index(int id)
        {
            AuthDTO auth = GetAuth(_ESIClient);

            _Log.LogDebug(String.Format("Logged in to retrieve Character Info for Character Id: {0}", auth.CharacterId));

            Fatigue jumpFatigue = null;

            EVEStandard.Models.System locationSystem = null;
            CharacterAttributes       attributes     = null;

            if (id <= 0)          // Use own Character info
            {
                id = CharacterId; // Set id and use that

                var characterJumpFatigue = await _ESIClient.Character.GetJumpFatigueV1Async(auth);

                jumpFatigue = characterJumpFatigue.Model;

                var characterLocationApi = await _ESIClient.Location.GetCharacterLocationV1Async(auth);

                CharacterLocation characterLocation = characterLocationApi.Model;
                var locationSystemApi = await _ESIClient.Universe.GetSolarSystemInfoV4Async(characterLocation.SolarSystemId);

                locationSystem = locationSystemApi.Model;

                var attributesApi = await _ESIClient.Skills.GetCharacterAttributesV1Async(auth);

                attributes = attributesApi.Model;
            }

            Character_Row character = _DBService.GetCharacterPublicInfo(id);
            var           portrait  = await _ESIClient.Character.GetCharacterPortraitsV2Async(id);

            var corporation = await _ESIClient.Corporation.GetCorporationInfoV4Async((int)character.CorporationId);

            List <SkillQueueDataModel> skillsQueue = await GetSkillQueue(auth, id);

            List <CharacterBookmarkDataModel> bookmarksViewModel = await GetBookmarks(auth);

            bookmarksViewModel = bookmarksViewModel.OrderBy(x => x.Folder.Name).ToList();

            var walletApi = await _ESIClient.Wallet.GetCharacterWalletBalanceV1Async(auth);

            double walletBalance = walletApi.Model;

            var model = new CharacterPageViewModel
            {
                Id                   = id,
                Character            = character,
                Attributes           = attributes,
                Portrait             = portrait.Model,
                Corporation          = corporation.Model,
                LocationSystem       = locationSystem,
                CharacterJumpFatigue = jumpFatigue,
                SkillsQueue          = skillsQueue,
                Bookmarks            = bookmarksViewModel,
                WalletBalance        = walletBalance
            };

            return(View(model));
        }