Пример #1
0
        private void InitialzesContents()
        {
            objListViewBet.SetObjects(lotteryDataServices.GetLottoBetsByDrawDate(betDateTime));
            this.olvColDrawDate.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum1.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum2.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum3.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum4.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum5.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.olvColNum6.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
            this.drawResult = lotteryDataServices.GetLotteryDrawResultByDrawDate(this.betDateTime);

            //Print the draw result
            if (this.drawResult == null)
            {
                GenerateResultPanels(GetBlankSequence(), tblLyPnlDrawResult, groupBoxDrawResult.ForeColor);
            }
            else
            {
                GenerateResultPanels(this.drawResult.GetAllNumberSequenceSorted(), tblLyPnlDrawResult, groupBoxDrawResult.ForeColor);
            }

            //print your first bet
            if (objListViewBet.GetItemCount() > 0)
            {
                if (this.betIdDefault > 0)
                {
                    foreach (LotteryBet bet in objListViewBet.Objects)
                    {
                        if (bet.GetId() == this.betIdDefault)
                        {
                            GenerateResultPanels(bet.GetAllNumberSequenceSorted(), tblLyPnlBet, groupBoxYourBet.ForeColor);
                            objListViewBet.SelectedIndex = objListViewBet.IndexOf(bet);
                            break;
                        }
                    }
                }
                else
                {
                    LotteryBet bet = (LotteryBet)objListViewBet.GetModelObject(0);
                    GenerateResultPanels(bet.GetAllNumberSequenceSorted(), tblLyPnlBet, groupBoxYourBet.ForeColor);
                    objListViewBet.SelectedIndex = 0;
                }
            }
            else
            {
                GenerateResultPanels(GetBlankSequence(), tblLyPnlBet, groupBoxYourBet.ForeColor);
            }
            MatchMaking();
        }