コード例 #1
0
        //新增
        private void addTool_Click(object sender, EventArgs e)
        {
            RoomForm addRoom = new RoomForm(db, null, this);

            addRoom.ShowDialog();
            dgv_show();
        }
コード例 #2
0
        //编辑
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var room  = db.Room.FirstOrDefault(x => x.id == selId);

            RoomForm editRoom = new RoomForm(db, room, this);

            if (editRoom.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
コード例 #3
0
        //编辑
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var room = db.Room.FirstOrDefault(x => x.id == selId);

            RoomForm editRoom = new RoomForm(db, room, this);
            if (editRoom.ShowDialog() == DialogResult.OK)
                dgv_show();
        }
コード例 #4
0
 //新增
 private void addTool_Click(object sender, EventArgs e)
 {
     RoomForm addRoom = new RoomForm(db, null, this);
     addRoom.ShowDialog();
     dgv_show();
 }