Example #1
0
        //PHƯƠNG THỨC ĐĂNG NHẬP
        private void DangNhap(object sender, EventArgs e)
        {
            //Chuyển sang trạng thái đã đăng nhập
            _DangNhap = true;

            //Lấy thông tin nhân viên
            DangNhapUPresentation wpf_DangNhap = (DangNhapUPresentation)sender;

            _NhanVien = wpf_DangNhap.Nv;

            //Lấy quyền truy nhập
            _lstQuyen = PhanQuyenBusiness.LayQuyenChucNangTheoQuyen(_NhanVien.ID_Q);
            HienThiTheoQuyen();

            gdContentMain.Children.Clear();

            //Hiển thị 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);

            btnBack.Visibility = System.Windows.Visibility.Collapsed;
            FocusButon(1);

            //Hiển thị thông tin nhân viên đăng nhập
            HienThiNhanVien();
        }
Example #2
0
        //Phương thức chọn chức năng - Wpf bắt đầu
        private void ChonChucNang_WPFBatDau(object sender, EventArgs e)
        {
            //Lấy thông tin
            BatDauUPresentation _wpfBatDau = (BatDauUPresentation)sender;
            int _ChucNang = _wpfBatDau._ChucNang;

            switch (_ChucNang)
            {
            case 1:    //Đăng nhập
                btnBack.Visibility = System.Windows.Visibility.Visible;
                _menu = 0;

                DangNhapUPresentation wpf_DangNhap = new DangNhapUPresentation();
                wpf_DangNhap.DangNhap += new EventHandler(DangNhap);
                gdContentMain.Children.Clear();
                gdContentMain.Children.Add(wpf_DangNhap);
                break;

            case 2:    //Đăng xuất

                _NhanVien        = null;
                _lstQuyen        = null;
                gdMenu.IsEnabled = false;
                _DangNhap        = false;
                BatDauUPresentation wpf_bd = new BatDauUPresentation();
                wpf_bd._DangNhap      = _DangNhap;
                wpf_bd._ChonChucNang += new EventHandler(ChonChucNang_WPFBatDau);

                gdContentMain.Children.Clear();
                gdContentMain.Children.Add(wpf_bd);

                HienThiNhanVien();

                break;

            default:
                break;
            }
        }