예제 #1
0
        public override void Process(IDroneDataComponent component)
        {
            PortfolioDataComponent smbComponent = component as PortfolioDataComponent;

            if (!Object.Equals(smbComponent, null))
            {
                AddPortfolioToBulk(smbComponent.PortfolioType);
            }
        }
예제 #2
0
        public override void ProcessMessage(object sender, MessageEventArgs args)
        {
            bool   handled = false;
            string msg     = string.Empty;

            try
            {
                msg = Encoding.UTF8.GetString(args.Message.BodyStream.ToByteArray());

                PortfolioDataType ms = Utility.DeserializeXMLString <PortfolioDataType>(msg);

                if (!Object.Equals(ms, null))
                {
                    WriteToUsageLogFile("PortfolioDataType:" + ms.ToString(), string.Format("Executing {0}.{1}", ProcessorName, MethodInfo.GetCurrentMethod().Name), true);
                    PortfolioDataComponent dc = new PortfolioDataComponent();
                    dc.PortfolioType = ms;

                    handled = true;
                    FireMessageProcessingEvent();
                    QueueComponentDataSource.Process(dc);
                    FireMessageProcessedEvent();
                }

                ms = null;
            }
            catch (Exception e)
            {
                ExceptionExtensions.LogError(e, "QueuePortfolio.ProcessMessage", "Msg to process: " + msg);

                if (Utility.IsCriticalDBError(e))
                {
                    FireShuttingDownEvent();
                }

                if (handled)
                {
                    FireMessageProcessedEvent();
                }
            }
        }