public void xemdulieu() { BUL_BanVe bUL_BanVe = new BUL_BanVe(); BUL_HangVe bUL_HangVe = new BUL_HangVe(); BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); dGVbanVe.DataSource = bUL_BanVe.getVe(); dGVbanVe.Refresh(); dGVbanVe.Columns[0].HeaderText = "Mã vé chuyến bay"; dGVbanVe.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVbanVe.Columns[1].HeaderText = "Mã chuyến bay"; dGVbanVe.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVbanVe.Columns[2].HeaderText = "Mã hành khách"; dGVbanVe.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVbanVe.Columns[3].HeaderText = "Mã hạng vé"; dGVbanVe.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVbanVe.Columns[4].HeaderText = "Giá tiền"; dGVbanVe.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; cBmaCB.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); cBmaCB.DisplayMember = "MaCB"; cBmaCB.ValueMember = "MaCB"; cBhangVe.DataSource = bUL_HangVe.getHV(); cBhangVe.DisplayMember = "TenHV"; cBhangVe.ValueMember = "MaHV"; }
public void xemdulieu() { BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); BUL_SanBay bUL_SanBay = new BUL_SanBay(); BUL_ChiTietCB bUL_ChiTietCB = new BUL_ChiTietCB(); dGVthemChiTietCB.DataSource = bUL_ChiTietCB.getChiTietCB(); dGVthemChiTietCB.Refresh(); dGVthemChiTietCB.Columns[0].HeaderText = "Mã chi tiết"; dGVthemChiTietCB.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemChiTietCB.Columns[1].HeaderText = "Mã chuyến bay"; dGVthemChiTietCB.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemChiTietCB.Columns[2].HeaderText = "Mã sân bay trung gian"; dGVthemChiTietCB.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemChiTietCB.Columns[3].HeaderText = "Thời gian dừng"; dGVthemChiTietCB.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemChiTietCB.Columns[4].HeaderText = "Ghi chú"; dGVthemChiTietCB.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; cBmaCB.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); cBmaCB.DisplayMember = "MaCB"; cBmaCB.ValueMember = "MaCB"; cBsanBayTrungGian.DataSource = bUL_SanBay.getSanBay(); cBsanBayTrungGian.DisplayMember = "TenSB"; cBsanBayTrungGian.ValueMember = "MaSB"; }
private void btnXacNhan_Click(object sender, EventArgs e) { BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); if (txtMaCB.Text != "" && txtThoiGianBay.Text != "" && cBsanBayDen.Text != "" && cBsanBayDi.Text != "" && txtGiaVe.Text != "" && txtSLGheHang1.Text != "" && txtSLGheHang2.Text != "") { LichChuyenBay lcb = new LichChuyenBay(txtMaCB.Text, cBsanBayDi.SelectedValue.ToString(), cBsanBayDen.SelectedValue.ToString(), Convert.ToInt32(txtGiaVe.Text), Convert.ToString(dTPngayGio.Value), txtThoiGianBay.Text, Convert.ToInt32(txtSLGheHang1.Text), Convert.ToInt32(txtSLGheHang2.Text)); if (bUL_LichChuyenBay.themLichChuyenBay(lcb)) { MessageBox.Show("Thêm thành công"); txtGiaVe.Text = ""; txtSLGheHang1.Text = ""; txtSLGheHang2.Text = ""; txtThoiGianBay.Text = "00:00:00"; txtMaCB.Text = "CB"; dGVthemLichCB.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); // refresh datagridview } else { MessageBox.Show("Đã có lỗi xảy ra", "Lỗi"); } } else { MessageBox.Show("Xin hãy nhập đầy đủ"); } }
public void xemdulieu() { BUL_SanBay bUL_SanBay = new BUL_SanBay(); BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); dGVthemLichCB.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); dGVthemLichCB.Refresh(); dGVthemLichCB.Columns[0].HeaderText = "Mã chuyến bay"; dGVthemLichCB.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[1].HeaderText = "Sân bay đi"; dGVthemLichCB.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[2].HeaderText = "Sân bay đến"; dGVthemLichCB.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[3].HeaderText = "Giá tiền"; dGVthemLichCB.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[4].HeaderText = "Ngày giờ"; dGVthemLichCB.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[4].DefaultCellStyle.Format = "MM/dd/yyyy HH:mm:ss"; dGVthemLichCB.Columns[5].HeaderText = "Thời gian bay"; dGVthemLichCB.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[6].HeaderText = "Số lượng ghế hạng 1"; dGVthemLichCB.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVthemLichCB.Columns[7].HeaderText = "Số lượng ghế hạng 2"; dGVthemLichCB.Columns[7].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; cBsanBayDi.DataSource = bUL_SanBay.getSanBay(); cBsanBayDi.DisplayMember = "TenSB"; cBsanBayDi.ValueMember = "MaSB"; cBsanBayDen.DataSource = bUL_SanBay.getSanBay(); cBsanBayDen.DisplayMember = "TenSB"; cBsanBayDen.ValueMember = "MaSB"; }
public void addbinding() { BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); BUL_SanBay bUL_SanBay = new BUL_SanBay(); txtMaCT.DataBindings.Clear(); txtMaCT.DataBindings.Add("Text", dGVchiTietCB.DataSource, "MaCT"); cBmaCB.DataBindings.Clear(); cBmaCB.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); cBmaCB.DisplayMember = "MaCB"; cBmaCB.ValueMember = "MaCB"; cBsanBayTrungGian.DataBindings.Clear(); cBsanBayTrungGian.DataSource = bUL_SanBay.getSanBay(); cBsanBayTrungGian.DisplayMember = "TenSB"; cBsanBayTrungGian.ValueMember = "MaSB"; txtThoiGianDung.DataBindings.Clear(); txtThoiGianDung.DataBindings.Add("Text", dGVchiTietCB.DataSource, "ThoiGianDung"); txtGhiChu.DataBindings.Clear(); txtGhiChu.DataBindings.Add("Text", dGVchiTietCB.DataSource, "GhiChu"); }
public void xemdulieu() { BUL_LichChuyenBay bUL_LichChuyenBay = new BUL_LichChuyenBay(); dGVLichChuyenBay.DataSource = bUL_LichChuyenBay.getLichChuyenBay(); dGVLichChuyenBay.Columns[0].HeaderText = "Mã chuyến bay"; dGVLichChuyenBay.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[1].HeaderText = "Mã sân bay đi"; dGVLichChuyenBay.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[2].HeaderText = "Mã sân bay đến"; dGVLichChuyenBay.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[3].HeaderText = "Giá tiền"; dGVLichChuyenBay.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[4].HeaderText = "Ngày giờ"; dGVLichChuyenBay.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[5].HeaderText = "Thời gian bay"; dGVLichChuyenBay.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[6].HeaderText = "Số lượng ghế hạng 1"; dGVLichChuyenBay.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dGVLichChuyenBay.Columns[7].HeaderText = "Số lượng ghế hạng 2"; dGVLichChuyenBay.Columns[7].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }