Esempio n. 1
0
        private void btn_RoomEdit_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection r = fllaypn_RoomSwitchPage.SelectedRows;

            if (r.Count == 1)
            {
                if ((bool)r[0].Cells["RoomActiveflag"].Value == true)
                {
                    HotelManagement.View.Form_Detail_Room f = new HotelManagement.View.Form_Detail_Room(int.Parse(r[0].Cells["IdRoom"].Value.ToString()), true);
                    this.Hide();
                    f.myDel = new HotelManagement.View.Form_Detail_Room.MyDel(ReloadRoomData);
                    f.ShowDialog();
                    this.Show();
                }
                else
                {
                    MessageBox.Show("Can't update inactive room!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (r.Count == 0)
            {
                MessageBox.Show("Bạn chưa chọn phòng để cập nhật!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MessageBox.Show("Chỉ có thể chọn một phòng trong một lần cập nhật!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
 private void btn_RoomAdd_Click(object sender, EventArgs e)
 {
     HotelManagement.View.Form_Detail_Room f = new HotelManagement.View.Form_Detail_Room(0, true);
     this.Hide();
     f.myDel = new HotelManagement.View.Form_Detail_Room.MyDel(ReloadRoomData);
     f.ShowDialog();
     this.Show();
 }