Ejemplo n.º 1
0
 /// <summary>
 /// This method sets booking dates
 /// </summary>
 public void SetBookingDates(Bookingdates bookingdates)
 {
     this.bookingdates = bookingdates;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor with parameters for Booking class
 /// </summary>
 public Booking(string firstname, string lastname, int totalprice, bool depositpaid, Bookingdates bookingdates, string additionalneeds)
 {
     this.firstname       = firstname;
     this.lastname        = lastname;
     this.totalprice      = totalprice;
     this.depositpaid     = depositpaid;
     this.bookingdates    = bookingdates;
     this.additionalneeds = additionalneeds;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Converts different parameters into booking xml format and converts the xml value to string
        /// </summary>
        public string CreateBookinginXMLFormat(string firstname, string lastname, int totalprice, bool depositpaid, Bookingdates bookingdates, string additionalneeds)
        {
            string checkindate  = bookingdates.checkin.Year.ToString() + "-" + ((bookingdates.checkin.Month.ToString().Length > 1) ? bookingdates.checkin.Month.ToString() : "0" + bookingdates.checkin.Month.ToString()) + "-" + ((bookingdates.checkin.Day.ToString().Length > 1) ? bookingdates.checkin.Day.ToString() : "0" + bookingdates.checkin.Day.ToString());
            string checkoutdate = bookingdates.checkout.Year.ToString() + "-" + ((bookingdates.checkin.Month.ToString().Length > 1) ? bookingdates.checkin.Month.ToString() : "0" + bookingdates.checkin.Month.ToString()) + "-" + ((bookingdates.checkout.Day.ToString().Length > 1) ? bookingdates.checkout.Day.ToString() : "0" + bookingdates.checkout.Day.ToString());

            return("<booking>" +
                   "<firstname>" + firstname + "</firstname>" +
                   "<lastname>" + lastname + "</lastname>" +
                   "<totalprice>" + totalprice.ToString() + "</totalprice>" +
                   "<depositpaid>" + depositpaid.ToString().ToLowerInvariant() + "</depositpaid>" +
                   "<bookingdates>" +
                   "<checkin>" + checkindate + "</checkin>" +
                   "<checkout>" + checkoutdate + "</checkout>" +
                   "</bookingdates>" +
                   "<additionalneeds>" + additionalneeds + "</additionalneeds>" +
                   "</booking>");
        }