示例#1
0
        private void btnPrevious_Click(object sender, EventArgs e)
        {
            List <HandView> listHandView   = new List <HandView>();
            HandView        handViewGetter = new HandView();

            handViewGetter.IDSession = this.IDSession;
            listHandView             = handViewGetter.GetAllHands(Convert.ToInt32(this.txtPage.Text) - 1, Convert.ToInt32(cboPlayer.SelectedValue), this.txtFilteredHands.Text);

            this.dataGridView1.Rows.Clear();

            this.dataGridView1.Columns[1].Width = 60;
            this.dataGridView1.Columns[2].Width = 60;
            int counter = 0;

            foreach (HandView handView in listHandView)
            {
                this.dataGridView1.Rows.Add(handView.IDHand.ToString(),
                                            new Bitmap(Image.FromFile(@"Images\" + handView.CardOne + ".jpg"), 60, 80),
                                            new Bitmap(Image.FromFile(@"Images\" + handView.CardTwo + ".jpg"), 60, 80),
                                            handView.NetWon);
                this.dataGridView1.Rows[counter].Height = 80;

                counter++;
            }

            this.txtPage.Text        = (Convert.ToInt32(this.txtPage.Text) - 1).ToString();
            this.btnFirst.Enabled    = (this.txtPage.Text != "1");
            this.btnNext.Enabled     = true;
            this.btnPrevious.Enabled = btnFirst.Enabled;
            this.btnLast.Enabled     = true;
        }
示例#2
0
        private void btnHands_Click(object sender, EventArgs e)
        {
            List <HandView> listHandView   = new List <HandView>();
            HandView        handViewGetter = new HandView();
            List <Players>  listPlayers    = new List <Players>();
            Players         playersGettter = new Players();

            frmHands frmhands = new frmHands();

            int heroIdPlayer = playersGettter.GetHeroID(0);

            listPlayers = playersGettter.GetPlayersSession(0);
            frmhands.cboPlayer.DataSource    = listPlayers;
            frmhands.cboPlayer.ValueMember   = "IDPlayer";
            frmhands.cboPlayer.DisplayMember = "Nickname";
            frmhands.cboPlayer.SelectedValue = heroIdPlayer;

            listHandView = handViewGetter.GetAllHands(1, heroIdPlayer, "");

            frmhands.dataGridView1.Columns[1].Width = 60;
            frmhands.dataGridView1.Columns[2].Width = 60;
            int counter = 0;

            foreach (HandView handView in listHandView)
            {
                frmhands.dataGridView1.Rows.Add(handView.IDHand.ToString(),
                                                new Bitmap(Image.FromFile(@"Images\" + handView.CardOne + ".jpg"), 60, 80),
                                                new Bitmap(Image.FromFile(@"Images\" + handView.CardTwo + ".jpg"), 60, 80),
                                                handView.NetWon);
                frmhands.dataGridView1.Rows[counter].Height = 80;

                counter++;
            }

            frmhands.txtMaxPages.Text    = handViewGetter.GetMaxPages(heroIdPlayer).ToString();
            frmhands.txtPage.Text        = "1";
            frmhands.btnFirst.Enabled    = false;
            frmhands.btnPrevious.Enabled = false;
            frmhands.btnNext.Enabled     = (Convert.ToInt32(frmhands.txtMaxPages.Text) > 1);
            frmhands.btnLast.Enabled     = frmhands.btnNext.Enabled;
            frmhands.Show();
        }