public JsonResult GetAirChangeInfoList(DateTime?startDate, DateTime?endDate, string startTime, string endTime, string PNR, string Passenger, bool?statue, int page, int rows) { BPiaoBao.AppServices.StationContracts.StationMap.PagedList <ResponeAirChange> pagedList = null; CommunicateManager.Invoke <IStationOrderService>(p => pagedList = p.GetAirChangeList(startDate, endDate, startTime, endTime, PNR, Passenger, statue, page, rows)); return(Json(new { total = pagedList.Total, rows = pagedList.Rows }, JsonRequestBehavior.DenyGet)); }
/// <summary> /// 航变信息导出EXCEL表 /// </summary> /// <param name="qtDate"></param> /// <param name="qtDateTime"></param> /// <param name="?"></param> /// <returns></returns> public FileResult ExportExcelAriChang(DateTime?startDate, DateTime?endDate, string startTime, string endTime, string PNR, string Passenger, bool?statue) { ExportExcelContext export = new ExportExcelContext("Excel2003"); DataTable dt = new DataTable("航变信息"); List <KeyValuePair <string, Type> > headArray = new List <KeyValuePair <string, Type> > { new KeyValuePair <string, Type>("qt日期", typeof(string)), new KeyValuePair <string, Type>("qt时间", typeof(string)), new KeyValuePair <string, Type>("qt条数", typeof(string)), new KeyValuePair <string, Type>("商户信息", typeof(string)), new KeyValuePair <string, Type>("PNR", typeof(string)), new KeyValuePair <string, Type>("订单号", typeof(string)), new KeyValuePair <string, Type>("CTCT", typeof(string)), new KeyValuePair <string, Type>("乘机人", typeof(string)), new KeyValuePair <string, Type>("出票", typeof(string)), new KeyValuePair <string, Type>("通知方式", typeof(string)), }; headArray.ForEach(p => dt.Columns.Add(p.Key, p.Value)); BPiaoBao.AppServices.StationContracts.StationMap.PagedList <ResponeAirChange> list = _service.GetAirChangeList(startDate, endDate, startTime, endTime, PNR, Passenger, statue, 1, 10000); list.Rows.ForEach( x => { dt.Rows.Add( x.QTDate.ToString("yyyy-MM-dd"), x.QTDate.ToString("HH:mm"), x.QTCount, x.BusinessmanName, x.PNR, x.OrderId, x.CTCT, string.Join("|", x.PassengerName), x.OfficeNum, ((EnumAriChangNotifications)x.NotifyWay).ToEnumDesc() ); }); return(File(export.GetMemoryStream(dt), "application/ms-excel", HttpUtility.UrlEncode(string.Format(dt.TableName + ".{0}", export.TypeName), System.Text.Encoding.UTF8))); }