private void btnLapVe_Click(object sender, EventArgs e)
        {
            QUANLYXEKHACHEntities db = new QUANLYXEKHACHEntities();

            int maChuyen = int.Parse(cbbMaChuyenDi.SelectedItem.ToString());
            tblChuyenDi chuyenDi = db.tblChuyenDis.Where(t => t.MaChuyenDi == maChuyen).SingleOrDefault();

            frmThongTinVe form = new frmThongTinVe(chuyenDi, new tblPhieuDatCho());
            form.Show();
        }
Beispiel #2
0
        private void btSua_Click(object sender, EventArgs e)
        {
            QUANLYXEKHACHEntities db = new QUANLYXEKHACHEntities();
            int maPhieu = int.Parse(dtgDanhSachVe.CurrentRow.Cells["MaPhieu"].Value.ToString());

            int maChuyenDi = int.Parse(dtgDanhSachVe.CurrentRow.Cells["MaChuyenDi"].Value.ToString());
            tblChuyenDi chuyenDi = db.tblChuyenDis.Where(t => t.MaChuyenDi == maChuyenDi).SingleOrDefault();
            tblPhieuDatCho phieu = db.tblPhieuDatChoes.Where(t => t.MaPhieu == maPhieu).SingleOrDefault();

            frmThongTinVe ve = new frmThongTinVe(chuyenDi, phieu);
            ve.Show();
        }