public object ExistsPNR() { var orderView = Session["OrderView"] as OrderView; if (orderView == null) { return new { HasPNR = false, OrderId = 0 } } ; var orderId = OrderQueryService.ExistsPNR(orderView.PNR, DateTime.Now.AddDays(-1), DateTime.Now, CurrentCompany.CompanyId); if (orderId == 0) { return(new { HasPNR = false, OrderId = 0 }); } else { return(new { HasPNR = true, OrderId = orderId }); } }