예제 #1
0
        public AddBetInHistory(int EventId, string WinnerTeam)
        {
            InitializeComponent();
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            txtEventId.Text       = EventId.ToString();
            txtWinnerTeam.Text    = WinnerTeam;

            List <WcfService.Model.EventBet> eventL = new List <WcfService.Model.EventBet>();

            WcfService.Model.EventBet e = new WcfService.Model.EventBet()
            {
                EventId = EventId
            };
            Service1Client service = new Service1Client();

            eventL.Add(service.GetEventHistory(e));

            txtTeam1.Text     = eventL[0].Team1;
            txtTeam1Coef.Text = eventL[0].Team1Coef.ToString();
            txtTeam2.Text     = eventL[0].Team2;
            txtTeam2Coef.Text = eventL[0].Team2Coef.ToString();
            txtDateEvent.Text = eventL[0].DateEvent.ToShortDateString();;
        }
예제 #2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            lblWinner.Visibility    = Visibility.Visible;
            cbWinner.Visibility     = Visibility.Visible;
            btnAddResult.Visibility = Visibility.Visible;
            txtEventId.IsReadOnly   = true;
            btnOk.Visibility        = Visibility.Hidden;

            if (txtEventId.Text != null)
            {
                List <WcfService.Model.EventBet> eventl = new List <WcfService.Model.EventBet>();
                WcfService.Model.EventBet        eb     = new WcfService.Model.EventBet()
                {
                    EventId = Convert.ToInt32(txtEventId.Text)
                };
                Service1Client service = new Service1Client();
                eventl.Add(service.GetEventCode(eb));

                cbWinner.Items.Add(eventl[0].Team1);
                cbWinner.Items.Add(eventl[0].Team2);
                service.Close();
            }
        }