//NÚT THIẾT LẬP private void btnThietLap_Click(object sender, RoutedEventArgs e) { FocusButon(6); ThietLapUPresentation frm = new ThietLapUPresentation(); frm._lstQuyen = _lstQuyen; frm.evChonChucNang += new EventHandler(evMoChucNang); gdContentMain.Children.Clear(); gdContentMain.Children.Add(frm); _menu = 4; btnBack.Visibility = System.Windows.Visibility.Collapsed; lbTitle.Visibility = System.Windows.Visibility.Collapsed; }
//Nút back private void btnBack_Click(object sender, RoutedEventArgs e) { switch (_menu) { case 0: //Giao diện bắt đầu BatDauUPresentation _wpfBatdau = new BatDauUPresentation(); _wpfBatdau._ChonChucNang += new EventHandler(ChonChucNang_WPFBatDau); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_wpfBatdau); break; case 1: //Trang chủ TrangChuUPresentation wpf_Home = new TrangChuUPresentation(); wpf_Home._lstQuyen = _lstQuyen; wpf_Home._ChonChucNang += new EventHandler(ChonChucNang_TrangChu); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_Home); break; case 2: //Kho KhoUPresentation wpf_kho = new KhoUPresentation(); wpf_kho._lstQuyen = _lstQuyen; wpf_kho._ChonChucNang += new EventHandler(ChonChucNang_KHO); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_kho); break; case 3: //Báo cáo ThongKeBaoCaoUPresentation wpf_baocao = new ThongKeBaoCaoUPresentation(); wpf_baocao._lstQuyen = _lstQuyen; wpf_baocao._ChonChucNang += new EventHandler(ChonChucNang_ThongKeBaoCao); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_baocao); break; case 4: //Thiết lập ThietLapUPresentation wpf_thietlap = new ThietLapUPresentation(); wpf_thietlap._lstQuyen = _lstQuyen; wpf_thietlap.evChonChucNang += new EventHandler(evMoChucNang); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_thietlap); break; } lbTitle.Visibility = System.Windows.Visibility.Collapsed; btnBack.Visibility = System.Windows.Visibility.Collapsed; }
//SỰ KIỆN MỞ FOMR CHỨC NĂNG - THIẾT LẬP void evMoChucNang(object sender, EventArgs e) { ThietLapUPresentation frm = (ThietLapUPresentation)sender; string ChucNang = frm.ChucNang; switch (ChucNang) { case "1": //Sản phẩm SanPhamUPresentation sp = new SanPhamUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(sp); lbTitle.Content = "QUẢN LÝ SẢN PHẨM"; break; case "2": //Nhóm sản phẩm NhomSanPhamUPresentation nsp = new NhomSanPhamUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(nsp); lbTitle.Content = "QUẢN LÝ NHÓM SẢN PHẨM"; break; case "3": //Đơn vị tính DonViTinhUPresentation dvt = new DonViTinhUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(dvt); lbTitle.Content = "QUẢN LÝ ĐƠN VỊ TÍNH"; break; case "4": //Nhà cung cấp NhaCungCapUPresentation ncc = new NhaCungCapUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(ncc); lbTitle.Content = "QUẢN LÝ NHÀ CUNG CẤP"; break; case "5": //Nhân viên NhanVienUPresentation nv = new NhanVienUPresentation(); nv._CapNhatHienThi += new EventHandler(CapNhatSuaNV_TL); gdContentMain.Children.Clear(); gdContentMain.Children.Add(nv); lbTitle.Content = "QUẢN LÝ NHÂN VIÊN"; break; case "6": //Khách hàng KhachHangUPresentation kh = new KhachHangUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(kh); lbTitle.Content = "QUẢN LÝ KHÁCH HÀNG"; break; case "7": //Nhóm khách hàng NhomKhachHangUPresentation nhk = new NhomKhachHangUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(nhk); lbTitle.Content = "QUẢN LÝ NHÓM KHÁCH HÀNG"; break; case "8": //Tạo mã vạch TaoMaVachUPresentation tmv = new TaoMaVachUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(tmv); lbTitle.Content = "TẠO MÃ VẠCH SẢN PHẨM"; break; case "9": MaGiamGiaUPresentation mgg = new MaGiamGiaUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(mgg); lbTitle.Content = "TẠO MÃ GIẢM GIÁ"; break; case "10": PhanQuyenUPresentation pq = new PhanQuyenUPresentation(); pq._nhanVien = _NhanVien; gdContentMain.Children.Clear(); gdContentMain.Children.Add(pq); lbTitle.Content = "QUẢN LÝ NHÓM QUYỀN"; break; case "11": ThietLapHeThongUPresentation tl = new ThietLapHeThongUPresentation(); tl._CapNhatHienThi += new EventHandler(CapNhatSuaNV_TL); gdContentMain.Children.Clear(); gdContentMain.Children.Add(tl); lbTitle.Content = "THIẾT LẬP HỆ THỐNG"; break; case "12": DoiMatKhauPresentation dmk = new DoiMatKhauPresentation(); dmk._nhanvien = _NhanVien; dmk.ShowDialog(); UpdateThongTin(); break; default: break; }//end switch btnBack.Visibility = System.Windows.Visibility.Visible; lbTitle.Visibility = System.Windows.Visibility.Visible; }