Exemple #1
0
        private void In()
        {
            List <ReportNhanVien> ldata = new List <ReportNhanVien>();
            int stt = 1;

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                ReportNhanVien nv = new ReportNhanVien();
                nv.STT      = stt++;
                nv.MaNV     = row.Cells[0].Value.ToString();
                nv.Ho       = row.Cells[1].Value.ToString();
                nv.Ten      = row.Cells[2].Value.ToString();
                nv.GioiTinh = row.Cells[3].Value.ToString().Equals("True") ? "Nam" : "Nữ";
                DateTime ngaysinh = (DateTime)row.Cells[4].Value;
                nv.NgaySinh = (ngaysinh.Day < 10?"0":"") + ngaysinh.Day + "/" + (ngaysinh.Month < 10?"0":"") + ngaysinh.Month + "/" + ngaysinh.Year;
                nv.SoDT     = row.Cells[5].Value.ToString();
                nv.Phong    = row.Cells[7].Value.ToString();
                nv.ChucVu   = row.Cells[8].Value.ToString();

                ldata.Add(nv);
            }

            string TieuDe = "DANH SÁCH NHÂN VIÊN";

            if (tvPhongBan.SelectedNode != null)
            {
                if (!tvPhongBan.SelectedNode.Text.Equals("Tất Cả"))
                {
                    TieuDe += " PHÒNG " + tvPhongBan.SelectedNode.Text.ToUpper();
                }
            }

            if (treeView1.SelectedNode != null)
            {
                if (!treeView1.SelectedNode.Text.Equals("Tất Cả"))
                {
                    TieuDe += " " + treeView1.SelectedNode.Text.ToUpper();
                }
            }

            new Reports.Frm_Report_NhanVien(ldata, TieuDe).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();
            });
        }
Exemple #3
0
        private void BtnShow_Click(object sender, EventArgs e)
        {
            ReportNhanVien f = new ReportNhanVien();

            f.ShowDialog();
        }