예제 #1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            RoomStatus editRoom = new RoomStatus();

            this.Hide();

            RoomStatusEdit editform = new RoomStatusEdit(editRoom, 2);
            editform.Show();
        }
예제 #2
0
        private void btEdit_Click(object sender, EventArgs e)
        {
            if (gridRoomStatus.Rows.Count > 1)
            {
                rowIndex = this.gridRoomStatus.CurrentCell.RowIndex;

                if ((rowIndex < gridRoomStatus.RowCount - 1) && (rowIndex >= 0))
                {
                    RoomStatus editRoom = new RoomStatus();

                    editRoom.Id = gridRoomStatus.Rows[rowIndex].Cells[0].Value.ToString();
                    editRoom.Name = this.tbName.Text;

                    RoomStatusEdit editform = new RoomStatusEdit(editRoom, 1);
                    editform.Show();

                    this.Hide();
                }
            }else
             {
                 MessageBox.Show("No row Selected!");
             }
        }