/// <summary>
        /// Used for proposal
        /// </summary>
        /// <param name="rRq"></param>
        public RoomRequestVMOwner(RoomRequest rRq)
        {
            ID = rRq.ID;

            DoubleBed  = rRq.DoubleBed > 0;
            SingleBed  = rRq.SingleBed > 0;
            ShareRoom  = rRq.ShareRoom;
            CheckIn    = rRq.CheckInUser;
            CheckOut   = rRq.CheckOutUser;
            Price      = rRq.PriceUser;
            Request_ID = rRq.Request_ID;
        }
Пример #2
0
        /// <summary>
        /// When RoomRequest is loaded from DB
        /// </summary>
        /// <param name="rRq"></param>
        public RoomRequestVMUser(RoomRequest rRq, Request.Request rq, VM.ProfilePreviewVM host) // when it comes from DB to view
        {
            ID              = rRq.ID;
            Host            = host;
            CheckInRequest  = rq.CheckIn;
            CheckOutRequest = rq.CheckOut;
            CheckInOwner    = rRq.CheckInOwner;
            CheckOutOwner   = rRq.CheckOutOwner;
            CheckIn         = rRq.CheckInUser;
            CheckOut        = rRq.CheckOutUser;
            string cur = "$";//currency has to be set by user

            if (rq.Type == Request.RequestType.Bound)
            {
                cur = Request.Request.GetCurrency(rq.SalesPricePDay);
                PricePNigthPRoom = (rq.SalesPricePDay); //SalesPrices in rq are per Room
                PricePWeekPRoom  = (rq.SalesPricePWeek);
                PricePMonthPRoom = (rq.SalesPricePMonth);
                cur             = Request.Request.GetCurrency(rq.SalesPricePDay);
                PricePRoomPTime = (Request.Request.CalcPrice(rRq.CheckInUser, rRq.CheckOutUser, Request.Request.Price(PricePNigthPRoom), Request.Request.Price(PricePWeekPRoom), Request.Request.Price(PricePMonthPRoom), 1).ToString("0.00") + cur);
            }
            if (rq.Type == Request.RequestType.Free)
            {
                cur       = Request.Request.GetCurrency(rq.PriceMax);
                PriceSpan = (rq.PriceMax) + "-" + (rq.PriceMin);
            }
            if (rRq.PriceOwner != null)
            {
                PriceOwner = Request.Request.PriceCurrency(rRq.PriceOwner, cur);
            }
            if (rRq.PriceUser != null)
            {
                Price = Request.Request.PriceCurrency(rRq.PriceUser, cur);
            }
            SingleBedOwner = rRq.SingleBedPropose > 0;
            DoubleBedOwner = rRq.DoubleBedPropose > 0;
            ShareRoomOwner = rRq.ShareRoomPropose;
            Status         = rRq.RoomRequestResponse.responseStatus;
            BedRooms       = rq.Accommodation.AccomProfile.BedRooms;
            Roomtype       = rRq.RoomType.ToString();
            RoomRqID       = rRq.ID; //not needed

            Text       = rRq.Message;
            ShareRoom  = rRq.ShareRoom;
            DoubleBed  = rRq.DoubleBed > 0;
            SingleBed  = rRq.SingleBed > 0;
            Request_ID = rRq.Request_ID;
            RqType     = rq.Type;
            //available rooms calc in controller...
        }
 public RoomRequestVMOwner(RoomRequest rRq, VM.ProfilePreviewVM applyingTraveler)
 {
     ID = rRq.ID;
     ApplyingTraveler = applyingTraveler;
     ApplicantName    = ApplyingTraveler.Name;
     DoubleBed        = rRq.DoubleBed > 0;
     SingleBed        = rRq.SingleBed > 0;
     ShareRoom        = rRq.ShareRoom;
     CheckIn          = rRq.CheckInUser;
     CheckOut         = rRq.CheckOutUser;
     Price            = rRq.PriceUser;
     RoomID           = rRq.Room_ID;
     Request_ID       = rRq.Request_ID;
     RoomType         = rRq.RoomType.ToString();
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="rRq"></param>
 /// <param name="rq"></param>
 public RReqVMListItemRqOwn(RoomRequest rRq, Request.Request rq, VM.ProfilePreviewVM profileUser)
 {
     ID            = rRq.ID;
     CheckIn       = rRq.CheckInUser.ToString("dd.MM.yyyy");
     CheckOut      = rRq.CheckOutUser.ToString("dd.MM.yyyy");
     TravelerPrice = rRq.PriceUser;
     RoomType      = rRq.RoomTypeToString();
     Status        = rRq.RoomRequestResponse.StatusString;
     Flatmate      = profileUser;
     if (rq.Type == Request.RequestType.Bound)
     {
         CalcPrice      = Request.Request.PriceCurrency(Request.Request.CalcPrice(rRq.CheckInUser, rRq.CheckOutUser, Request.Request.Price(rq.Accommodation.AccomProfile.PricePNight), Request.Request.Price(rq.Accommodation.AccomProfile.PricePWeek), Request.Request.Price(rq.Accommodation.AccomProfile.PricepMonth), rq.Accommodation.AccomProfile.BedRooms).ToString());
         CalcPriceSales = Request.Request.PriceCurrency(Request.Request.CalcPrice(rRq.CheckInUser, rRq.CheckOutUser, Request.Request.Price(rq.SalesPricePDay), Request.Request.Price(rq.SalesPricePWeek), Request.Request.Price(rq.SalesPricePMonth), 1).ToString());
     }
     if (rq.Type == Request.RequestType.Free)
     {
         PriceRange = rq.PriceMin + " - " + rq.PriceMax;
     }
     //Thumbs = Accommodation.Likibu.Offer.StringToArray(rq.Accommodation.AccomProfile.Thumbnails).ToList().FirstOrDefault();
 }
Пример #5
0
        public RoomRequestListUser(RoomRequest rRq, Request.Request rq, VM.ProfilePreviewVM rqOwnerPrev)
        {
            ID         = rRq.ID;
            Request_ID = rq.ID;
            CheckIn    = rRq.CheckInUser.ToString("dd.MM.yyyy");
            CheckOut   = rRq.CheckOutUser.ToString("dd.MM.yyyy");
            string cur = "";

            if (rq.Type == Request.RequestType.Bound)
            {
                cur = Request.Request.GetCurrency(rq.SalesPricePDay);

                CalcPrice = Request.Request.CalcPrice(rRq.CheckInUser, rRq.CheckOutUser, Request.Request.Price(rq.SalesPricePDay), Request.Request.Price(rq.SalesPricePWeek), Request.Request.Price(rq.SalesPricePMonth), 1).ToString() + cur;
            }
            Title       = rq.Title;
            Price       = rRq.PriceUser;
            Thumb       = Accommodation.Likibu.Offer.StringToArray(rq.Accommodation.AccomProfile.Thumbnails).FirstOrDefault();
            Roomtype    = rRq.RoomType.ToString();
            BedRooms    = rq.Accommodation.AccomProfile.BedRooms;
            RqOwnerPrev = rqOwnerPrev;
            Status      = rRq.RoomRequestResponse.StatusString;
            Rstate      = rRq.RoomRequestResponse.responseStatus;
        }