//CHỌN CHỨC NĂNG TRANG CHỦ private void ChonChucNang_TrangChu(object sender, EventArgs e) { TrangChuUPresentation wpf = (TrangChuUPresentation)sender; int _ChucNang = wpf._ChucNang; switch (_ChucNang) { case 1: BanHangUPresentation _bh = new BanHangUPresentation(); _bh._NhanVien = _NhanVien; gdContentMain.Children.Clear(); gdContentMain.Children.Add(_bh); lbTitle.Content = "LẬP HÓA ĐƠN BÁN HÀNG"; break; case 2: NhapHangTraUPresentation _nht = new NhapHangTraUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_nht); lbTitle.Content = "NHẬP HÀNG TRẢ"; break; case 3: NhapMuaUPresentation _nm = new NhapMuaUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_nm); lbTitle.Content = "NHẬP MUA"; break; case 4: TaoMaVachUPresentation _tmv = new TaoMaVachUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_tmv); lbTitle.Content = "TẠO MÃ VẠCH SẢN PHẨM"; break; case 5: KhachHangUPresentation _kh = new KhachHangUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_kh); lbTitle.Content = "QUẢN LÝ KHÁCH HÀNG"; break; case 6: SanPhamUPresentation _sp = new SanPhamUPresentation(); gdContentMain.Children.Clear(); gdContentMain.Children.Add(_sp); lbTitle.Content = "QUẢN LÝ SẢN PHẨM"; break; } lbTitle.Visibility = System.Windows.Visibility.Visible; btnBack.Visibility = System.Windows.Visibility.Visible; _menu = 1; }
//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; }