public IActionResult UnParking(int parkingID) { var item = this._Manager.UnParking(parkingID); msmq.SendMessage("UnParking vehicle:", item); return(this.Ok(item)); }
public IActionResult ParkinglotDetails(Parking parking) { string message; var res = this.Manager.ParkinglotDetails(parking); try { if (!res.Equals(null)) { message = "Successful"; msmq.SendMessage("Vehcile number " + parking.VehicleNumber + " Parking is done.", res); return(this.Ok(new { message, res })); } message = "Details adding can't be possible"; return(BadRequest(new { message })); } catch (CustomException) { return(BadRequest(CustomException.ExceptionType.INVALID_INPUT)); } }
public IActionResult AddBookDetails(BooksDetail booksDetail) { string message; var result = this.manager.AddBookDetails(booksDetail); try { if (!result.Equals(null)) { message = "Book details added successfully."; msmq.SendMessage("Books name " + booksDetail.BookName + " added successfully.", result); this._distributedCache.Remove(key); return(this.Ok(new { message, result })); } message = "Please insert correct book details.!!"; return(BadRequest(new { message })); } catch (CustomException) { return(BadRequest(CustomException.ExceptionType.INVALID_INPUT)); } }
public IActionResult AddBooks(BookStoreModel bookStoreModel) { var result = bookManager.AddBooks(bookStoreModel); try { if (result == 1) { this.distributedCache.Remove(key); msmq.SendMessage("Books name " + bookStoreModel.BookTittle + " added successfully.", result); return(this.Ok(bookStoreModel)); } else { return(this.BadRequest(JsonErrorModel.Json())); } } catch (BookStoreException) { return(BadRequest(Exception_type.Invalid_exception.ToString())); } }