private void button1_Click(object sender, EventArgs e) { XtraReport1 report = new XtraReport1(); //// Add bounded labels to the Detail band of the report. report._bindData(); report._group(); report.DataSource = NhanVienPT.getAll(); ReportPrintTool printTool = new ReportPrintTool(report); printTool.ShowRibbonPreview(); }
// Load dữ liệu public void loadData() { try { //load layout layout.load(gridViewPhong); canAdd = Permission.canAdd <Phong>(); listVitris = ViTriHienThi.getAll().ToList(); _ucTreeViTri.loadData(listVitris); _ucComboBoxViTri.DataSource = listVitris; _ViTriHienTai = _ucTreeViTri.getVitri(); listPhong = PhongHienThi.getPhongByViTri(_ViTriHienTai.coso != null ? _ViTriHienTai.coso.id : Guid.Empty, _ViTriHienTai.day != null ? _ViTriHienTai.day.id : Guid.Empty, _ViTriHienTai.tang != null ? _ViTriHienTai.tang.id : Guid.Empty); gridControlPhong.DataSource = listPhong; if (listPhong.Count() == 0) { deleteData(); enableEdit(false); enableBar(false); } else { getThongTinPhong(true); enableEdit(false); enableBar(true); } listNhanVienPT = NhanVienPT.getAll(); NhanVienPT NhanVienPTNULL = new NhanVienPT(); NhanVienPTNULL.hoten = "[Không có]"; NhanVienPTNULL.id = Guid.Empty; listNhanVienPT.Insert(0, NhanVienPTNULL); searchLookUpEditNhanVienPT.Properties.DataSource = listNhanVienPT; } catch (Exception ex) { Debug.WriteLine(this.Name + "->loadData: " + ex.Message); } }