예제 #1
0
        //编辑手牌
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int r = dgv.CurrentCell.RowIndex;
            int c = dgv.CurrentCell.ColumnIndex;

            var seat = db.Seat.FirstOrDefault(x => x.text == dgv.CurrentRow.Cells[0].Value.ToString());

            SeatForm editSeat = new SeatForm(db, seat, this);

            if (editSeat.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
                dgv.CurrentCell = dgv[c, r];
            }
        }
예제 #2
0
 //新增手牌
 private void addTool_Click(object sender, EventArgs e)
 {
     SeatForm addSeat = new SeatForm(db, null, this);
     addSeat.ShowDialog();
 }
예제 #3
0
        //新增手牌
        private void addTool_Click(object sender, EventArgs e)
        {
            SeatForm addSeat = new SeatForm(db, null, this);

            addSeat.ShowDialog();
        }
예제 #4
0
        //编辑手牌
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int r = dgv.CurrentCell.RowIndex;
            int c = dgv.CurrentCell.ColumnIndex;

            var seat = db.Seat.FirstOrDefault(x => x.text == dgv.CurrentRow.Cells[0].Value.ToString());

            SeatForm editSeat = new SeatForm(db, seat, this);
            if (editSeat.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
                dgv.CurrentCell = dgv[c, r];
            }
        }