Esempio n. 1
0
        private void mnuXuatHoaDon_Click(object sender, EventArgs e)
        {
            NhapXuatKho nhapKhoFrm = new NhapXuatKho(ImportExportType.EXPORT);

            nhapKhoFrm.MdiParent = this;
            nhapKhoFrm.Show();
        }
        // mọi thứ xử lý sẽ nằm trong này
        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();
                }
            });

            NhanVienWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                NhanVien nhanvienWindow = new NhanVien();
                nhanvienWindow.ShowDialog();
            });

            VatTuWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                VatTu vattuWindow = new VatTu();
                vattuWindow.ShowDialog();
            });

            KhoWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                Kho khoWindow = new Kho();
                khoWindow.ShowDialog();
            });

            NhapXuatVatTuWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                NhapXuatKho nhapxuatvattuWindow = new NhapXuatKho();
                nhapxuatvattuWindow.ShowDialog();
            });

            PhieuThuChiWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                PhieuThuChi phieuthuchiWindow = new PhieuThuChi();
                phieuthuchiWindow.ShowDialog();
            });

            LichSuNXVTWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                LichSuNXVT lichsunxvtWindow = new LichSuNXVT();
                lichsunxvtWindow.ShowDialog();
            });

            LoadedReportNhanVienCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                ReportNhanVien reportnhanvienwindow = new ReportNhanVien();
                reportnhanvienwindow.ShowDialog();
            });

            LoadedReportVatTuCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                ReportVatTu reportvattuwindow = new ReportVatTu();
                reportvattuwindow.ShowDialog();
            });

            LoadedReportChiTietNXCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                ReportChiTietNX reportchitietnxwindow = new ReportChiTietNX();
                reportchitietnxwindow.ShowDialog();
            });

            LoadedReportTHNXCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                ReportTHNX reportthnxwindow = new ReportTHNX();
                reportthnxwindow.ShowDialog();
            });
        }