public static void ParseRoom(RoomXml input, List<ContentProviderOperation> batch, ContentResolver resolver)
		{
			ContentProviderOperation.Builder builder = ContentProviderOperation.NewInsert(ScheduleContract.Rooms.CONTENT_URI);
	
	        builder.WithValue(ScheduleContract.Rooms.ROOM_ID, input.Id);
	        builder.WithValue(ScheduleContract.Rooms.ROOM_NAME, input.Name);
	        builder.WithValue(ScheduleContract.Rooms.ROOM_FLOOR, input.Floor);
			
			batch.Add(builder.Build());
		}
예제 #2
0
        public static void ParseRoom(RoomXml input, List <ContentProviderOperation> batch, ContentResolver resolver)
        {
            ContentProviderOperation.Builder builder = ContentProviderOperation.NewInsert(ScheduleContract.Rooms.CONTENT_URI);

            builder.WithValue(ScheduleContract.Rooms.ROOM_ID, input.Id);
            builder.WithValue(ScheduleContract.Rooms.ROOM_NAME, input.Name);
            builder.WithValue(ScheduleContract.Rooms.ROOM_FLOOR, input.Floor);

            batch.Add(builder.Build());
        }
예제 #3
0
        /// <summary>
        /// THis Method is used for Cancellation for RoomXML
        /// </summary>
        /// <param name="bookingId"></param>
        /// <returns></returns>
        private BookingCancelResponse CancelHotelBooking(string bookingId)
        {
            StringBuilder xmlString = new StringBuilder();

            xmlString.Append("<?xml version='1.0' encoding='UTF-8'?>");
            xmlString.Append("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>");
            xmlString.Append("<soap:Body>");
            xmlString.Append("<BookingCancel xmlns='http://www.reservwire.com/namespace/WebServices/Xml'>");
            xmlString.Append("<xiRequest>");
            xmlString.Append("<Authority>");
            xmlString.Append("<Org>" + WebConfigurationManager.AppSettings["Org"] + "</Org>");
            xmlString.Append("<User>" + WebConfigurationManager.AppSettings["User"] + "</User>");
            xmlString.Append("<Password>" + WebConfigurationManager.AppSettings["Password"] + "</Password>");
            xmlString.Append("<Currency>USD</Currency>");
            xmlString.Append("<TestMode>" + WebConfigurationManager.AppSettings["TestMode"] + "</TestMode>");
            xmlString.Append("<TestDebug>false</TestDebug>");
            xmlString.Append("<Version>1.25</Version>");
            xmlString.Append("</Authority>");
            xmlString.Append("<BookingId>" + bookingId + "</BookingId>");
            xmlString.Append("<CommitLevel>confirm</CommitLevel>");
            xmlString.Append("</xiRequest>");
            xmlString.Append("</BookingCancel>");
            xmlString.Append("</soap:Body>");
            xmlString.Append("</soap:Envelope>");

            XmlDocument soapEnvelopeXml = new XmlDocument();

            soapEnvelopeXml.LoadXml(Convert.ToString(xmlString));

            string type     = "BookingCancel";
            string response = RoomXml.SendSOAPRequest(soapEnvelopeXml.InnerXml, type);

            XmlDocument lXMLDoc = new XmlDocument();

            lXMLDoc.LoadXml(response);

            var           Value             = XDocument.Parse(lXMLDoc.OuterXml);
            XNamespace    ns                = @"http://schemas.xmlsoap.org/soap/envelope/";
            var           unwrappedResponse = Value.Descendants((XNamespace)"http://schemas.xmlsoap.org/soap/envelope/" + "Body").First().FirstNode;
            XmlSerializer oXmlSerializer    = new XmlSerializer(typeof(BookingCancelResponse));
            var           responseObj       = (BookingCancelResponse)oXmlSerializer.Deserialize(unwrappedResponse.CreateReader());


            return(responseObj);
        }