Beispiel #1
0
 public ActionResult <Result> GetTicketByOwner(string ownerId)
 {
     using (ConcertSeatsBLL concert = new ConcertSeatsBLL())
     {
         Result result = concert.GetTicketByOwner(ownerId, this.Message);
         return(result);
     }
 }
Beispiel #2
0
 public ActionResult <Result> GetAvailableSeatsByZoneId(string zoneId)
 {
     using (ConcertSeatsBLL concert = new ConcertSeatsBLL())
     {
         Result result = concert.GetAvailableSeatsByZoneId(zoneId, this.Message);
         return(result);
     }
 }
Beispiel #3
0
        public async Task <ActionResult <Result> > BookingSeats()
        {
            string json = "";

            using (System.IO.StreamReader reader = new System.IO.StreamReader(Request.Body, System.Text.Encoding.UTF8))
            {
                json = await reader.ReadToEndAsync();
            }

            dynamic product = new JObject();

            product.seatIds = "";
            product.total   = 0;
            product.booking = "";;

            var condition = JsonConvert.DeserializeObject <JObject>(json);

            using (ConcertSeatsBLL concert = new ConcertSeatsBLL())
            {
                return(concert.BookingSeat(Convert.ToInt32(condition.Property("total").Value), condition.Property("seatIds").Value.ToString(), condition.Property("booking").Value.ToString(), this.Message));
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            /*MongoDb db = new MongoDb (
             *  "mongodb://*****:*****@"{
                    '_id': 0,
                     'zoneId': '$_id.zoneId',
                    'zone': '$_id.zone',
                    'price': '$_id.price',
                    'totalAvailable': '$totalAvailable'
                    }";
            model.Sort    = "{price:-1}";
            model.Lookup  = new Model.Data.LookupModel {
                ForeignCollectionName = "concertTicketZones",
                LocalFieldName        = "zoneId",
                ForeignFieldName      = "_id",
                ResultAs = "totalTickets"
            };



            /*MongoDb db = new MongoDb (
            *  "mongodb://*****:*****@"{_id: {'$in':
*           ['impact2019002-TM5-0',
*           'impact2019002-TM5-1']},
*            'bookStatus._id':{'$ne':'bs01'}}
*           ", out sresult)
*           .Close();
*
*           Console.WriteLine(sresult);*/
            int    totalSeats = 2;
            string seatIds    = "['impact2019002-TM5-21', 'impact2019002-TM5-22']";
            // string jsonBooked ="{'$addToSet':{'booked': {'_id':1,'bookedDate':'2019-18-03', 'bookedBy':'*****@*****.**'}}}";
            string jsonBooked = "{'$set':{'bookingStatus': {'_id':'bs02','name':'Sold Out', 'isActive': true,'bookedDate':'2019-18-03 16:26:00', 'bookedBy':'*****@*****.**'}}}";

            result = concert.BookingSeat(totalSeats, seatIds, jsonBooked, message);
            Console.WriteLine(result.Message);
            // result = concert.GetAvailableSeats("impact2019002", message);
        }