controllingAgentID; //Controlling agent id from all controlling agents, -1 if none /*==================================================================== * Constructor * ==================================================================*/ public Seat(string name, int xPos, int yPos, SeatingLayout seatLayout, SeatStates status = SeatStates.Available, int promoID = -1, int agentID = -1) { //Set values from input seatName = name; seatPosX = xPos; seatPosY = yPos; seatStatus = status; seatPromoID = promoID; controllingAgentID = agentID; //Fil default values seatTimer = -1; //Create Seat ID using layout seatID = seatLayout.seatList.Count; //Add seat to seating layout list of seats seatLayout.seatList.Add(this); }
protected Flight() { //Flight Barcode var random = new Random(); FlightBarcode = random.Next(12345678, 99999999); //Seat state PlaceStates = new SeatStates[SeatAmount]; for (int i = 0; i < PlaceStates.Length; i++) { PlaceStates[i] = SeatStates.Available; } //Seat type PlaceTypes = new SeatTypes[SeatAmount]; for (int i = 0; i < PlaceTypes.Length; i++) { PlaceTypes[i] = SeatTypes.Economy; } }
public bool ChageLibrarySeatState(Guid seatId, SeatStates state) { lock (LibrarySeatData.locker) { var seat = _librarySeatRepository.GetById(seatId); if (seat == null) { return(false); } seat.SeatState = state; try { _librarySeatRepository.Update(seat); } catch (Exception) { return(false); } return(true); } }