Exemple #1
0
        private void Click_btnThemPLSK(object sender, RoutedEventArgs e)
        {
            PLSuKien plsk = new PLSuKien(NguoiDungING);

            plsk.ShowDialog();
            loadDBtoComboBoxPLSK();
        }
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "btnNguoiDung":
                QuanLyNguoiDung qlnd = new QuanLyNguoiDung(NguoiDungING);
                qlnd.ShowDialog();
                using (QuanLyDuLieu db = new QuanLyDuLieu())
                {
                    NguoiDung nd = db.NguoiDung.ToList().Find(m => m.NguoiDungID == NguoiDungING.NguoiDungID);

                    if (nd == null)
                    {
                        DangNhap dnc = new DangNhap();
                        dnc.Show();
                        this.Close();
                    }
                    if (nd.MatKhau != NguoiDungING.MatKhau)
                    {
                        DangNhap dnc = new DangNhap();
                        dnc.Show();
                        this.Close();
                    }
                    if (nd.TenHienThi != NguoiDungING.TenHienThi)
                    {
                        NguoiDungING = nd;
                    }
                    LoadSuKienToLich();
                    LoadPhanLoaiSuKien();
                    LoadCongViec();
                }
                break;

            case "btnPLSuKien":
                PLSuKien plsk = new PLSuKien(NguoiDungING);
                plsk.ShowDialog();
                LoadSuKienToLich();
                LoadPhanLoaiSuKien();
                break;

            //case "btnSaoLuuKhoiPhuc":
            //    break;
            case "btnThongKe":
                ThongKe tk = new ThongKe(NguoiDungING);
                tk.ShowDialog();
                break;

            case "btnDangXuat":
                DangNhap dn = new DangNhap();
                dn.Show();
                this.Close();
                break;

            case "btnThoat":
                this.Close();
                break;

            default:
                break;
            }
        }