/// <summary> /// Constructor to create a RoomRequest /// </summary> /// <param name="roomRequestVM"></param> public RoomRequest(RoomRequestVMUser roomRequestVM) { CheckInUser = roomRequestVM.CheckIn; CheckOutUser = roomRequestVM.CheckOut; ShareRoom = roomRequestVM.ShareRoom; PriceUser = roomRequestVM.Price; DoubleBed = SingleBed = 0; Request_ID = roomRequestVM.Request_ID; Nevermind = roomRequestVM.Nevermind; if (roomRequestVM.DoubleBed) { DoubleBed++; } if (roomRequestVM.SingleBed) { SingleBed++; } RoomType = Accommodation.Accommodation.DetectRoomType(SingleBed, DoubleBed, ShareRoom, Nevermind); Message = roomRequestVM.Text; RequestOwner = roomRequestVM.RequestOwner; TimeStamp = DateTime.Now; SetValid(); RoomRequestResponse = new RoomRequestResponse(); RoomRequestResponse.Init(); }
public void AcceptProposal() { CheckInUser = CheckInOwner; CheckOutUser = CheckOutOwner; SingleBed = SingleBedPropose; DoubleBed = DoubleBedPropose; ShareRoom = ShareRoomPropose; PriceUser = PriceOwner; RoomRequestResponse.Approve(); }
/// <summary> /// Update when a proposal from RqOwner was made /// </summary> public void SetValues(RoomRequestVMOwner proposal) { CheckInOwner = proposal.CheckIn; CheckOutOwner = proposal.CheckOut; if (proposal.SingleBed) { SingleBedPropose = 1; } if (proposal.DoubleBed) { DoubleBedPropose = 1; } ShareRoomPropose = proposal.ShareRoom; PriceOwner = proposal.Price; Message = Message + "\nHost has made a proposal:\n" + proposal.Message; RoomRequestResponse.Propose(); }
/// <summary> /// Update from User /// </summary> /// <param name="roomRequestVM"></param> public void SetValues(RoomRequestVMUser roomRequestVM) { CheckInUser = roomRequestVM.CheckIn; CheckOutUser = roomRequestVM.CheckOut; ShareRoom = roomRequestVM.ShareRoom; PriceUser = roomRequestVM.Price; Nevermind = roomRequestVM.Nevermind; DoubleBed = SingleBed = 0; if (roomRequestVM.DoubleBed) { DoubleBed++; } if (roomRequestVM.SingleBed) { SingleBed++; } RoomType = Accommodation.Accommodation.DetectRoomType(SingleBed, DoubleBed, ShareRoom, Nevermind); TimeStamp = DateTime.Now; Message = roomRequestVM.Text; RoomRequestResponse.Init(); SetValid(); //Todo has to be checked in get Methods }
public void Reserve(int roomid) { Room_ID = roomid; RoomRequestResponse.Reserve(); }