Ejemplo n.º 1
0
Archivo: MainFrm.cs Proyecto: BFMS/BFMS
 private void UpdateMarket(object state)
 {
     Market market = (Market)state;
     if (editorPane1.TabPages.ContainsKey(market.MarketId))
     {
         TabPage tp = editorPane1.TabPages[market.MarketId];
         if (editorPane1.SelectedTab == tp && tp.Controls.Count > 0)
         {
             Market ma = new Market();
             markets.TryGetValue(market.MarketId, out ma);
             ma.Copy(market);
             //((DataGridView)tp.Controls["MarketDGV"]).Update();
             ((DataGridView)tp.Controls["MarketDGV"]).Refresh();
             RefreshMarketHeader((StatusStrip)tp.Controls["statusStrip2"], ma);
         }
     }
 }
Ejemplo n.º 2
0
Archivo: MainFrm.cs Proyecto: BFMS/BFMS
        private void EventDGV_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            MarketCatalogue mc = (MarketCatalogue)((DataGridView)sender).SelectedRows[0].DataBoundItem;
            if (!editorPane1.TabPages.ContainsKey(mc.MarketId))
            {
                TabPage newTabPage;
                if (editorPane1.TabCount == 1 && tabPage1.Name == "tabPage1")
                {
                    tabPage1.Name = mc.MarketId;
                    tabPage1.Text = mc.Event.Venue + " " + mc.LocalStartTimeHM;
                    newTabPage = tabPage1;
                }
                else
                {
                    newTabPage = new TabPage(mc.Event.Venue + " " + mc.LocalStartTimeHM);
                    newTabPage.Name = mc.MarketId;
                    editorPane1.TabPages.Add(newTabPage);
                }
                DataGridView dgv = new DataGridView();
                InitMarketDGV(dgv);
                newTabPage.Controls.Add(dgv);
                newTabPage.Controls.Add(InitMarketHeader());

                RichTextBox rtb = new RichTextBox();
                rtb.Size = editorPane1.Size;
                rtb.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
                editorPane1.TabPages[editorPane1.TabPages.Count - 1].Controls.Add(rtb);
                editorPane1.SelectTab(editorPane1.TabPages.Count - 1);

                //MarketBook mb = service.GetMarketBook(mc.MarketId);
                MarketBook mb = new MarketBook();
                //MarketBook mb = ((List<MarketBook>)Util.DeserializeObj("BFMS.marketBooks" + ((DataGridView)sender).SelectedRows[0].Index + 0)).Find(c => c.MarketId == mc.MarketId);
                mb.marketCatalogue = mc;
                if (Config.ServiceMode == Config.Mode.DB)
                {
                    mc.Runners = dba.GetRunnerDesc(mc.MarketId);
                }
                Market market = new Market(mc);
                markets.Add(market.MarketId, market);

                dgv.DataSource = market;
                dgv.CurrentCell = null;
                marketUpdate.AddMarket(mc);
            }
            else
            {
                editorPane1.SelectTab(mc.MarketId);
            }
        }
Ejemplo n.º 3
0
Archivo: MainFrm.cs Proyecto: BFMS/BFMS
        private void RefreshMarketHeader(StatusStrip sstrip, Market market)
        {
            int nrNonRunners = market.NumberOfRunners - market.NumberOfActiveRunners;
            string nonRunners = nrNonRunners > 0 ? nrNonRunners + " NS" : "";
            ((ToolStrip)sstrip).Items[0].Text = String.Format("{0,5}", market.RefreshNr) + " | " + market.LocalStartTime.Date.ToString("dd.MM") + " " + market.EventName + " " +
                market.LocalStartTime.ToString("HH:mm") + "   " + market.Name + "   " + market.Type +
                "   Umsatz: " + market.TotalMatched.ToString("C");

            ((ToolStrip)sstrip).Items[1].Text = "     OVR:" + String.Format("{0,5}", market.Ovr) + "   Starter: " + market.NumberOfRunners + " " + nonRunners + "     Status: " + market.Status;
        }
Ejemplo n.º 4
0
Archivo: Market.cs Proyecto: BFMS/BFMS
 public void Copy(Market market)
 {
     marketCatalogue = market.marketCatalogue;
     MarketId = market.MarketId;
     RefreshNr = market.RefreshNr;
     Ovr = market.Ovr;
     Status = market.IsInplay && "OPEN".Equals(market.Status) ? "IN_PLAY" : market.Status.ToString();
     IsInplay = market.IsInplay;
     EventName = market.marketCatalogue.Event.Venue;
     Name = market.marketCatalogue.MarketName;
     Type = market.marketCatalogue.Description.MarketType;
     LocalStartDate = market.marketCatalogue.LocalStartTime.Date;
     LocalStartTime = market.marketCatalogue.LocalStartTime;
     NumberOfWinners = market.NumberOfWinners;
     NumberOfRunners = market.NumberOfRunners;
     NumberOfActiveRunners = market.NumberOfActiveRunners;
     TotalMatched = market.TotalMatched;
     List<MarketItem> nonRunners = new List<MarketItem>();
     foreach (MarketItem item in Runners)
     {
         MarketItem mi = market.Runners.Find(c => c.SelectionId == item.SelectionId);
         if (mi == null)
         {//Teilnehmer furde zurückgezogen ->Nichtstarter
             item.Status = RunnerStatus.REMOVED;
             item.LastPriceTraded = 0;
             item.Matched = 0;
             item.TotalMatched = 0;
             item.VolumeBack = 0;
             item.VolumeLay = 0;
             item.InsMoneyBack = 0;
             item.InsMoneyLay = 0;
             item.RelativeExposure = 0;
             item.AvgOdds = 0;
             item.Indikator1 = 0;
             item.Indikator2 = 0;
             nonRunners.Add(item);
         }
         else
         {
             item.SelectionId = mi.SelectionId;
             item.Status = mi.Status;
             item.LastPriceTraded = mi.LastPriceTraded;
             item.Matched = mi.Matched;
             item.TotalMatched = mi.TotalMatched;
             item.VolumeBack = mi.VolumeBack;
             item.VolumeLay = mi.VolumeLay;
             item.InsMoneyBack = mi.InsMoneyBack;
             item.InsMoneyLay = mi.InsMoneyLay;
             item.RelativeExposure = mi.RelativeExposure;
             item.AvgOdds = mi.AvgOdds;
             item.Indikator1 = mi.Indikator1;
             item.Indikator2 = mi.Indikator2;
         }
     }
     if (nonRunners.Count > 0)
     {
         foreach (MarketItem item in nonRunners)
         {
             Runners.Remove(item);
             Runners.Add(item);
         }
     }
 }