private void btnThemPhong_Click(object sender, EventArgs e) { frmTextPhong frm = new frmTextPhong(this, "Thêm Phòng"); frm.ShowDialog(); listP = pBus.getallphong(); gclDSP.DataSource = listP; }
private void btnSua_Click(object sender, EventArgs e) { List <ePhong> ls = new List <ePhong>(); if (gridViewPhong.SelectedRowsCount == 1) { PhongBUS ph_bus = new PhongBUS(); string id = gridViewPhong.GetRowCellValue(gridViewPhong.FocusedRowHandle, gridViewPhong.Columns[0]).ToString(); frmTextPhong ftph = new frmTextPhong(this, "Sửa Phòng", id.ToString()); ftph.ShowDialog(); } else { MessageBox.Show("Chọn 1 Phòng Cần Sửa", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); return; } ls = pBus.getallphong(); gclDSP.DataSource = ls; }