Ejemplo n.º 1
0
        // Select các dữ liệu của doan
        private void doan_fill()
        {
            lv.Items.Clear();
            IEnumerable <DoanKhach> doans = _doanRepo.getAll();

            foreach (DoanKhach doan in doans)
            {
                ListViewItem item = new ListViewItem(doan.MaDoan);
                item.SubItems.Add(doan.TenDoan);
                lv.Items.Add(item);
            }
        }
Ejemplo n.º 2
0
        public void TabRefresh(ListTab tab)
        {
            switch (tab)
            {
            case ListTab.Tour:
            {
                tabTour_FromDate.Value             = tabTour_FromDate.MinDate;
                tabTour_ToDate.Value               = tabTour_ToDate.MaxDate;
                tabTour_ToPrice.Value              = tabTour_ToPrice.Maximum;
                tabTour_SearchOption.SelectedIndex = 0;
                searchBox.Text        = "";
                isDeleted_ChB.Checked = false;
                tourGridView.Rows.Clear();
                var data = _tourRepo.getAll();
                foreach (Tour item in data)
                {
                    tourGridView.Rows.Add(item.TourId, item.MaTour, item.Ten, item.LHDL.Ten);
                }
                break;
            }

            case ListTab.Nhanvien:
            {
                tabNV_SearchBox.Text = "";
                tabNV_CB.Checked     = false;
                NVGridView.Rows.Clear();
                var data = _nhanvienRepo.getAll();
                foreach (NhanVien item in data)
                {
                    NVGridView.Rows.Add(item.NVId, item.MaNV, item.Ten, item.SDT);
                }
                break;
            }

            case ListTab.Chitieu:
            {
                tabCT_SearchBox.Text = "";
                ChiTieuGridView.Rows.Clear();
                var data = _chitieuRepo.getAll();
                foreach (ChiTieu item in data)
                {
                    ChiTieuGridView.Rows.Add(item.CTId, item.Ten);
                }
                break;
            }

            case ListTab.Doan:
            {
                tabDoan_SearchBox.Text = "";
                DoanGridView.Rows.Clear();
                var data = _doankhachRepo.getAll();
                foreach (DoanKhach item in data)
                {
                    DoanGridView.Rows.Add(item.DoanId, item.MaDoan, item.TenDoan, item.Chitiet, item.Status, item.TourId, item.Tour.MaTour);
                }
                break;
            }

            case ListTab.HanhKhach:
            {
                tabHanhKhach_SearchBox.Text = "";
                HanhKhachGridView.Rows.Clear();
                var data = _hanhkhachRepo.getAll();
                foreach (HanhKhach item in data)
                {
                    HanhKhachGridView.Rows.Add(item.KhachId, item.MaKhach, item.Ten, item.SDT, item.Email);
                }
                break;
            }
            }
        }