Ejemplo n.º 1
0
        public SeatTypeDto GetSeatTypeDetails(int?id)
        {
            SeatTypeModel seatType    = _iSeatTypeRepository.GetById(id);
            SeatTypeDto   seatTypeDto = ObjectConverter <SeatTypeModel, SeatTypeDto> .Convert(seatType);

            return(seatTypeDto);
        }
Ejemplo n.º 2
0
        public bool IsSeatTypeAlreadyExists(SeatTypeDto seatTypeDto)
        {
            var seatTypeList = _iSeatTypeRepository.GetAll().ToList();

            return((from st in seatTypeList
                    where st.SeatType == seatTypeDto.SeatType
                    select st).Any());
        }
Ejemplo n.º 3
0
        public IActionResult UpdateSeatType([FromBody] SeatTypeDto seatType)
        {
            Result result = seatService.UpdateSeatType(seatType);

            if (result.Success)
            {
                return(Ok(result.Success));
            }
            else
            {
                if (result.Exception != null)
                {
                    Log.Error(result.Exception, "Error updating seat type with id {0}!", seatType.Id);
                    return(StatusCode(500));
                }
                else
                {
                    Log.Warning("Unable to upddate seat type with id {0}!", seatType.Id);
                    return(Conflict());
                }
            }
        }
Ejemplo n.º 4
0
        public IActionResult AddSeatType([FromBody] SeatTypeDto seatType)
        {
            Result result = seatService.AddSeatType(seatType);

            if (result.Success)
            {
                return(Ok(result.Success));
            }
            else
            {
                if (result.Exception != null)
                {
                    Log.Error(result.Exception, "Error adding seat type to database!");
                    return(StatusCode(500));
                }
                else
                {
                    Log.Warning("Unable to add seat type to database!");
                    return(Conflict());
                }
            }
        }
 public Result UpdateSeatType(SeatTypeDto seatTypeDto)
 {
     return(seatTypeRepository.UpdateSeatType(mapper.Map <SeatType>(seatTypeDto)));
 }
 public Result AddSeatType(SeatTypeDto seatTypeDto)
 {
     return(seatTypeRepository.AddSeatType(mapper.Map <SeatType>(seatTypeDto)));
 }
Ejemplo n.º 7
0
        public void UpdateSeatType(SeatTypeDto seatTypeDto)
        {
            SeatTypeModel seatType = ObjectConverter <SeatTypeDto, SeatTypeModel> .Convert(seatTypeDto);

            _iSeatTypeRepository.Update(seatType);
        }
Ejemplo n.º 8
0
        public void InsertSeatType(SeatTypeDto seatTypeDto)
        {
            SeatTypeModel seatType = ObjectConverter <SeatTypeDto, SeatTypeModel> .Convert(seatTypeDto);

            _iSeatTypeRepository.Insert(seatType);
        }