public SeatTypeDto GetSeatTypeDetails(int?id) { SeatTypeModel seatType = _iSeatTypeRepository.GetById(id); SeatTypeDto seatTypeDto = ObjectConverter <SeatTypeModel, SeatTypeDto> .Convert(seatType); return(seatTypeDto); }
public bool IsSeatTypeAlreadyExists(SeatTypeDto seatTypeDto) { var seatTypeList = _iSeatTypeRepository.GetAll().ToList(); return((from st in seatTypeList where st.SeatType == seatTypeDto.SeatType select st).Any()); }
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()); } } }
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))); }
public void UpdateSeatType(SeatTypeDto seatTypeDto) { SeatTypeModel seatType = ObjectConverter <SeatTypeDto, SeatTypeModel> .Convert(seatTypeDto); _iSeatTypeRepository.Update(seatType); }
public void InsertSeatType(SeatTypeDto seatTypeDto) { SeatTypeModel seatType = ObjectConverter <SeatTypeDto, SeatTypeModel> .Convert(seatTypeDto); _iSeatTypeRepository.Insert(seatType); }