/// <summary> /// Create Request -> transform RequestVM to Request /// </summary> /// <param name="acDetails"></param> /// <param name="RqOwnerID"></param> /// <param name="requestVMOwner"></param> public Request(int RqOwnerID, RequestVMOwner requestVMOwner) { RequestOwner_ID = RqOwnerID; CheckIn = requestVMOwner.CheckIn; CheckOut = requestVMOwner.CheckOut; Type = RequestType.Bound; Text = requestVMOwner.Text; Title = requestVMOwner.Title; SalesPricePDay = requestVMOwner.SalesPricePNight; SalesPricePWeek = requestVMOwner.SalesPricePWeek; SalesPricePMonth = requestVMOwner.SalesPricepMonth; StartTimeStamp = DateTime.Now; }
/// <summary> /// Update Request /// </summary> /// <param name="requestVM"></param> //needed for Edit public void SetValues(RequestVMOwner requestVM) { CheckIn = requestVM.CheckIn; CheckOut = requestVM.CheckOut; Text = requestVM.Text; Title = requestVM.Title; if (requestVM.requestType == RequestType.Bound) { SalesPricePDay = (requestVM.SalesPricePNight); SalesPricePWeek = (requestVM.SalesPricePWeek); SalesPricePMonth = (requestVM.SalesPricepMonth); } if (requestVM.requestType == RequestType.Free) { PriceMax = (requestVM.MaxPrice); PriceMin = (requestVM.MinPrice); Accommodation.AccomProfile.URL = requestVM.Link; Accommodation.AccomProfile.Lat = requestVM.Lat; Accommodation.AccomProfile.Lng = requestVM.Lng; } }