private void showThongtin() { IEnumerable <DiaDiem> listdd = _diadiemRepository.getAll(); /*Dia Diem Tour*/ foreach (var DD in listdd) { ListViewItem diaDiem = new ListViewItem(new[] { DD.DDId.ToString(), DD.TenDD }); diadiemlist.Items.Add(diaDiem); } /* Loại hình */ var lhdl_list = _lhdlRepo.getAll(); loaicbb.DataSource = lhdl_list; loaicbb.DisplayMember = "Ten"; loaicbb.ValueMember = "LHDLId"; Tour = _tourRepository.getById(_id, ""); /*Thong tin Tour*/ matourtb.Text = Tour.MaTour; tentourtb.Text = Tour.Ten; foreach (LoaiHinhDL loai in loaicbb.Items) { if (loai.LHDLId == Tour.LHDL.LHDLId) { loaicbb.SelectedItem = loai; } } /*Dia Diem Tour*/ foreach (var DD in Tour.CTTours) { ListViewItem diaDiem = new ListViewItem(new[] { DD.DiaDiem.DDId.ToString(), DD.DiaDiem.TenDD }); foreach (ListViewItem dd in diadiemlist.Items) { if (dd.Text == diaDiem.Text) { dd.Checked = true; } } } /*Gia Tour*/ var info = System.Globalization.CultureInfo.GetCultureInfo("vi-VN"); foreach (var Gia in Tour.Gias) { var giaTien = String.Format(info, "{0:n}", Gia.GiaTri.ToString()); ListViewItem gia = new ListViewItem(new[] { giaTien, Gia.TGBD.ToString("dd/MM/yyyy HH:mm:ss"), Gia.TGKT.ToString("dd/MM/yyyy HH:mm:ss") }); gialist.Items.Insert(0, gia); } gialist.Items[0].ForeColor = Color.DarkGreen; }
private void showThongtin() { IEnumerable <DiaDiem> listdd = _diadiemRepository.getAll(); /*Dia Diem Tour*/ foreach (var DD in listdd) { ListViewItem diaDiem = new ListViewItem(new[] { DD.DDId.ToString(), DD.TenDD }); diadiem.Items.Add(diaDiem); } /* Loại hình */ var lhdl_list = _lhdlRepo.getAll(); loaihinhcbb.DataSource = lhdl_list; loaihinhcbb.DisplayMember = "Ten"; loaihinhcbb.ValueMember = "LHDLId"; }