Example #1
0
 /**
   * @desc Executes when "Add Room" button is clicked
   * It loads in an empty frm_room form for adding new room
   * @params [none] No input parameter.
   * @return [none] No directly returned data.
   */
 private void button_addroom_Click(object sender, EventArgs e)
 {
     frm_room frmRoom = new frm_room(this);
     frmRoom.ShowDialog();
 }
Example #2
0
 /**
   * @desc Executes when a grid cell is double clicked on the room list
   * It loads in the room belonging to the cell for editing
   * @params [none] No input parameter.
   * @return [none] No directly returned data.
   */
 private void dg_rooms_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         // Get the room id at current cell
         int id_room = int.Parse(dg_rooms.Rows[e.RowIndex].Cells[0].Value.ToString());
         // Create an edit room form
         frm_room frmRoom = new frm_room(id_room, this);
         frmRoom.ShowDialog();
     }
     catch (Exception ea)
     {
         MessageBox.Show(ea.ToString());
         return;
     }
 }