private void DeleteNotificaion(FeedMessage msg)
        {
            dsFeed.NotificaiontsRow dr = m_dsFeed.Notificaionts.FindByCode(msg.Code);
            if (dr != null)
            {
                m_dsFeed.Notificaionts.RemoveNotificaiontsRow(dr);

                m_dsFeed.AcceptChanges();
            }
            //    dataGridNotificaions.Refresh();
        }
        private void AddNewNotificaion(FeedMessage msg)
        {
            dsFeed.NotificaiontsRow dr = m_dsFeed.Notificaionts.NewNotificaiontsRow();
            foreach (string columnName in msg.DataItems.Keys)
            {
                string value = msg.DataItems[columnName];
                dr[columnName] = value;
            }
            dr.Code = msg.Code;
            m_dsFeed.Notificaionts.AddNotificaiontsRow(dr);
            m_dsFeed.AcceptChanges();

            //  dataGridNotificaions.Refresh();
        }
        private void _HandleFeedMessage(FeedMessage msg)
        {
            try
            {
                dsFeed.NotificaiontsRow dr = m_dsFeed.Notificaionts.NewNotificaiontsRow();
                foreach (string columnName in msg.DataItems.Keys)
                {
                    string value = msg.DataItems[columnName];
                    dr[columnName] = value;
                }

                m_dsFeed.Notificaionts.AddNotificaiontsRow(dr);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.ToString());
            }
        }
        private void UpdateNotificaion(FeedMessage msg)
        {
            dsFeed.NotificaiontsRow dr = m_dsFeed.Notificaionts.FindByCode(msg.Code);
            if (dr != null)
            {
                dr.BeginEdit();

                foreach (string columnName in msg.DataItems.Keys)
                {
                    string value = msg.DataItems[columnName];
                    dr[columnName] = value;
                }


                dr.EndEdit();

                m_dsFeed.AcceptChanges();

                //   dataGridNotificaions.Refresh();
            }
        }
Beispiel #5
0
        //private void ProcessMarketPriceTable(string code, IUpdateInfo updateInfo)
        //{
        //    try
        //    {
        //        string subCode = updateInfo.GetNewValue(1); // subscriptionCode
        //        string receivedcode = updateInfo.GetNewValue(2); //Cdoe
        //        string LastPrice = updateInfo.GetNewValue(3); // lastPrice
        //        string Quantity = updateInfo.GetNewValue(4); //Quantity
        //        string RecSerial = updateInfo.GetNewValue(5);//RecSerial

        //     //   dsFeed.MarketPriceRow drMP = m_dsFeed.MarketPrice.FindByCode(code);

        //        if(drMP == null)
        //        {
        //            m_dsFeed.MarketPrice.AddMarketPriceRow(subCode, code, LastPrice, Quantity, RecSerial);
        //        }
        //        else
        //        {
        //            drMP.BeginEdit();
        //            drMP.SubscriptionCode = subCode;
        //            drMP.LastPrice = LastPrice;
        //            drMP.Quantity = Quantity;
        //            drMP.RecSerial = RecSerial;


        //            drMP.EndEdit();

        //            drMP.Table.AcceptChanges();
        //        }



        //    }
        //    catch(Exception exp)
        //    {
        //        MessageBox.Show(exp.ToString());
        //    }
        //}


        private void UpdateNotificaionTable(UpdateMessage updateMsg)
        {
            try
            {
                string EventIFANotificationID                = updateMsg.UpdateInfo.GetNewValue(1);
                string EventMessageID                        = updateMsg.UpdateInfo.GetNewValue(2);
                string EventIFANotificationBody              = updateMsg.UpdateInfo.GetNewValue(3);
                string EventIFANotificationTitle             = updateMsg.UpdateInfo.GetNewValue(4);
                string EventIFASubscriberID                  = updateMsg.UpdateInfo.GetNewValue(5);
                string EventIFASubscriberNotificationAddress = updateMsg.UpdateInfo.GetNewValue(6);
                string _EventMessagesStatusID                = updateMsg.UpdateInfo.GetNewValue(7);
                string ParentEventMessageID                  = updateMsg.UpdateInfo.GetNewValue(8);
                string ExpiryDate                = updateMsg.UpdateInfo.GetNewValue(9);
                string EventMessageStatus        = updateMsg.UpdateInfo.GetNewValue(10);
                string FirstParentEventmessageID = updateMsg.UpdateInfo.GetNewValue(11);



                dsFeed.NotificaiontsRow dr = m_dsFeed.Notificaionts.NewNotificaiontsRow();
                dr.EventIFANotificationID                = EventIFANotificationID;
                dr.EventMessageID                        = EventMessageID;
                dr.EventIFANotificationBody              = EventIFANotificationBody;
                dr.EventIFANotificationTitle             = EventIFANotificationTitle;
                dr.EventIFASubscriberID                  = EventIFASubscriberID;
                dr.EventIFASubscriberNotificationAddress = EventIFASubscriberNotificationAddress;
                dr._EventMessagesStatusID                = _EventMessagesStatusID;
                dr.ParentEventMessageID                  = ParentEventMessageID;
                dr.ExpiryDate                = ExpiryDate;
                dr.EventMessageStatus        = EventMessageStatus;
                dr.FirstParentEventmessageID = FirstParentEventmessageID;

                m_dsFeed.Notificaionts.AddNotificaiontsRow(dr);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.ToString());
            }
        }