/// <summary>
        /// Constructor that initialises the class.
        /// </summary>
        /// <param name="param">DashboardGadget payload</param>
        public ViewModelRelativePerformanceUI(DashboardGadgetParam param)
        {
            dbInteractivity = param.DBInteractivity;
            logger          = param.LoggerFacade;
            eventAggregator = param.EventAggregator;

            portfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
            entitySelectionData    = param.DashboardGadgetPayload.EntitySelectionData;
            effectiveDate          = param.DashboardGadgetPayload.EffectiveDate;

            if (portfolioSelectionData != null)
            {
                HandleFundReferenceSet(portfolioSelectionData);
            }
            if (entitySelectionData != null)
            {
                HandleSecurityReferenceSet(entitySelectionData);
            }
            if (effectiveDate != null)
            {
                HandleEffectiveDateSet(Convert.ToDateTime(effectiveDate));
            }
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet, false);
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandleFundReferenceSet);
                eventAggregator.GetEvent <EffectiveDateReferenceSetEvent>().Subscribe(HandleEffectiveDateSet);
            }
        }
        /// <summary>
        /// Event Handler to subscribed event 'SecurityReferenceSet'
        /// </summary>
        /// <param name="securityReferenceData">SecurityReferenceData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                //argument null exception
                if (entitySelectionData != null)
                {
                    SelectedSecurity = entitySelectionData;
                    if (SelectedEntities.ContainsKey("SECURITY"))
                    {
                        SelectedEntities.Remove("SECURITY");
                    }
                    SelectedEntities.Add("SECURITY", entitySelectionData.LongName);

                    if (SelectedStartDate != null && SelectedEntities != null && period != null && SelectedEntities.ContainsKey("PORTFOLIO") && IsActive)
                    {
                        dbInteractivity.RetrieveChartExtensionData(SelectedEntities, Convert.ToDateTime(SelectedStartDate), RetrieveChartExtensionDataCallbackMethod);
                        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);
            }
        }
Exemple #3
0
 public bool DeleteFairValues(EntitySelectionData entitySelectionData)
 {
     try
     {
         ExternalResearchEntities            entity = new ExternalResearchEntities();
         GreenField.DAL.GF_SECURITY_BASEVIEW data   = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault();
         if (data == null)
         {
             return(false);
         }
         int?securityId = int.Parse(data.SECURITY_ID);
         if (securityId == null)
         {
             return(false);
         }
         entity.DeleteDCFFairValueData(Convert.ToString(securityId));
         return(true);
     }
     catch (Exception ex)
     {
         ExceptionTrace.LogException(ex);
         string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
         throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
     }
 }
Exemple #4
0
 public List <PERIOD_FINANCIALS> RetrieveFairValue(EntitySelectionData entitySelectionData)
 {
     try
     {
         List <PERIOD_FINANCIALS>            result = new List <PERIOD_FINANCIALS>();
         GreenField.DAL.GF_SECURITY_BASEVIEW data   = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault();
         if (data == null)
         {
             return(new List <PERIOD_FINANCIALS>());
         }
         int?securityId = int.Parse(data.SECURITY_ID);
         if (securityId == null)
         {
             return(new List <PERIOD_FINANCIALS>());
         }
         ExternalResearchEntities entity = new ExternalResearchEntities();
         result = entity.GetDCFFairValue(Convert.ToString(securityId)).ToList();
         if (result == null)
         {
             return(new List <PERIOD_FINANCIALS>());
         }
         return(result);
     }
     catch (Exception ex)
     {
         ExceptionTrace.LogException(ex);
         string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
         throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
     }
 }
Exemple #5
0
        public bool InsertFairValues(EntitySelectionData entitySelectionData, string valueType, int?fvMeasure, decimal?fvbuy, decimal?fvSell, decimal?currentMeasureValue, decimal?upside, DateTime?updated)
        {
            try
            {
                ExternalResearchEntities            entity = new ExternalResearchEntities();
                GreenField.DAL.GF_SECURITY_BASEVIEW data   = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault();
                if (data == null)
                {
                    return(false);
                }
                int?securityId = int.Parse(data.SECURITY_ID);
                if (securityId == null)
                {
                    return(false);
                }
                if (valueType != null)
                {
                    valueType = valueType.ToUpper();
                }

                entity.InsertDCFFairValue(Convert.ToString(securityId), valueType, fvMeasure, fvbuy, fvSell, currentMeasureValue, upside, updated, "C", 0);
                return(true);
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }
        }
        /// <summary>
        /// Event Handler to subscribed event 'SecurityReferenceSet'
        /// </summary>
        /// <param name="securityReferenceData">SecurityReferenceData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                //ArgumentNullException
                if (entitySelectionData != null)
                {
                    SelectedSecurity = entitySelectionData;
                    if (SelectedSecurity != null && IsActive)
                    {
                        dbInteractivity.RetrieveTargetPriceData(SelectedSecurity, RetrieveTargetPriceDataCallbackMethod);
                        BusyIndicatorNotification(true, "Updating information based on selected Security");
                    }
                }
                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);
            }
        }
Exemple #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ViewModelFinstat(DashboardGadgetParam param)
        {
            logger              = param.LoggerFacade;
            dbInteractivity     = param.DBInteractivity;
            eventAggregator     = param.EventAggregator;
            entitySelectionData = param.DashboardGadgetPayload.EntitySelectionData;

            PeriodColumns.PeriodColumnNavigate += (e) =>
            {
                if (e.PeriodColumnNamespace == GetType().FullName)
                {
                    Iterator = e.PeriodColumnNavigationDirection == NavigationDirection.LEFT ? Iterator - 1 : Iterator + 1;
                    SetFinstatDetailDisplayInfo();
                }
            };

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSetEvent);
            }

            if (entitySelectionData != null)
            {
                HandleSecurityReferenceSetEvent(entitySelectionData);
            }
        }
        /// <summary>
        /// Event Handler to subscribed event 'SecurityReferenceSet'
        /// </summary>
        /// <param name="securityReferenceData">SecurityReferenceData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    securitySelectionData = entitySelectionData;

                    if (securitySelectionData.InstrumentID != null && securitySelectionData.InstrumentID != string.Empty)
                    {
                        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);
            }
        }
Exemple #9
0
        /// <summary>
        /// Assigns UI Field Properties based on Security reference
        /// </summary>
        /// <param name="securityReferenceData">entitySelectionData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    entitySelectionData1 = entitySelectionData;
                    RetrieveUnrealizedGainLossData(entitySelectionData);
                }
                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>
        /// Security change Event
        /// </summary>
        /// <param name="result"></param>
        public void HandleSecurityReferenceSetEvent(EntitySelectionData result)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (result != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, result, 1);
                    EntitySelectionInfo = result;
                    if (EntitySelectionInfo != null && IsActive)
                    {
                        BusyIndicatorNotification(true, "Retrieving Issuer Details based on selected security");
                        dbInteractivity.RetrieveIssuerReferenceData(result, RetrieveIssuerReferenceDataCallbackMethod);
                    }
                }
                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 #11
0
        /// <summary>
        /// assigns UI field properties based on Entity Selection Data
        /// </summary>
        /// <param name="entitySelectionData">EntitySelectionData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    entitySelectionParam = entitySelectionData;

                    if (IsActive && entitySelectionParam != null)
                    {
                        dbInteractivity.RetrieveSecurityOverviewData(entitySelectionParam, RetrieveSecurityReferenceDataCallBackMethod);
                        BusyIndicatorContent = "Retrieving security reference data for '" + entitySelectionData.LongName + " (" + entitySelectionData.ShortName + ")'";
                        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);
        }
        /// <summary>
        /// Assigns UI Field Properties based on Entity Selection Data
        /// </summary>
        /// <param name="entitySelectionData">EntitySelectionData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    EntitySelectionInfo = entitySelectionData;
                    PortfolioSelectionData p = new PortfolioSelectionData();
                    p.IsComposite          = true;
                    p.PortfolioId          = "EQYALL";
                    PortfolioSelectionInfo = p;
                    if (IsActive && EntitySelectionInfo != null && PortfolioSelectionInfo != null)
                    {
                        //  RaisePropertyChanged(() => this.SubmitCommand);


                        HandlePortfolioReferenceSet(PortfolioSelectionInfo);
                    }
                }
                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="eventAggregator">MEF Eventaggregator instance</param>
 public ViewModelPCE(DashboardGadgetParam param)
 {
     eventAggregator       = param.EventAggregator;
     dbInteractivity       = param.DBInteractivity;
     logger                = param.LoggerFacade;
     securitySelectionData = param.DashboardGadgetPayload.EntitySelectionData;
     if (eventAggregator != null)
     {
         eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet);
     }
     CallingWebMethod();
 }
Exemple #14
0
        public List <FreeCashFlowsData> RetrieveFreeCashFlowsData(EntitySelectionData entitySelectionData)
        {
            try
            {
                List <FreeCashFlowsData>       result            = new List <FreeCashFlowsData>();
                List <GetFreeCashFlows_Result> resultDB          = new List <GetFreeCashFlows_Result>();
                ExternalResearchEntities       dcf_FreeCashFlows = new ExternalResearchEntities();

                if (entitySelectionData == null)
                {
                    return(null);
                }

                DimensionEntities entity = DimensionEntity;

                /*  bool isServiceUp;
                 * isServiceUp = CheckServiceAvailability.ServiceAvailability();
                 *
                 * if (!isServiceUp)
                 *    throw new Exception("Services are not available");*/

                //Retrieving data from security view
                GreenField.DAL.GF_SECURITY_BASEVIEW data = entity.GF_SECURITY_BASEVIEW
                                                           .Where(record => record.TICKER == entitySelectionData.ShortName &&
                                                                  record.ISSUE_NAME == entitySelectionData.LongName &&
                                                                  record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID &&
                                                                  record.SECURITY_TYPE == entitySelectionData.SecurityType)
                                                           .FirstOrDefault();

                if (data == null)
                {
                    return(null);
                }
                ////Retrieving data from Period Financials table
                resultDB = dcf_FreeCashFlows.ExecuteStoreQuery <GetFreeCashFlows_Result>("exec GetFreeCashFlows @IssuerID={0}", data.ISSUER_ID).ToList();

                foreach (GetFreeCashFlows_Result record in resultDB)
                {
                    FreeCashFlowsData item = new FreeCashFlowsData();
                    item.FieldName  = record.FIELD_NAME;
                    item.PeriodYear = record.PERIOD_YEAR;
                    item.Amount     = record.AMOUNT;
                    result.Add(item);
                }
                return(result);
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }
        }
Exemple #15
0
        public List <DCFSummaryData> RetrieveSummaryData(EntitySelectionData entitySelectionData)
        {
            try
            {
                List <DCFSummaryData>    result         = new List <DCFSummaryData>();
                List <DCFSummaryDBData>  dbResult       = new List <DCFSummaryDBData>();
                List <DCFSummaryDBData>  dbResultShares = new List <DCFSummaryDBData>();
                ExternalResearchEntities entity         = new ExternalResearchEntities();
                if (entitySelectionData == null)
                {
                    return(new List <DCFSummaryData>());
                }

                /*  #region ServiceAvailabilityChecker
                 *
                 * bool isServiceUp;
                 * isServiceUp = CheckServiceAvailability.ServiceAvailability();
                 *
                 * if (!isServiceUp)
                 * {
                 *    throw new Exception("Services are not available");
                 * }
                 #endregion*/

                GreenField.DAL.GF_SECURITY_BASEVIEW securityDetails = DimensionEntity.GF_SECURITY_BASEVIEW
                                                                      .Where(record => record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID &&
                                                                             record.ISSUE_NAME == entitySelectionData.LongName &&
                                                                             record.TICKER == entitySelectionData.ShortName).FirstOrDefault();

                string issuerId = securityDetails.ISSUER_ID;
                if (issuerId == null)
                {
                    return(new List <DCFSummaryData>());
                }
                dbResult       = entity.GetDCFSummaryData(issuerId).ToList();
                dbResultShares = entity.GetDCF_NumberOfShares(Convert.ToString(securityDetails.SECURITY_ID)).ToList();
                DCFSummaryData data = new DCFSummaryData();
                data.Cash           = dbResult.Where(a => a.DATA_ID == 255).Select(a => a.AMOUNT).FirstOrDefault();
                data.FVInvestments  = dbResult.Where(a => a.DATA_ID == 258).Select(a => a.AMOUNT).FirstOrDefault();
                data.GrossDebt      = dbResult.Where(a => a.DATA_ID == 256).Select(a => a.AMOUNT).FirstOrDefault();
                data.FVMinorities   = dbResult.Where(a => a.DATA_ID == 257).Select(a => a.AMOUNT).FirstOrDefault();
                data.NumberOfShares = dbResultShares.Select(a => a.AMOUNT).FirstOrDefault();
                result.Add(data);
                return(result);
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }
        }
Exemple #16
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ViewModelCompositeFund(DashboardGadgetParam param)
        {
            logger                 = param.LoggerFacade;
            dbInteractivity        = param.DBInteractivity;
            eventAggregator        = param.EventAggregator;
            PortfolioSelectionData = param.DashboardGadgetPayload.PortfolioSelectionData;
            entitySelectionData    = param.DashboardGadgetPayload.EntitySelectionData;

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <PortfolioReferenceSetEvent>().Subscribe(HandlePortfolioReferenceSet);
                eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSetEvent);
            }
        }
Exemple #17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="param">DashBoardGadgetParam</param>
 public ViewModelConsensusEstimateSummary(DashboardGadgetParam param)
 {
     eventAggregator     = param.EventAggregator;
     dbInteractivity     = param.DBInteractivity;
     logger              = param.LoggerFacade;
     entitySelectionData = param.DashboardGadgetPayload.EntitySelectionData;
     if (entitySelectionData != null && IsActive)
     {
         HandleSecurityReferenceSet(entitySelectionData);
     }
     if (eventAggregator != null)
     {
         eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet);
     }
 }
Exemple #18
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="param">DashboardGadgetParam</param>
        public ViewModelSecurityOverview(DashboardGadgetParam param)
        {
            eventAggregator      = param.EventAggregator;
            dbInteractivity      = param.DBInteractivity;
            logger               = param.LoggerFacade;
            entitySelectionParam = param.DashboardGadgetPayload.EntitySelectionData;

            //subscription to SecurityReferenceSet event
            eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet);

            //EntitySelectionData handling
            if (entitySelectionParam != null)
            {
                HandleSecurityReferenceSet(entitySelectionParam);
            }
        }
Exemple #19
0
 /// <summary>
 /// Constructor of the class that initializes various objects
 /// </summary>
 /// <param name="param">MEF Eventaggrigator instance</param>
 public ViewModelUnrealizedGainLoss(DashboardGadgetParam param)
 {
     dbInteractivity      = param.DBInteractivity;
     logger               = param.LoggerFacade;
     eventAggregator      = param.EventAggregator;
     entitySelectionData1 = param.DashboardGadgetPayload.EntitySelectionData;
     eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet, false);
     if (entitySelectionData1 != null)
     {
         if (null != unrealizedGainLossDataLoadedEvent)
         {
             unrealizedGainLossDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
             {
                 ShowBusy = true
             });
         }
         RetrieveUnrealizedGainLossData(entitySelectionData1);
     }
 }
        public ViewModelFreeCashFlows(DashboardGadgetParam param)
        {
            eventAggregator       = param.EventAggregator;
            dbInteractivity       = param.DBInteractivity;
            logger                = param.LoggerFacade;
            securitySelectionData = param.DashboardGadgetPayload.EntitySelectionData;

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <SecurityReferenceSetEvent>().Subscribe(HandleSecurityReferenceSet);
            }
            if (securitySelectionData != null && IsActive)
            {
                if (securitySelectionData.InstrumentID != null && securitySelectionData.InstrumentID != string.Empty)
                {
                    CallingWebMethod();
                }
            }
        }
        /// <summary>
        /// Handle Security Change Event
        /// </summary>
        /// <param name="PortfolioSelectionData">Details of Selected Security</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    if (entitySelectionData.InstrumentID == null)
                    {
                        throw new Exception("Security Data Cannot be Fetched for this Security");
                    }
                    if (SelectedEntityValues.ContainsKey("SECURITY"))
                    {
                        SelectedEntityValues.Remove("SECURITY");
                    }
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    SelectedSecurity = entitySelectionData;
                    SelectedEntityValues.Add("SECURITY", entitySelectionData.LongName);
                    if (SelectedPortfolio != null && SelectedDate != null && SelectedSecurity != null && SelectedEntityValues != null && IsActive)
                    {
                        dbInteractivity.RetrieveRelativePerformanceUIData(SelectedEntityValues, SelectedDate, RelativePerformanceUIDataCallbackMethod);
                        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);
        }
Exemple #22
0
        /// <summary>
        /// Method that calls the service Method through propertyName call to Service Caller
        /// </summary>
        /// <param name="Ticker">Unique Identifier for propertyName security</param>
        /// <param name="callback">Callback for this method</param>
        private void RetrieveUnrealizedGainLossData(EntitySelectionData entitySelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entitySelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entitySelectionData, 1);
                    PlottedSecurityName = entitySelectionData.LongName;
                    DateTime periodStartDate;
                    DateTime periodEndDate;
                    GetPeriod(out periodStartDate, out periodEndDate);
                    if (IsActive)
                    {
                        if (null != unrealizedGainLossDataLoadedEvent)
                        {
                            unrealizedGainLossDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
                            {
                                ShowBusy = true
                            });
                        }
                        dbInteractivity.RetrieveUnrealizedGainLossData(entitySelectionData, periodStartDate, periodEndDate, SelectedFrequencyRange, RetrieveUnrealizedGainLossDataCallBackMethod);
                    }
                }
                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 #23
0
 public string RetrieveCountryName(EntitySelectionData entitySelectionData)
 {
     try
     {
         string countryName = string.Empty;
         GreenField.DAL.GF_SECURITY_BASEVIEW data = DimensionEntity.GF_SECURITY_BASEVIEW.Where(a => a.ISSUE_NAME == entitySelectionData.LongName).FirstOrDefault();
         if (data != null)
         {
             countryName = data.ASEC_SEC_COUNTRY_NAME;
         }
         if (countryName == null)
         {
             return(string.Empty);
         }
         return(countryName);
     }
     catch (Exception ex)
     {
         ExceptionTrace.LogException(ex);
         string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
         throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
     }
 }
Exemple #24
0
        public decimal?RetrieveCurrentPriceData(EntitySelectionData entitySelectionData)
        {
            try
            {
                if (entitySelectionData == null)
                {
                    return(0);
                }

                /*   #region ServiceAvailabilityChecker
                 *
                 * bool isServiceUp;
                 * isServiceUp = CheckServiceAvailability.ServiceAvailability();
                 *
                 * if (!isServiceUp)
                 * {
                 *     throw new Exception("Services are not available");
                 * }
                 #endregion*/

                GreenField.DAL.GF_SECURITY_BASEVIEW securityDetails = DimensionEntity.GF_SECURITY_BASEVIEW
                                                                      .Where(record => record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID &&
                                                                             record.ISSUE_NAME == entitySelectionData.LongName &&
                                                                             record.TICKER == entitySelectionData.ShortName).FirstOrDefault();
                if (securityDetails == null)
                {
                    return(0);
                }
                return(Convert.ToDecimal(securityDetails.CLOSING_PRICE));
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }
        }
Exemple #25
0
        /// <summary>
        /// Assigns UI Field Properties based on Security reference
        /// </summary>
        /// <param name="securityReferenceData">entitySelectionData</param>
        public void HandleSecurityReferenceSet(EntitySelectionData entSelectionData)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (entSelectionData != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, entSelectionData, 1);
                    entitySelectionData = entSelectionData;
                    if (entitySelectionData != null && IsActive)
                    {
                        if (null != ConsensusEstimatesSummaryDataLoadedEvent)
                        {
                            ConsensusEstimatesSummaryDataLoadedEvent(new DataRetrievalProgressIndicatorEventArgs()
                            {
                                ShowBusy = true
                            });
                        }
                        dbInteractivity.RetrieveConsensusEstimatesSummaryData(entitySelectionData,
                                                                              RetrieveConsensusEstimatesSummaryDataDataCallbackMethod);
                    }
                }
                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 that Initialises the class
 /// </summary>
 /// <param name="param"></param>
 public ViewModelSlice1ChartExtension(DashboardGadgetParam param)
 {
     eventAggregator     = param.EventAggregator;
     dbInteractivity     = param.DBInteractivity;
     logger              = param.LoggerFacade;
     selectedPortfolio   = param.DashboardGadgetPayload.PortfolioSelectionData;
     entitySelectionData = param.DashboardGadgetPayload.EntitySelectionData;
     period              = param.DashboardGadgetPayload.PeriodSelectionData;
     if (entitySelectionData != null && period != null)
     {
         Dictionary <string, string> objDictionary = new Dictionary <string, string>();
         objDictionary.Add("SECURITY", entitySelectionData.LongName);
         DateTime startDate = DateTime.Today.AddYears(-1);
         if (IsActive)
         {
             dbInteractivity.RetrieveChartExtensionData(objDictionary, startDate, RetrieveChartExtensionDataCallbackMethod);
             BusyIndicatorStatus = true;
         }
     }
     if (eventAggregator != null)
     {
         SubscribeEvents(eventAggregator);
     }
 }
Exemple #27
0
        public List <FairValueCompositionSummaryData> RetrieveFairValueCompostionSummary(EntitySelectionData entitySelectionData)
        {
            try
            {
                List <FairValueCompositionSummaryData> result   = new List <FairValueCompositionSummaryData>();
                List <GetFairValueComposition_Result>  resultDB = new List <GetFairValueComposition_Result>();
                ExternalResearchEntities fairValueCompSummary   = new ExternalResearchEntities();

                if (entitySelectionData == null)
                {
                    return(null);
                }

                //Retrieving data from security view
                GreenField.DAL.GF_SECURITY_BASEVIEW data = GetSecurityDataForSelectedSecurity(entitySelectionData);

                if (data == null)
                {
                    return(null);
                }

                ////Retrieving data from Period Financials table
                resultDB = fairValueCompSummary.ExecuteStoreQuery <GetFairValueComposition_Result>("exec GetFairValueCompositionSummaryData @SECURITY_ID={0}", Convert.ToString(data.SECURITY_ID)).ToList();

                if (resultDB == null || resultDB.Count == 0)
                {
                    List <FairValueCompositionSummaryData> items = GetSummaryDataIfDatabaseContaisnNorecords(data);
                    result.AddRange(items);
                }

                foreach (GetFairValueComposition_Result record in resultDB)
                {
                    FairValueCompositionSummaryData item = new FairValueCompositionSummaryData();
                    if (!String.IsNullOrEmpty(record.SOURCE))
                    {
                        if (record.SOURCE.ToUpper() == "PRIMARY")
                        {
                            item.Source = "Primary Analyst";
                        }
                        else
                        {
                            if (record.SOURCE.ToUpper() == "INDUSTRY")
                            {
                                item.Source = "Industry Analyst";
                            }
                            else
                            {
                                item.Source = record.SOURCE;
                            }
                        }
                    }
                    item.Measure = record.MEASURE;
                    item.Buy     = record.BUY;
                    item.Sell    = record.SELL;
                    item.Upside  = record.UPSIDE;
                    if (record.DATE != null)
                    {
                        item.Date = record.DATE.Value;
                    }
                    item.DataId          = record.DATA_ID;
                    item.PrimaryAnalyst  = data.ASHMOREEMM_PRIMARY_ANALYST;
                    item.IndustryAnalyst = data.ASHMOREEMM_INDUSTRY_ANALYST;
                    result.Add(item);
                }
                return(result);
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }
        }
Exemple #28
0
        public List <FairValueCompositionSummaryData> SaveUpdatedFairValueData(EntitySelectionData entitySelectionData,
                                                                               List <FairValueCompositionSummaryData> editedFairValueData)
        {
            List <FairValueCompositionSummaryData> result = null;

            try
            {
                if (entitySelectionData == null || editedFairValueData == null)
                {
                    return(null);
                }

                GreenField.DAL.GF_SECURITY_BASEVIEW data = GetSecurityDataForSelectedSecurity(entitySelectionData);

                if (data == null)
                {
                    return(null);
                }

                string securityId = Convert.ToString(data.SECURITY_ID);

                ExternalResearchEntities entity = new ExternalResearchEntities();
                UpdateSoureValues(ref editedFairValueData);
                XDocument doc = GetEntityXml <FairValueCompositionSummaryData>(editedFairValueData);

                var updatedResultSet = entity.SaveUpdatedFairValueMeasures(securityId, doc.ToString()).ToList();

                if (updatedResultSet != null)
                {
                    result = new List <FairValueCompositionSummaryData>();
                    foreach (GetFairValueComposition_Result record in updatedResultSet)
                    {
                        FairValueCompositionSummaryData item = new FairValueCompositionSummaryData();
                        if (!String.IsNullOrEmpty(record.SOURCE))
                        {
                            if (record.SOURCE.ToUpper() == "PRIMARY")
                            {
                                item.Source = "Primary Analyst";
                            }
                            else
                            {
                                if (record.SOURCE.ToUpper() == "INDUSTRY")
                                {
                                    item.Source = "Industry Analyst";
                                }
                                else
                                {
                                    item.Source = record.SOURCE;
                                }
                            }
                        }
                        item.Measure = record.MEASURE;
                        item.Buy     = record.BUY;
                        item.Sell    = record.SELL;
                        item.Upside  = record.UPSIDE;
                        if (record.DATE != null)
                        {
                            item.Date = record.DATE.Value;
                        }
                        item.DataId          = record.DATA_ID;
                        item.PrimaryAnalyst  = data.ASHMOREEMM_PRIMARY_ANALYST;
                        item.IndustryAnalyst = data.ASHMOREEMM_INDUSTRY_ANALYST;

                        result.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }

            return(result);
        }
Exemple #29
0
        private GreenField.DAL.GF_SECURITY_BASEVIEW GetSecurityDataForSelectedSecurity(EntitySelectionData entitySelectionData)
        {
            DimensionEntities entity = DimensionEntity;

            /*bool isServiceUp;
             * isServiceUp = CheckServiceAvailability.ServiceAvailability();
             *
             * if (!isServiceUp)
             *  throw new Exception("Services are not available");*/
            //Retrieving data from security view
            GreenField.DAL.GF_SECURITY_BASEVIEW data = entity.GF_SECURITY_BASEVIEW
                                                       .Where(record => record.TICKER == entitySelectionData.ShortName &&
                                                              record.ISSUE_NAME == entitySelectionData.LongName &&
                                                              record.ASEC_SEC_SHORT_NAME == entitySelectionData.InstrumentID &&
                                                              record.SECURITY_TYPE == entitySelectionData.SecurityType)
                                                       .FirstOrDefault();

            if (data == null)
            {
                return(null);
            }
            else
            {
                return(data);
            }
        }
Exemple #30
0
        public FairValueCompositionSummaryData RetrieveFairValueDataWithNewUpside(EntitySelectionData entitySelectionData,
                                                                                  FairValueCompositionSummaryData editedFairValueData)
        {
            FairValueCompositionSummaryData result = null;
            decimal upsideValue = 0;

            try
            {
                if (entitySelectionData == null || editedFairValueData == null)
                {
                    return(null);
                }

                if (entitySelectionData == null)
                {
                    return(null);
                }

                //retrieving data from security view
                GreenField.DAL.GF_SECURITY_BASEVIEW data = GetSecurityDataForSelectedSecurity(entitySelectionData);

                if (data == null)
                {
                    return(null);
                }

                string securityId = Convert.ToString(data.SECURITY_ID);
                int?   dataId     = editedFairValueData.DataId;
                string dataSource = editedFairValueData.Source;

                ExternalResearchEntities entity = new ExternalResearchEntities();

                decimal?amountValue = entity.GetAmountForUpsideCalculation(securityId, dataId, dataSource).FirstOrDefault();

                if (amountValue != null)
                {
                    if (amountValue == 0 || editedFairValueData.Sell == null)
                    {
                        upsideValue = 0;
                    }
                    else
                    {
                        if (dataId != null && dataId != 236)
                        {
                            upsideValue = (decimal)(editedFairValueData.Sell / amountValue) - 1;
                        }
                        else
                        {
                            if (editedFairValueData.Sell != 0)
                            {
                                upsideValue = (decimal)(amountValue / (editedFairValueData.Sell / 100)) - 1;
                            }
                        }
                    }
                }

                result = GetFairValueSummary(editedFairValueData, upsideValue);
            }
            catch (Exception ex)
            {
                ExceptionTrace.LogException(ex);
                string networkFaultMessage = ServiceFaultResourceManager.GetString("NetworkFault").ToString();
                throw new FaultException <ServiceFault>(new ServiceFault(networkFaultMessage), new FaultReason(ex.Message));
            }

            return(result);
        }