/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="param">MEF Eventaggrigator instance</param>
        public ViewModelHoldingsPieChartRegion(DashboardGadgetParam param)
        {
            dbInteractivity        = param.DBInteractivity;
            logger                 = param.LoggerFacade;
            eventAggregator        = param.EventAggregator;
            portfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
            EffectiveDate          = param.DashboardGadgetPayload.EffectiveDate;
            holdingDataFilter      = param.DashboardGadgetPayload.FilterSelectionData;
            lookThruEnabled        = param.DashboardGadgetPayload.IsLookThruEnabled;

            if (EffectiveDate != null && portfolioSelectionData != null && holdingDataFilter != null && IsActive)
            {
                dbInteractivity.RetrieveHoldingsPercentageDataForRegion(portfolioSelectionData, Convert.ToDateTime(EffectiveDate), holdingDataFilter.Filtertype, holdingDataFilter.FilterValues, lookThruEnabled, RetrieveHoldingsPercentageDataForRegionCallbackMethod);
            }
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandleFundReferenceSetEvent);
                eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateReferenceSetEvent);
                eventAggregator.GetEvent <HoldingFilterReferenceSetEvent>().Subscribe(HandleFilterReferenceSetEvent);
                eventAggregator.GetEvent <LookThruFilterReferenceSetEvent>().Subscribe(HandleLookThruReferenceSetEvent);
            }
            if (EffectiveDate != null && portfolioSelectionData != null && holdingDataFilter == null)
            {
                dbInteractivity.RetrieveHoldingsPercentageDataForRegion(portfolioSelectionData, Convert.ToDateTime(EffectiveDate), "Show Everything", " ", lookThruEnabled, RetrieveHoldingsPercentageDataForRegionCallbackMethod);
            }
        }
Exemple #2
0
        /// <summary>
        /// Constructor that initialises the Class
        /// </summary>
        /// <param name="param"></param>
        public ViewModelMultiLineBenchmark(DashboardGadgetParam param)
        {
            if (param != null)
            {
                dbInteractivity = param.DBInteractivity;
                logger          = param.LoggerFacade;
                eventAggregator = param.EventAggregator;

                selectedPortfolio   = param.DashboardGadgetPayload.PortfolioSelectionData;
                periodSelectionData = param.DashboardGadgetPayload.PeriodSelectionData;
                filterSelectionData = param.DashboardGadgetPayload.FilterSelectionData;

                if (eventAggregator != null)
                {
                    SubscribeEvents(eventAggregator);
                }

                if ((selectedPortfolio != null) && (periodSelectionData != null))
                {
                    Dictionary <string, string> objSelectedEntity = new Dictionary <string, string>();
                    if (selectedPortfolio.PortfolioId != null)
                    {
                        objSelectedEntity.Add("PORTFOLIO", selectedPortfolio.PortfolioId);
                    }

                    if (filterSelectionData != null && filterSelectionData.FilterValues != null)
                    {
                        if (SelectedEntities.ContainsKey("COUNTRY"))
                        {
                            SelectedEntities.Remove("COUNTRY");
                        }
                        if (SelectedEntities.ContainsKey("SECTOR"))
                        {
                            SelectedEntities.Remove("SECTOR");
                        }

                        if (filterSelectionData.Filtertype == "Country")
                        {
                            if (filterSelectionData.FilterValues != null)
                            {
                                SelectedEntities.Add("COUNTRY", filterSelectionData.FilterValues);
                            }
                        }
                        else if (filterSelectionData.Filtertype == "Sector")
                        {
                            if (filterSelectionData.FilterValues != null)
                            {
                                SelectedEntities.Add("SECTOR", filterSelectionData.FilterValues);
                            }
                        }
                    }

                    if (objSelectedEntity != null || objSelectedEntity.Count != 0 && IsActive)
                    {
                        dbInteractivity.RetrieveBenchmarkChartReturnData(objSelectedEntity, RetrieveBenchmarkChartDataCallBackMethod);
                        BusyIndicatorStatus = true;
                    }
                }
            }
        }
        /// <summary>
        /// Assigns UI Field Properties based on Holding Filter reference
        /// </summary>
        /// <param name="filterSelectionData">Key value pais consisting of the Filter Type and Filter Value selected by the user </param>
        public void HandleFilterReferenceSetEvent(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (filterSelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, filterSelectionData, 1);
                    holdingDataFilter = filterSelectionData;
                    if (EffectiveDate != null && portfolioSelectionData != null && holdingDataFilter != null && IsActive)
                    {
                        if (null != holdingsPieChartForRegionDataLoadedEvent)
                        {
                            holdingsPieChartForRegionDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
                            {
                                ShowBusy = true
                            });
                        }
                        BeginWebServiceCall(portfolioSelectionData, Convert.ToDateTime(EffectiveDate), holdingDataFilter.Filtertype, holdingDataFilter.FilterValues, lookThruEnabled);
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            Logging.LogEndMethod(logger, methodNamespace);
        }
 /// <summary>
 /// Constructor of the class that initializes various objects
 /// </summary>
 /// <param name="param">MEF Eventaggrigator instance</param>
 public ViewModelValuationQualityGrowth(DashboardGadgetParam param)
 {
     dbInteractivity        = param.DBInteractivity;
     logger                 = param.LoggerFacade;
     eventAggregator        = param.EventAggregator;
     portfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
     effectiveDate          = param.DashboardGadgetPayload.EffectiveDate;
     holdingDataFilter      = param.DashboardGadgetPayload.FilterSelectionData;
     lookThruEnabled        = param.DashboardGadgetPayload.IsLookThruEnabled;
     if (eventAggregator != null)
     {
         eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandleFundReferenceSet);
         eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateSet);
         eventAggregator.GetEvent <HoldingFilterReferenceSetEvent>().Subscribe(HandleFilterReferenceSetEvent);
         eventAggregator.GetEvent <LookThruFilterReferenceSetEvent>().Subscribe(HandleLookThruReferenceSetEvent);
     }
     if (effectiveDate != null && portfolioSelectionData != null && holdingDataFilter != null && IsActive)
     {
         dbInteractivity.RetrieveValuationGrowthData(portfolioSelectionData, effectiveDate, holdingDataFilter.Filtertype,
                                                     holdingDataFilter.FilterValues, lookThruEnabled, RetrieveValuationQualityGrowthCallbackMethod);
     }
     if (effectiveDate != null && portfolioSelectionData != null && holdingDataFilter == null && IsActive)
     {
         dbInteractivity.RetrieveValuationGrowthData(portfolioSelectionData, effectiveDate, "Show Everything", " ",
                                                     lookThruEnabled, RetrieveValuationQualityGrowthCallbackMethod);
     }
 }
        public ViewModelMarketCapitalization(DashboardGadgetParam param)
        {
            eventAggregator = param.EventAggregator;
            dbInteractivity = param.DBInteractivity;
            logger          = param.LoggerFacade;

            portfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
            effectiveDate          = param.DashboardGadgetPayload.EffectiveDate;
            mktCapDataFilter       = param.DashboardGadgetPayload.FilterSelectionData;
            IsExCashSecurity       = param.DashboardGadgetPayload.IsExCashSecurityData;
            lookThruEnabled        = param.DashboardGadgetPayload.IsLookThruEnabled;

            if (effectiveDate != null && portfolioSelectionData != null && IsActive)// && _mktCapDataFilter != null)
            {
                CallingWebMethod();
            }
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandleFundReferenceSet);
                eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateSet);
                eventAggregator.GetEvent <HoldingFilterReferenceSetEvent>().Subscribe(HandleFilterReferenceSetEvent);
                eventAggregator.GetEvent <ExCashSecuritySetEvent>().Subscribe(HandleExCashSecuritySetEvent);
                eventAggregator.GetEvent <LookThruFilterReferenceSetEvent>().Subscribe(HandleLookThruReferenceSetEvent);
            }
        }
        /// <summary>
        /// Assigns UI Field Properties based on Holding Filter reference
        /// </summary>
        /// <param name="filterSelectionData">Key value pairs consisting of the Filter Type and Filter Value selected by the user </param>
        public void HandleFilterReferenceSetEvent(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (filterSelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, filterSelectionData, 1);
                    mktCapDataFilter = filterSelectionData;
                    if (MarketCapitalizationDataLoadEvent != null)
                    {
                        MarketCapitalizationDataLoadEvent(new DataRetrievalProgressIndicatorEventArgs()
                        {
                            ShowBusy = true
                        });
                    }
                    if (effectiveDate != null && portfolioSelectionData != null && mktCapDataFilter != null && IsActive)
                    {
                        CallingWebMethod();
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            Logging.LogEndMethod(logger, methodNamespace);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="param">DashBoardGadgetParam</param>
        public ViewModelRiskIndexExposures(DashboardGadgetParam param)
        {
            eventAggregator            = param.EventAggregator;
            dbInteractivity            = param.DBInteractivity;
            logger                     = param.LoggerFacade;
            portfolioSelectionDataInfo = param.DashboardGadgetPayload.PortfolioSelectionData;
            isExCashSecurity           = param.DashboardGadgetPayload.IsExCashSecurityData;
            EffectiveDate              = param.DashboardGadgetPayload.EffectiveDate;
            holdingDataFilter          = param.DashboardGadgetPayload.FilterSelectionData;
            lookThruEnabled            = param.DashboardGadgetPayload.IsLookThruEnabled;

            if ((portfolioSelectionDataInfo != null) && (EffectiveDate != null) && holdingDataFilter != null && IsActive)
            {
                dbInteractivity.RetrieveRiskIndexExposuresData(portfolioSelectionDataInfo, Convert.ToDateTime(effectiveDateInfo), isExCashSecurity, lookThruEnabled,
                                                               holdingDataFilter.Filtertype, holdingDataFilter.FilterValues, RetrieveRiskIndexExposuresDataCallbackMethod);
                BusyIndicatorStatus = true;
            }
            else if ((portfolioSelectionDataInfo != null) && (EffectiveDate != null) && holdingDataFilter == null && IsActive)
            {
                dbInteractivity.RetrieveRiskIndexExposuresData(portfolioSelectionDataInfo, Convert.ToDateTime(effectiveDateInfo), isExCashSecurity, lookThruEnabled,
                                                               "Show Everything", " ", RetrieveRiskIndexExposuresDataCallbackMethod);
                BusyIndicatorStatus = true;
            }

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandlePortfolioReferenceSet);
                eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateSet);
                eventAggregator.GetEvent <ExCashSecuritySetEvent>().Subscribe(HandleExCashSecuritySetEvent);
                eventAggregator.GetEvent <LookThruFilterReferenceSetEvent>().Subscribe(HandleLookThruReferenceSetEvent);
                eventAggregator.GetEvent <HoldingFilterReferenceSetEvent>().Subscribe(HandleFilterReferenceSetEvent);
            }
        }
Exemple #8
0
        /// <summary>
        /// Handle Security change Event
        /// </summary>
        /// <param name="filterSelectionData">Details of Selected Security</param>
        public void HandleFilterReferenceSet(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                //ArgumentNullException
                if (filterSelectionData != null)
                {
                    this.filterSelectionData = filterSelectionData;

                    if (SelectedEntities.ContainsKey("COUNTRY"))
                    {
                        SelectedEntities.Remove("COUNTRY");
                    }
                    if (SelectedEntities.ContainsKey("SECTOR"))
                    {
                        SelectedEntities.Remove("SECTOR");
                    }
                    if (filterSelectionData.Filtertype == "Country")
                    {
                        if (filterSelectionData.FilterValues != null)
                        {
                            SelectedEntities.Add("COUNTRY", filterSelectionData.FilterValues);
                        }
                    }
                    else if (filterSelectionData.Filtertype == "Sector")
                    {
                        if (filterSelectionData.FilterValues != null)
                        {
                            SelectedEntities.Add("SECTOR", filterSelectionData.FilterValues);
                        }
                    }

                    if (SelectedEntities != null && SelectedEntities.ContainsKey("PORTFOLIO") && IsActive)
                    {
                        dbInteractivity.RetrieveBenchmarkChartReturnData(SelectedEntities, RetrieveBenchmarkChartDataCallBackMethod);
                        dbInteractivity.RetrieveBenchmarkGridReturnData(SelectedEntities, RetrieveBenchmarkGridDataCallBackMethod);
                        BusyIndicatorStatus = true;
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
        }
        /// <summary>
        /// Assigns UI Field Properties based on Holding Filter reference
        /// </summary>
        /// <param name="filterSelectionData">Key value pais consisting of the Filter Type and Filter Value selected by the user </param>
        public void HandleFilterReferenceSetEvent(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (filterSelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, filterSelectionData, 1);
                    holdingDataFilter = filterSelectionData;
                    if (effectiveDate != null && portfolioSelectionData != null && holdingDataFilter != null && IsActive)
                    {
                        if (null != ValuationQualityGrowthDataLoadedEvent)
                        {
                            ValuationQualityGrowthDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
                            {
                                ShowBusy = true
                            });
                        }
                        dbInteractivity.RetrieveValuationGrowthData(portfolioSelectionData, effectiveDate, holdingDataFilter.Filtertype,
                                                                    holdingDataFilter.FilterValues, lookThruEnabled, RetrieveValuationQualityGrowthCallbackMethod);
                    }
                    if (effectiveDate != null && portfolioSelectionData != null && holdingDataFilter == null && IsActive)
                    {
                        if (null != ValuationQualityGrowthDataLoadedEvent)
                        {
                            ValuationQualityGrowthDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
                            {
                                ShowBusy = true
                            });
                        }
                        dbInteractivity.RetrieveValuationGrowthData(portfolioSelectionData, effectiveDate, "Show Everything", " ",
                                                                    lookThruEnabled, RetrieveValuationQualityGrowthCallbackMethod);
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            Logging.LogEndMethod(logger, methodNamespace);
        }
Exemple #10
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dbInteractivity">Instance of service caller class</param>
        /// <param name="eventAggregator"></param>
        /// <param name="logger">Instance of LoggerFacade</param>
        public ViewModelPortfolioDetails(DashboardGadgetParam param)
        {
            this.dbInteractivity   = param.DBInteractivity;
            this.eventAggregator   = param.EventAggregator;
            this.logger            = param.LoggerFacade;
            portfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
            SelectedPortfolioId    = portfolioSelectionData;
            effectiveDate          = param.DashboardGadgetPayload.EffectiveDate;
            ExcludeCashSecurities  = param.DashboardGadgetPayload.IsExCashSecurityData;
            EnableLookThru         = param.DashboardGadgetPayload.IsLookThruEnabled;
            holdingDataFilter      = param.DashboardGadgetPayload.FilterSelectionData;

            this.ModelDataAreIncorrect = Visibility.Collapsed;

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandlePortfolioReferenceSet);
                eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateSet);
                eventAggregator.GetEvent <ExCashSecuritySetEvent>().Subscribe(HandleExCashSecuritySetEvent);
                eventAggregator.GetEvent <LookThruFilterReferenceSetEvent>().Subscribe(HandleLookThruReferenceSetEvent);
                eventAggregator.GetEvent <HoldingFilterReferenceSetEvent>().Subscribe(HandleFilterReferenceSetEvent);
            }
        }
Exemple #11
0
        public void HandleFilterReferenceSetEvent(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (filterSelectionData != null)
                {
                    /*if (dbInteractivity != null && SelectedPortfolioId != null && effectiveDate != null && IsActive)
                     * {
                     *  BusyIndicatorStatus = true;
                     *  holdingDataFilter = filterSelectionData;
                     *  if (holdingDataFilter != null && holdingDataFilter.Filtertype != null && holdingDataFilter.FilterValues != null)
                     *  {
                     *      RetrievePortfolioDetailsData(SelectedPortfolioId, Convert.ToDateTime(effectiveDate), holdingDataFilter.Filtertype, holdingDataFilter.FilterValues, GetBenchmarkData, RetrievePortfolioDetailsDataCallbackMethod);
                     *  }
                     *  else
                     *  {
                     *      RetrievePortfolioDetailsData(SelectedPortfolioId, Convert.ToDateTime(effectiveDate), null, null, GetBenchmarkData, RetrievePortfolioDetailsDataCallbackMethod);
                     *  }
                     * }*/

                    holdingDataFilter = filterSelectionData;
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            Logging.LogEndMethod(logger, methodNamespace);
        }
        /// <summary>
        /// Assigns UI Field Properties based on Holding Filter reference
        /// </summary>
        /// <param name="filterSelectionData">Key value pair consisting of the Filter Type and Filter Value selected by the user </param>
        public void HandleFilterReferenceSetEvent(FilterSelectionData filterSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (filterSelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, filterSelectionData, 1);
                    holdingDataFilter = filterSelectionData;
                    if (EffectiveDate != null && portfolioSelectionDataInfo != null && holdingDataFilter != null && IsActive)
                    {
                        dbInteractivity.RetrieveRiskIndexExposuresData(portfolioSelectionDataInfo, Convert.ToDateTime(effectiveDateInfo), isExCashSecurity,
                                                                       lookThruEnabled, holdingDataFilter.Filtertype, holdingDataFilter.FilterValues, RetrieveRiskIndexExposuresDataCallbackMethod);
                        BusyIndicatorStatus = true;
                    }
                    else if ((portfolioSelectionDataInfo != null) && (EffectiveDate != null) && holdingDataFilter == null && IsActive)
                    {
                        dbInteractivity.RetrieveRiskIndexExposuresData(portfolioSelectionDataInfo, Convert.ToDateTime(effectiveDateInfo), isExCashSecurity,
                                                                       lookThruEnabled, "Show Everything", " ", RetrieveRiskIndexExposuresDataCallbackMethod);
                        BusyIndicatorStatus = true;
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            Logging.LogEndMethod(logger, methodNamespace);
        }