Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();
            viewModel             = new HomeViewModel();
            viewModel.ListHoiNghi = HoiNghiDAO.GetAllHoiNghi();
            int total = viewModel.ListHoiNghi.Count;

            viewModel.PagingInfo = new PagingInfo(4, total);
            loadPageHoiNghi(1);
        }
Esempio n. 2
0
        private void timKiemBtn_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (sapXep_grid.Visibility == Visibility.Visible)
            {
                sapXep_grid.Visibility  = Visibility.Collapsed;
                timKiem_grid.Visibility = Visibility.Visible;
            }
            else
            {
                sapXep_grid.Visibility  = Visibility.Visible;
                timKiem_grid.Visibility = Visibility.Collapsed;

                tenHoiNghiTextBox.Text = "";
                diadiemTextBox.Text    = "";

                viewModel.ListHoiNghi = HoiNghiDAO.GetAllHoiNghi();
                viewModel.PagingInfo  = new PagingInfo(4, viewModel.ListHoiNghi.Count);
                loadPageHoiNghi(1);
            }
        }
Esempio n. 3
0
        private void ngayBatDauDatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            string   name        = tenHoiNghiTextBox.Text.Trim();
            string   place       = diadiemTextBox.Text.Trim();
            DateTime date        = ngayBatDauDatePicker.SelectedDate.GetValueOrDefault();
            DateTime defaultDate = new DateTime();

            if (name != "" || place != "" || date != defaultDate)
            {
                viewModel.ListHoiNghi = HoiNghiDAO.GetResultSearchHoiNghi(name, place, date);
                viewModel.PagingInfo  = new PagingInfo(4, viewModel.ListHoiNghi.Count);
                loadPageHoiNghi(1);
            }
            else
            {
                viewModel.ListHoiNghi = HoiNghiDAO.GetAllHoiNghi();
                viewModel.PagingInfo  = new PagingInfo(4, viewModel.ListHoiNghi.Count);
                loadPageHoiNghi(1);
            }
        }