private void btnNhanVien_Click(object sender, EventArgs e) { this.pnlMain.Controls.Clear(); nhanvien = new UCNhanVien(); this.pnlMain.Controls.Add(nhanvien); nhanvien.Dock = DockStyle.Fill; nhanvien.NeedReload += new EventHandler(btnNhanVien_Click); }
private void btnNhanVien_Click(object sender, EventArgs e) { ClearRenderbody(); UCNhanVien uCNhanVien = new UCNhanVien(); uCNhanVien.TopLevel = false; uCNhanVien.Width = pnlFill.Width; uCNhanVien.Height = pnlFill.Height; uCNhanVien.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; pnlFill.Controls.Add(uCNhanVien); uCNhanVien.Show(); }
public Main() { InitializeComponent(); ucPhieuXuat = new UCPhieuXuat(); ucNhanVien = new UCNhanVien(); ucHangHoa = new UCHangHoa(); ucNhomHang = new UCNhomHang(); ucCuaHang = new UCCuaHang(); ucNhaCungCap = new UCNhaCungCap(); ucPhieuNhap = new UCPhieuNhap(); ucThongKeHoaDon = new UCThongKeHoaDon(); }
private void btnNhanVien_Click(object sender, EventArgs e) { UCNhanVien uCNhanVien = new UCNhanVien(); addtab("Nhân Viên", uCNhanVien); }
public void AddTabPages(string nameOfTab, int select) { XtraTabPage tabPage = new XtraTabPage(); tabPage.Text = nameOfTab; if (ExitsTabpages(tabPage.Text) == false) { tabstatic.TabPages.Add(tabPage); } else { tabPage.PageVisible = true; } //ví dụ muốn add 1 UC switch (select) { case (int)EnumUCDanhMuc.UCNhatKyHoatDong: UCNhatKyHoatDong uc = new UCNhatKyHoatDong(); tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uc); uc.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCDanToc: UCDanToc uCDanToc = new UCDanToc(); uCDanToc.Tag = "Dân tộc"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCDanToc); uCDanToc.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCDayNha: UCDayNha ucDayNha = new UCDayNha(); ucDayNha.Tag = "Dãy nhà"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(ucDayNha); ucDayNha.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCDonVi: UCDonVi uCDonVi = new UCDonVi(); uCDonVi.Tag = "Đơn vị"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCDonVi); uCDonVi.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCLoaiDoiTuong: UCLoaiDoiTuong uCLoaiDoiTuong = new UCLoaiDoiTuong(); uCLoaiDoiTuong.Tag = "Loại đối tượng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCLoaiDoiTuong); uCLoaiDoiTuong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCLoaiPhong: UCLoaiPhong uCLoaiPhong = new UCLoaiPhong(); uCLoaiPhong.Tag = "Loại phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCLoaiPhong); uCLoaiPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCLoiViPham: UCLoiViPham uCLoiViPham = new UCLoiViPham(); uCLoiViPham.Tag = "Lỗi vi phạm"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCLoiViPham); uCLoiViPham.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCLop: UCLop uCLop = new UCLop(); uCLop.Tag = "Lớp"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCLop); uCLop.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Image = Properties.Resources.Classroom_50px; break; case (int)EnumUCDanhMuc.UCNguoiDung: UCNguoiDung uCNguoiDung = new UCNguoiDung(); uCNguoiDung.Tag = "Người dùng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCNguoiDung); uCNguoiDung.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCPhong: UCPhong uCPhong = new UCPhong(); uCPhong.Tag = "Phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCPhong); uCPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCQuocTich: UCQuocTich uCQuocTich = new UCQuocTich(); uCQuocTich.Tag = "Quốc tịch"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCQuocTich); uCQuocTich.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTinhThanh: UCTinhThanh uCTinhThanh = new UCTinhThanh(); uCTinhThanh.Tag = "Tỉnh thành"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTinhThanh); uCTinhThanh.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTonGiao: UCTonGiao uCTonGiao = new UCTonGiao(); uCTonGiao.Tag = "Tôn giáo"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTonGiao); uCTonGiao.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCVatTu: UCVatTu uCVatTu = new UCVatTu(); uCVatTu.Tag = "Vật tư"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCVatTu); uCVatTu.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCHoSo: UCHoSo uCHoSo = new UCHoSo(); uCHoSo.Tag = "Hồ sơ"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCHoSo); uCHoSo.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCPhanQuyen: UCPhanQuyen uCPhanQuyen = new UCPhanQuyen(); tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCPhanQuyen); uCPhanQuyen.LoadPhanQuyen += UCPhanQuyen_LoadPhanQuyen; uCPhanQuyen.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCThuTienPhong: UCThuTienPhong uCThuTienPhong = new UCThuTienPhong(); tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCThuTienPhong); uCThuTienPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCPhieuCapPhat: UCPhieuCapPhat uCPhieuCapPhat = new UCPhieuCapPhat(); uCPhieuCapPhat.Tag = "Yêu cầu cấp phát vật tư"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCPhieuCapPhat); uCPhieuCapPhat.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCCapPhat: UCCapPhat uCCapPhat = new UCCapPhat(); uCCapPhat.Tag = "Cấp phát thiết bị vật tư"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCCapPhat); uCCapPhat.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCXepPhong: UCXepPhong uCXepPhong = new UCXepPhong(); uCXepPhong.Tag = "Xếp phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCXepPhong); uCXepPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCKhenThuong_KyLuat: UCKhenThuong_KyLuat uCKhenThuong_KyLuat = new UCKhenThuong_KyLuat(); uCKhenThuong_KyLuat.Tag = "Khen thưởng, kỷ luật"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCKhenThuong_KyLuat); uCKhenThuong_KyLuat.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCHopDong: UCHopDong uCHopDong = new UCHopDong(); uCHopDong.Tag = "Hợp đồng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCHopDong); uCHopDong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKDonVi: UCTKDonVi uCTKDonVi = new UCTKDonVi(); uCTKDonVi.Tag = "Thống kê theo đơn vị"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKDonVi); uCTKDonVi.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKKhenThuongKyLuat: UCTKKhenThuongKyLuat uCTKKhenThuongKyLuat = new UCTKKhenThuongKyLuat(); uCTKKhenThuongKyLuat.Tag = "Thống kê khen thưởng, kỷ luật"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKKhenThuongKyLuat); uCTKKhenThuongKyLuat.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKThuTienPhong: UCTKThuTienPhong uCTKThuTienPhong = new UCTKThuTienPhong(); uCTKThuTienPhong.Tag = "Thống kê thu phí phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKThuTienPhong); uCTKThuTienPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKSinhVienTheoDSPhong: UCTKSinhVienTheoDSPhong uCTKSinhVienTheoDSPhong = new UCTKSinhVienTheoDSPhong(); uCTKSinhVienTheoDSPhong.Tag = "Thống kê theo danh sách phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKSinhVienTheoDSPhong); uCTKSinhVienTheoDSPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKLop: UCTKLop uCTK = new UCTKLop(); uCTK.Tag = "Thống kê theo lớp"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTK); uCTK.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKThuTienSH: UCTKThuTienSH uCTKThuTienSH = new UCTKThuTienSH(); uCTKThuTienSH.Tag = "Thống kê phí sinh hoạt"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKThuTienSH); uCTKThuTienSH.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKVatTuHongTheoPhong: UCTKVatTuHongTheoPhong uCTKVatTuHongTheoPhong = new UCTKVatTuHongTheoPhong(); uCTKVatTuHongTheoPhong.Tag = "Vật tư hỏng theo phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKVatTuHongTheoPhong); uCTKVatTuHongTheoPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCTKVatTuTheoPhong: UCTKVatTuTheoPhong uCTKVatTuTheoPhong = new UCTKVatTuTheoPhong(); uCTKVatTuTheoPhong.Tag = "Vật tư theo phòng"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCTKVatTuTheoPhong); uCTKVatTuTheoPhong.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCThuTienSinhHoat: UCThuTienSinhHoat uCThuTienSinhHoat = new UCThuTienSinhHoat(); uCThuTienSinhHoat.Tag = "Thu tiền sinh hoạt"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCThuTienSinhHoat); uCThuTienSinhHoat.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCNhanVien: UCNhanVien uCNhanVien = new UCNhanVien(); tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCNhanVien); uCNhanVien.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCPhieuChi_HoanTra: UCPhieuChi_HoanTra uCPhieuChi_HoanTra = new UCPhieuChi_HoanTra(); uCPhieuChi_HoanTra.Tag = "Chi - Hoàn trả"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCPhieuChi_HoanTra); uCPhieuChi_HoanTra.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; case (int)EnumUCDanhMuc.UCPhieuBaoHongSuaChua: UCPhieuBaoHongSuaChua uCPhieuBaoHongSuaChua = new UCPhieuBaoHongSuaChua(); uCPhieuBaoHongSuaChua.Tag = "Yêu cầu sửa chữa thiết bị vật tư"; tabstatic.TabPages[IndexOfTabPage(tabPage.Text)].Controls.Add(uCPhieuBaoHongSuaChua); uCPhieuBaoHongSuaChua.Dock = DockStyle.Fill; tabstatic.SelectedTabPage = tabstatic.TabPages[IndexOfTabPage(tabPage.Text)]; break; default: break; } }