示例#1
0
        public JsonObject ProcessRequest(HttpContext ctx)
        {
            //try
            //{
            var seatDb = new SeatDB();

            ctx.Response.ContentType = "application/json;charset=utf-8";

            var json   = new JsonObject();
            var array  = new JsonArray();
            var member = new JsonObject();

            //HttpSession session = request.getSession();
            //int flightId = (int)session.getAttribute("flightId");
            BookingCart bCart    = new BookingCart();
            int         flightId = 1;

            //bCart = (BookingCart)session.getAttribute("cart");
            //member.put("arrayData", seatDB.getSeatingLayout(flightId));
            member.Add("arrayData", seatDb.GetUpdatedSeats(bCart, flightId).ToArray());
            array.Add(member);

            json.Add("jsonArray", array.ToString());

            return(json);
            //}
            //catch (IOException e)
            //{
            //    Console.WriteLine(e.Message);
            //}
        }
示例#2
0
 public Utilities(IHttpContextAccessor httpContextAccessor)
 {
     _httpContextAccessor = httpContextAccessor;
     _seatDb = new SeatDB();
 }