/// <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(); }
/// <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 }