示例#1
0
 private void btnEditRoom_Click(object sender, EventArgs e)
 {
     if (gridRoom.RowCount > 0)
     {
         DataRow row = gridRoom.GetDataRow(gridRoom.GetSelectedRows()[0]);
         EditRoom.oldInfo = row;
         EditRoom edit = new EditRoom();
         edit.ShowDialog();
         dgvListRoom.DataSource = Room_BUS.ListRoom();
     }
     else
     {
         MessageBox.Show("Error!", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
示例#2
0
 private void btnDeleteRoom_Click(object sender, EventArgs e)
 {
     if (gridRoom.RowCount > 0)
     {
         DataRow      row          = gridRoom.GetDataRow(gridRoom.GetSelectedRows()[0]);
         DialogResult dialogResult = MessageBox.Show("Are you sure?", "Delete room", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             Room_BUS.DeleteRoom(row["IDRoom"].ToString());
             MessageBox.Show("Room was deleted", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         dgvListRoom.DataSource = Room_BUS.ListRoom();
     }
     else
     {
         MessageBox.Show("Error!", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
示例#3
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     dgvListRoom.DataSource = Room_BUS.ListRoom();
 }
示例#4
0
 private void ListRoom_Load(object sender, EventArgs e)
 {
     dgvListRoom.DataSource = Room_BUS.ListRoom();
 }