//Nút kho private void btnKho_Click(object sender, RoutedEventArgs e) { KhoUPresentation wpf_Kho = new KhoUPresentation(); wpf_Kho._lstQuyen = _lstQuyen; wpf_Kho._ChonChucNang += new EventHandler(ChonChucNang_KHO); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_Kho); FocusButon(3); _menu = 2; 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; }
//Phương thức chọn chức năng - KHO private void ChonChucNang_KHO(object sender, EventArgs e) { KhoUPresentation wpf_KHO = (KhoUPresentation)sender; int _ChucNang = wpf_KHO._ChucNang; switch (_ChucNang) { case 1: //Nhập mua NhapMuaUPresentation wpf_nhapmua = new NhapMuaUPresentation(); wpf_nhapmua._nhanVien = _NhanVien; gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_nhapmua); lbTitle.Content = "NHẬP MUA"; break; case 2: KiemKeUPresentation wpf_KiemKe = new KiemKeUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_KiemKe); lbTitle.Content = "KIỂM KÊ SẢN PHẨM"; break; case 3: NhapHangTraUPresentation wpf_NhapHangTra = new NhapHangTraUPresentation(); wpf_NhapHangTra._NhanVien = _NhanVien; gdContentMain.Children.Clear(); gdContentMain.Children.Add(wpf_NhapHangTra); lbTitle.Content = "NHẬP HÀNG TRẢ LẠI"; break; default: break; } lbTitle.Visibility = System.Windows.Visibility.Visible; btnBack.Visibility = System.Windows.Visibility.Visible; }