Exemplo n.º 1
0
        /// <summary>
        /// hàm hiển thị màn hình Quản lý nhân viên
        /// </summary>
        /// <param name="parameter"></param>
        private void OnViewQuanLyNhanVien(object parameter)
        {
            NhanVienWindow window = new NhanVienWindow()
            {
                DataContext = new NhanVienViewModel()
            };

            window.ShowDialog();
        }
        public MainViewModel()
        {
            LoadedWindowCommand = new RelayCommand <Window>((p) => { return(true); }, (p) =>
            {
                Isloaded = true;
                if (p == null)
                {
                    return;
                }

                p.Hide();
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();

                if (loginWindow.DataContext == null)
                {
                    return;
                }
                var loginVM = loginWindow.DataContext as LoginViewModel;

                if (loginVM.IsLogin)
                {
                    p.Show();
                }
                else
                {
                    p.Close();
                }
            }
                                                            );

            LogoutCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                System.Windows.Application.Current.Shutdown();
            });
            ProductCommand   = new RelayCommand <object>((p) => { return(true); }, (p) => { ProductDetailPage wd = new ProductDetailPage(); wd.ShowDialog(); });
            SettingsCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { SettingsWindow wd = new SettingsWindow(); wd.ShowDialog(); });
            EmployeeCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { NhanVienWindow wd = new NhanVienWindow(); wd.ShowDialog(); });
            KhuyenMaiCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { KhuyenMaiWindow wd = new KhuyenMaiWindow(); wd.ShowDialog(); });
            StoreCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { StoreWindow wd = new StoreWindow(); wd.ShowDialog(); });
            KhachHangCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { KhachHangWindow wd = new KhachHangWindow(); wd.ShowDialog(); });
            ProducerCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { NSXWindow wd = new NSXWindow(); wd.ShowDialog(); });
            OrderCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { BillWindow wd = new BillWindow(); wd.ShowDialog(); });
        }