private void TimKiem(string kitu) { _panelData = new Panel(); _panelData.Location = new Point(150, 85); _panelData.Size = new Size(465, 419); _panelData.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; _panelData.AutoScroll = true; _panelData.AutoScrollMargin = new Size(0, 25); if (kitu != "") { _dataPhong = _phongBUS.LayDanhSachPhongTheoIdPhong(kitu, _dataPhong); } else { this.Controls.Remove(_panelData); LoadData(state); } int x = 25; int y = 20; for (int i = 0; i < _dataPhong.Count; i++) { //x = x + 120; Color c = Color.White; string s = _dataPhong[i].TrangThai.Normalize(NormalizationForm.FormC); if (s == "Còn Trống".Normalize(NormalizationForm.FormC)) { c = Color.Wheat; } else { if (s == "Đang Sử Dụng".Normalize(NormalizationForm.FormC)) { c = Color.Yellow; } else { if (s == "Đang Bảo Trì".Normalize(NormalizationForm.FormC)) { c = Color.Gray; } } } if (x > 450) { x = 25; y = y + 145; } _panelData.Controls.Add(DrawPanel(new Point(x, y), c, _dataPhong[i].TenPhong, _dataPhong[i].TrangThai, _dataPhong[i].IdPhong, Properties.Resources.startrom5)); x += 145; } this.Controls.Add(_panelData); }