Example #1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddRoom frm = new AddRoom(SelectedRoom);

            frm.ShowDialog();
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = HotelRepository.rooms;
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddRoom frm = new AddRoom();

            frm.ShowDialog();
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = HotelRepository.rooms;
        }
Example #3
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         Room    room = (Room)dataGridView1.SelectedRows[0].DataBoundItem;
         AddRoom frm  = new AddRoom(room);
         frm.ShowDialog();
         dataGridView1.DataSource = null;
         dataGridView1.DataSource = HotelRepository.rooms;
     }
     else
     {
         MessageBox.Show("Select Row!");
     }
 }