public override void ExecuteRefreshCommand()
        {
            try
            {
                IsBusy = true;
                AppCommand.ShowMessage("Loading portfolio...");
                var portfolios = _client.GetMyPortfolios();
                var waccDict   = _client.ReadWaccFromFile().ToDictionary(x => x.ScripName);
                var newItems   = portfolios.MeroShareMyPortfolio
                                 .Select(x => new MeroSharePortfolioAdapter(x, waccDict))
                                 .ToArray();

                Items  = newItems;
                IsBusy = false;
                RaisePropertyChanged(nameof(TotalScrips));
                RaisePropertyChanged(nameof(TotalPrevious));
                RaisePropertyChanged(nameof(TotalLTP));
                RaisePropertyChanged(nameof(DailyGain));
                RaisePropertyChanged(nameof(TotalWacc));
                RaisePropertyChanged(nameof(TotalGain));
            }
            catch (Exception ex)
            {
                IsBusy = false;
                LogDebugAndEnqueMessage(ex.Message);
            }
            AppCommand.HideMessage();
        }
Esempio n. 2
0
 public override void ExecuteRefreshCommand()
 {
     try
     {
         IsBusy = true;
         AppCommand.ShowMessage("Getting old application report");
         Items  = _client.GetOldApplicationReport().Object;
         IsBusy = false;
     }
     catch (Exception ex)
     {
         IsBusy = false;
         EnqueMessage("Failed to get old application report");
         Log.Debug(ex, "Failed to get old application report");
     }
     AppCommand.HideMessage();
 }
 public override void ExecuteRefreshCommand()
 {
     try
     {
         AppCommand.ShowMessage("Getting applicable issues");
         IsBusy = true;
         Items  = _client.GetApplicableIssues().Object;
         IsBusy = false;
     }
     catch (Exception ex)
     {
         IsBusy = false;
         Log.Debug(ex, "Failed to get applicable issues");
         EnqueMessage("Failed to get applicable issues");
     }
     AppCommand.HideMessage();
 }
 public override void ExecuteRefreshCommand()
 {
     try
     {
         IsBusy = true;
         AppCommand.ShowMessage("Getting application report");
         Items = _client.GetApplicationReport().Object;
         if (Items is null)
         {
             _client.IsAuthenticated = false;
             Items = _client.GetApplicationReport().Object;
         }
         IsBusy = false;
     }
     catch (Exception ex)
     {
         IsBusy = false;
         Log.Debug(ex, "Failed to get application report");
         EnqueMessage("Failed to get application report");
     }
     AppCommand.HideMessage();
 }