PNR出票结果页面
public ActionResult IssuanceTicketResult(int orderID)
{
try
{
//查询订单信息
OrderVo order = (from tabOrder in myModel.B_Order
join tabPNR in myModel.B_PNR
on tabOrder.PNRID equals tabPNR.PNRID
where tabOrder.orderID == orderID
select new OrderVo()
{
orderID = tabOrder.orderID,//订单ID
orderNo = tabOrder.orderNo,//订单编号
PNRNo = tabPNR.PNRNo,//PNR 编号
}).Single();
//查询该订单ID的电子客票信息
List eTickets = (from tabETicket in myModel.B_ETicket
join tabOrder in myModel.B_Order
on tabETicket.orderID equals tabOrder.orderID
join tabPNRPassenger in myModel.B_PNRPassenger
on tabETicket.PNRPassengerID equals tabPNRPassenger.PNRPassengerID
where tabOrder.orderID==orderID
select new ETicketVo()
{
passengerNo = tabPNRPassenger.passengerNo.Value,//旅客编号
passengerName = tabPNRPassenger.passengerName,//旅客姓名
ticketPrice = tabOrder.totalPrice,//票价
ticketNo = tabETicket.ticketNo,//电子客票号
}).ToList();
//传递参数到页面
ViewBag.order = order;
ViewBag.eTickets = eTickets;
return View();
}
catch (Exception e)
{
Console.WriteLine(e);
return RedirectToAction(“Index”);
}
}
数据导出
数据的导出都是利用了浏览器的文件下载功能。浏览器文件下载通用的写法代码如下:
fun