public PmsResponseDto DeleteProperty(int propertyId) { if (propertyId <= 0) { throw new PmsException("PropertyId is not valid. Hence Property can not be deleted."); } var response = new PmsResponseDto(); if (_iPmsLogic.DeleteProperty(propertyId)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Property Deleted successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Property Deletion failed.Contact administrator."; } return(response); }
public PmsResponseDto DeleteRoomStatus(int statusId) { if (statusId <= 0) { throw new PmsException("RoomStatus Id is not valid. Hence Roomstatus can not be deleted."); } var response = new PmsResponseDto(); if (_iPmsLogic.DeleteRoomStatus(statusId)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Record deleted successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Operation failed.Please contact administrator."; } return(response); }
public PmsResponseDto UpdateProperty([FromBody] UpdatePropertyRequestDto request) { if (request == null || request.Property == null || request.Property.Id <= 0) { throw new PmsException("Property can not be updated."); } var response = new PmsResponseDto(); if (_iPmsLogic.UpdateProperty(request.Property)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Record saved successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Operation failed.Please contact administrator."; } return(response); }
public PmsResponseDto UpdateRewardCategory([FromBody] UpdateRewardCategoryRequestDto request) { if (request == null || request.RewardCategory == null || request.RewardCategory.Id <= 0) { throw new PmsException("Reward type can not be updated."); } var response = new PmsResponseDto(); if (_iPmsLogic.UpdateRewardCategory(request.RewardCategory)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Reward Category Updated successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Reward Category Updation failed.Contact administrator."; } return(response); }
public PmsResponseDto AddRoom([FromBody] AddRoomRequestDto request) { if (request == null || request.Rooms == null || request.Rooms.Count <= 0) { throw new PmsException("Room can not be added."); } var response = new PmsResponseDto(); if (_iPmsLogic.AddRoom(request.Rooms)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Record(s) saved successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Operation failed.Please contact administrator."; } return(response); }
public PmsResponseDto InsertUserAccess(UserAccessRequestDto request) { if (request == null || request.UserId <= 0) { throw new PmsException("User can not be updated."); } var response = new PmsResponseDto(); if (_iPmsLogic.InsertUserAccess(request)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Record(s) saved successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Operation failed.Please contact administrator."; } return(response); }
public PmsResponseDto UpdateBooking([FromBody] AddBookingRequestDto request) { if (request == null || request.Booking == null) { throw new PmsException("Room Booking can not be done."); } var response = new PmsResponseDto(); if (_iPmsLogic.UpdateBooking(request.Booking)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Booking is updated successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Booking is failed.Contact administrator."; } return(response); }
public PmsResponseDto UpdateStatus(UpdateStatusRequestDto request) { if (request == null || request.BookingStatus == null || request.BookingStatus.Count <= 0) { throw new PmsException("Update status call for booking failed."); } var response = new PmsResponseDto(); if (_iPmsLogic.UpdateStatus(request.BookingStatus)) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Booking status updated successfully."; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Booking status update failed.Contact administrator."; } return(response); }
public PmsResponseDto AddProperty([FromBody] AddPropertyRequestDto request) { if (request == null || request.Property == null) { throw new PmsException("Property can not be added."); } var response = new PmsResponseDto(); var Id = _iPmsLogic.AddProperty(request.Property); if (Id > 0) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Record saved successfully."; response.ResponseObject = Id; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Operation failed.Please contact administrator."; } return(response); }
public PmsResponseDto AddRewardCategory([FromBody] AddRewardCategoryRequestDto request) { if (request == null || request.RewardCategory == null) { throw new PmsException("RewardCategory can not be added."); } var response = new PmsResponseDto(); var Id = _iPmsLogic.AddRewardCategory(request.RewardCategory); if (Id > 0) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Reward Category Added successfully."; response.ResponseObject = Id; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Reward Category Addition failed.Contact administrator."; } return(response); }
public PmsResponseDto AddInvoice([FromBody] AddInvoiceRequestDto request) { if (request == null || request.Invoice == null || request.Invoice.PropertyId <= 0 || request.Invoice.BookingId <= 0) { throw new PmsException("Invoice can not be added."); } var response = new PmsResponseDto(); var id = _iPmsLogic.AddInvoice(request.Invoice); if (id > 0) { response.ResponseStatus = PmsApiStatus.Success.ToString(); response.StatusDescription = "Invoice saved successfully."; response.ResponseObject = id; } else { response.ResponseStatus = PmsApiStatus.Failure.ToString(); response.StatusDescription = "Invoice is not added.Contact administrator."; response.ResponseObject = id; } return(response); }