/// <summary>
 /// Converts an XmlDocument into an XDocument.
 /// </summary>
 /// <param name="xmlDocument">The XmlDocument to operate on.</param>
 /// <returns>The converted System.Xml.Linq.XDocument</returns>
 public static XDocument ToXDocument(this XmlDocument xmlDocument)
 {
     using (var nodeReader = new XmlNodeReader(xmlDocument))
     {
         nodeReader.MoveToContent();
         return XDocument.Load(nodeReader);
     }
 }
 public static DataTable getxmlvalue ( string str )
 {
     string xml = str;
     XmlDocument xdoc = new XmlDocument ( );
     xdoc.LoadXml ( "<root>"+xml+"</root>" );
     DataTable dt = new DataTable ( );
     XmlNodeReader xmlReader = new XmlNodeReader ( xdoc );
     DataSet dataSet = new DataSet ( );
     dataSet.ReadXml ( xmlReader );
     dt = dataSet.Tables[0];
    
     return dt;
 }
示例#3
0
文件: XsdConvert.cs 项目: 1tgr/blog
    public static object ConvertFrom(string value, string xsdType)
    {
        XmlDocument doc = new XmlDocument();
        XmlElement rootElement = (XmlElement) doc.AppendChild(doc.CreateElement("XmlValueWrapper"));
        rootElement.SetAttribute("xmlns:xs", "http://www.w3.org/2001/XMLSchema");

        XmlElement valueElement = (XmlElement) rootElement.AppendChild(doc.CreateElement("Value"));
        valueElement.SetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance", xsdType);
        valueElement.AppendChild(doc.CreateTextNode(value));

        using (XmlNodeReader reader = new XmlNodeReader(doc))
        {
            XmlValueWrapper wrapper = (XmlValueWrapper) serializer.Deserialize(reader);
            return wrapper.Value;
        }
    }
 public DataSet ListProducts(string guid, string baskedId)
 {
     HttpWebRequest request = (HttpWebRequest)WebRequest.Create
         ("http://staging.buysmart.co.in/hydrasales/services/thirdpartyapi.asmx/ListProducts?GUID=" + guid + "&basketID=" + baskedId);
     request.Method = "GET";
     HttpWebResponse response = (HttpWebResponse)request.GetResponse();
     DataSet ds = null;
     if (response.StatusCode == HttpStatusCode.OK)
     {
         StreamReader responseReader = new StreamReader(response.GetResponseStream());
         string responseData = responseReader.ReadToEnd();
         XmlDocument doc = new XmlDocument();
         doc.LoadXml(responseData);
         XmlNodeReader xmlReader = new XmlNodeReader(doc);
         ds = new DataSet();
         ds.ReadXml(xmlReader);
     }
     return ds;
 }
示例#5
0
        public static void Read(XmlDocument xml)
        {
            List <DecModel> list = new List <DecModel>();

            //XNamespace ns = "HTTP://CLIS.HB_DEC";

            using (var nodeReader = new XmlNodeReader(xml))
            {
                nodeReader.MoveToContent();
                XDocument xdoc = XDocument.Load(nodeReader);

                var orderno    = xdoc.Descendants("ERP_OBJECT_ID").First().Value;
                var preno      = xdoc.Descendants("PRE_GATEPASS_NO").First().Value;
                var gatepassno = xdoc.Descendants("GATEPASS_NO").First().Value;

                if (orderno.Length > 0 && gatepassno.Length > 0)
                {
                    SqlHelper.UpdateCLSStatus(orderno, gatepassno
                                              );
                }
            }
        }
示例#6
0
        /// <summary>
        /// Builds an xml document from API calls to Unfuddle.com then runs them through an Xslt to format them.
        /// </summary>
        /// <returns>An html string that contains the tables to display the ticket information, or null</returns>
        private string LoadUnfuddleTicketsFromWeb()
        {
            var xml = BuildXmlFromApiCalls();

            if (xml == null)
            {
                return(null);
            }

            string results;

            using (var sw = new StringWriter()) {
                using (var xnr = new XmlNodeReader(xml)) {
                    _xslTransform.Transform(xnr, null, sw);
                }
                results = sw.ToString();
            }

            HttpContext.Current.Cache.Add("UnfuddleTicketsStore", results, null, DateTime.Now.AddMinutes(10),
                                          Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
            return(results);
        }
示例#7
0
        private IEnumerable <ClaimsIdentity> CreateClaims()
        {
            ThrowOnNotValid();

            foreach (XmlElement assertionNode in xmlDocument.DocumentElement.ChildNodes.Cast <XmlElement>()
                     .Where(xe => xe.LocalName == "Assertion" && xe.NamespaceURI == Saml2Namespaces.Saml2Name))
            {
                using (var reader = new XmlNodeReader(assertionNode))
                {
                    MorePublicSaml2SecurityTokenHandler handler = MorePublicSaml2SecurityTokenHandler.DefaultInstance;

                    var token = (Saml2SecurityToken)MorePublicSaml2SecurityTokenHandler.DefaultInstance.ReadToken(reader);
                    handler.DetectReplayedToken(token);

                    var validateAudience = token.Assertion.Conditions.AudienceRestrictions.Count > 0;

                    handler.ValidateConditions(token.Assertion.Conditions, validateAudience);

                    yield return(handler.CreateClaims(token));
                }
            }
        }
示例#8
0
        /// <summary>
        /// 開始反序列化
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="DeseStr"></param>
        /// <returns></returns>
        public T Start <T>(string DeseStr)
        {
            XmlDocument doc = null;

            XmlNodeReader reader = null;

            XmlSerializer ser = null;

            try
            {
                doc = new XmlDocument();
                doc.LoadXml(DeseStr);
                reader = new XmlNodeReader(doc.DocumentElement);
                ser    = new XmlSerializer(typeof(T));
                object obj = ser.Deserialize(reader);
                return((T)obj);
            }
            catch
            {
                return(default(T));
            }
            finally
            {
                if (doc != null)
                {
                    doc = null;
                }

                if (reader != null)
                {
                    reader = null;
                }

                if (ser != null)
                {
                    ser = null;
                }
            }
        }
示例#9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="doc"></param>
        /// <returns></returns>
        private XmlDocument RemoveXmlns(XmlDocument doc)
        {
            XDocument d;

            using (var nodeReader = new XmlNodeReader(doc))
                d = XDocument.Load(nodeReader);

            d.Root.Attributes().Where(x => x.IsNamespaceDeclaration).Remove();
            d.Root.Descendants().Attributes().Where(x => x.IsNamespaceDeclaration).Remove();

            foreach (var elem in d.Descendants())
            {
                elem.Name = elem.Name.LocalName;
            }

            var xmlDocument = new XmlDocument();

            using (var xmlReader = d.CreateReader())
                xmlDocument.Load(xmlReader);

            return(xmlDocument);
        }
示例#10
0
        public static T ReadLicense <T>(string licensePublicKey, string xmlFileContent) where T : class
        {
            var doc = new XmlDocument();

            doc.LoadXml(xmlFileContent);

            using (var provider = new RSACryptoServiceProvider())
            {
                provider.FromXml(licensePublicKey);

                var nsmgr = new XmlNamespaceManager(doc.NameTable);
                nsmgr.AddNamespace("sig", "http://www.w3.org/2000/09/xmldsig#");

                var xml           = new SignedXml(doc);
                var signatureNode = (XmlElement)doc.SelectSingleNode("//sig:Signature", nsmgr);
                if (signatureNode == null)
                {
                    throw new InvalidOperationException("This license file is not signed.");
                }

                xml.LoadXml(signatureNode);
                if (!xml.CheckSignature(provider))
                {
                    throw new InvalidOperationException("This license file is not valid.");
                }

                var ourXml = xml.GetXml();
                if (ourXml.OwnerDocument?.DocumentElement == null)
                {
                    throw new InvalidOperationException("This license file is coruppted.");
                }

                using (var reader = new XmlNodeReader(ourXml.OwnerDocument.DocumentElement))
                {
                    var xmlSerializer = new XmlSerializer(typeof(T));
                    return((T)xmlSerializer.Deserialize(reader));
                }
            }
        }
示例#11
0
        private void LoadAssembly(string dllPath)
        {
            Logger.Verbose("Loading assembly at {0}", dllPath);

            var ass = LoadContext.LoadFromAssemblyPath(dllPath);

            var xmlFile = new FileInfo(Path.ChangeExtension(dllPath, "xml"));

            if (xmlFile.Exists)
            {
                LoadXml(xmlFile.FullName);
            }

            foreach (var type in ass.ExportedTypes)
            {
                ReferenceTypes.Add(type);
            }

            void LoadXml(string path)
            {
                var doc = new XmlDocument();

                doc.Load(path);

                var membersNode = doc["doc"]["members"];

                if (membersNode == null)
                {
                    throw new Exception("Invalid XML documentation file");
                }

                using var reader = new XmlNodeReader(membersNode);

                foreach (var data in Ingestion.Load(reader))
                {
                    ReferenceData[data.Name.XmlKey] = data;
                }
            }
        }
示例#12
0
        public void SchemasWithNoSourceURIOneLoadedFromXmlSchemaReadOtherFromDOMDiffTNS()
        {
            XmlSchemaSet sc = new XmlSchemaSet();
            //first schema
            XmlSchema schema = XmlSchema.Read(new StringReader(@"<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' targetNamespace='bar'><xsd:element name='author1' type='xsd:string'/></xsd:schema>"), null);
            XmlSchema temp   = sc.Add(schema);

            Assert.Equal("bar", temp.TargetNamespace);

            //second schema
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' targetNamespace='foo'><xsd:element name='author2' type='xsd:boolean'/></xsd:schema>");
            XmlNode       root   = doc.FirstChild;
            XmlNodeReader reader = new XmlNodeReader(root);

            temp = sc.Add(null, reader);
            Assert.Equal("foo", temp.TargetNamespace);
            Assert.Equal(2, sc.Count);

            sc.Compile();
        }
示例#13
0
        public void RegressionTest1()
        {
            XmlSchemaSet sc = new XmlSchemaSet();

            //first schema
            XmlSchema schema = XmlSchema.Read(new StringReader(@"<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' targetNamespace='bar'><xsd:element name='author1' type='xsd:string'/></xsd:schema>"), null);

            Assert.Equal("bar", sc.Add(schema).TargetNamespace);
            Assert.Equal(1, sc.Count);

            //second schema
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' targetNamespace='foo'><xsd:element name='author2' type='xsd:boolean'/></xsd:schema>");

            XmlNode       root   = doc.FirstChild;
            XmlNodeReader reader = new XmlNodeReader(root);

            Assert.Equal("foo", sc.Add(null, reader).TargetNamespace);
            sc.Compile();
            Assert.Equal(2, sc.Count);
        }
示例#14
0
  public static void Main()
  {
    XmlNodeReader reader = null;

    try
    {
       //Create and load the XML document.
       XmlDocument doc = new XmlDocument();
       doc.LoadXml("<book xmlns:bk='urn:samples'> " +
                   "<title>Pride And Prejudice</title>" +
                   "<bk:genre>novel</bk:genre>" +
                   "</book>"); 

       //Load the XmlNodeReader 
       reader = new XmlNodeReader(doc);
  
       //Parse the XML.  If they exist, display the prefix and  
       //namespace URI of each node.
       while (reader.Read()){
         if (reader.IsStartElement()){
           if (reader.Prefix==String.Empty)
                    {
                        Console.WriteLine("<{0}>", reader.LocalName);
                    }
                    else
                    {
               Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName);
               Console.WriteLine(" The namespace URI is " + reader.NamespaceURI);
           }
         }
       }
     } 
     finally 
     {
        if (reader != null)
          reader.Close();
      }
  }
示例#15
0
        private string GetCSVOutofJson(string jsonString)
        {
            string delimator = ",";
            var    result    = new StringBuilder();

            XmlNode xml = JsonConvert.DeserializeXmlNode("{records:{record:" + jsonString + "}}");

            XmlDocument xmldoc = new XmlDocument();

            // Create XmlDoc Object
            xmldoc.LoadXml(xml.InnerXml);

            // Create XML Steam
            var     xmlReader = new XmlNodeReader(xmldoc);
            DataSet dataSet   = new DataSet();

            // Load Dataset with Xml
            dataSet.ReadXml(xmlReader);

            var table = dataSet.Tables[0];

            for (int i = 0; i < table.Columns.Count; i++)
            {
                result.Append(table.Columns[i].ColumnName);
                result.Append(i == table.Columns.Count - 1 ? "\n" : delimator);
            }

            foreach (DataRow row in table.Rows)
            {
                for (int i = 0; i < table.Columns.Count; i++)
                {
                    result.Append(row[i].ToString().Contains(delimator) ? "\"" + row[i].ToString() + "\"" : row[i].ToString());
                    result.Append(i == table.Columns.Count - 1 ? "\n" : delimator);
                }
            }

            return(result.ToString().TrimEnd(new char[] { '\r', '\n' }));
        }
示例#16
0
        public Pcity GetCityByCode(string xmlurl, string fcode, string code)
        {
            Pcity       pc  = new Pcity();
            XmlDocument xdd = new XmlDocument();

            xdd.Load(xmlurl);
            XmlReader dr = new XmlNodeReader(xdd);

            while (dr.Read())
            {
                if (dr.NodeType == XmlNodeType.Element)
                {
                    if (dr.Name == "city")
                    {
                        if (dr.MoveToAttribute("fcode"))
                        {
                            if (dr.Value == fcode)
                            {
                                pc.Fcode = dr.Value;
                                if (dr.MoveToAttribute("code"))
                                {
                                    if (dr.Value == code)
                                    {
                                        pc.Code = dr.Value;
                                        if (dr.MoveToAttribute("name"))
                                        {
                                            pc.Name = dr.Value;
                                            return(pc);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(pc);
        }
示例#17
0
        public Project(IManager manager, string fileName)
        {
            mManager  = manager;
            mRootItem = new RootItem(this);

            mProjectName         = Path.GetFileName(fileName);
            mUserDocument        = LoadUserConfig(fileName);
            mUserOptionsDatabase = new XmlOptionsDatabase((XmlElement)mUserDocument.SelectSingleNode("UserConfiguration"));

            XmlElement vcsConfig = GetUserConfigurationXML("VersionControl");

            if (vcsConfig != null)
            {
                Type vcsType = ReflectionUtils.FindType(vcsConfig.GetAttribute("type"));
                if (vcsType != null)
                {
                    XmlSerializer serializer = new XmlSerializer(vcsType);
                    XmlReader     reader     = new XmlNodeReader(vcsConfig.FirstChild);
                    VCS = (IVersionController)serializer.Deserialize(reader);
                }
            }

//          XmlElement vcsConfig = GetUserConfigurationXML("VersionControl");
//          Type vcsType = null;
//          if (vcsConfig != null)
//              vcsType = ReflectionUtils.FindType(vcsConfig.GetAttribute("type"));
//
//          if (vcsType != null)
//          {
//              XmlSerializer serializer = new XmlSerializer(vcsType);
//              XmlReader reader = new XmlNodeReader(vcsConfig.FirstChild);
//              VCS = (IVersionController) serializer.Deserialize(reader);
//          }
//          else
//          {
//              System.Windows.Forms.MessageBox.Show("Would you like to configure source control for this project?");
//          }
        }
        public EvaluationResult evaluateExpression(XmlElement expressionDoc, IContext context)
        {
            // first deserialize expression into a PolicyReference instance
            PolicyReference expression = null;

            try
            {
                XmlNodeReader reader = new XmlNodeReader(expressionDoc);
                expression = (PolicyReference)serializer.Deserialize(reader);
            }
            catch (Exception e)
            {
                throw new PolicyManagerException("Could not deserialize PolicyReference node", e);
            }

            // TODO: load policy reference from DB
            try
            {
                AccessPolicy policy = policyDAO.GetPolicy(expression.policyId);

                if (policy == null)
                {
                    return(new EvaluationResult(TAG, false, "Policy with id " + expression.policyId + " not found in database."));
                }
                else
                {
                    string           policyDoc = policy.Document;
                    EvaluationResult result    = PolicyManager.evaluatePolicy(policyDoc, context);
                    ArrayList        list      = new ArrayList();
                    list.Add(result);
                    return(new EvaluationResult(TAG, result.Result, "Evaluated policy id " + expression.policyId, list));
                }
            }
            catch (PolicyManagerException e)
            {
                return(new EvaluationResult(TAG, false, "Could not evaluate policy id " + expression.policyId + ": " + e));
            }
        }
示例#19
0
  public static void Main()
  {
    XmlNodeReader reader = null;

    try
    {
       //Create and load the XML document.
       XmlDocument doc = new XmlDocument();
       doc.LoadXml("<book genre='novel' ISBN='1-861003-78'> " +
                   "<title>Pride And Prejudice</title>" +
                   "<price>19.95</price>" +
                   "</book>"); 

       //Load the XmlNodeReader 
       reader = new XmlNodeReader(doc);
  
       //Read the attributes on the book element.
       reader.MoveToContent();
       while (reader.MoveToNextAttribute())
       {
         Console.WriteLine("{0} = {1}", reader.Name, reader.Value);
       }

       //Move the reader to the title element.
       reader.Read();

       //Read the title and price elements.
       Console.WriteLine(reader.ReadElementString());
       Console.WriteLine(reader.ReadElementString());

     } 

     finally 
     {
        if (reader != null)
          reader.Close();
      }
  }
        /// <summary>
        /// Parses an IM log file and sends the information to GDS
        /// </summary>
        /// <param name="logFile">The IM conversations log file</param>
        /// <param name="lastIndexed">messages older than this will not be sent to GDS</param>
        private void ParseAndSendMessages(string logFile, DateTime lastIndexed)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(logFile);
            XmlNodeReader reader = new XmlNodeReader(doc);

            // reset user and buddy name
            userName  = null;
            buddyName = null;

            // Moves the reader to the root element.
            reader.MoveToContent();

            // move to the first message
            reader.Read();

            while (reader.LocalName == "Message")
            {
                // check the date of the message - if older skip
                reader.MoveToAttribute("DateTime");
                DateTime messageDateTime = DateTime.Parse(reader.Value);
                reader.MoveToElement();

                // if older than the last indexing time, skip the message
                if (messageDateTime.CompareTo(lastIndexed) <= 0)
                {
                    reader.Skip();
                    continue;
                }

                // get message data
                MSNMessageData messageData = ParseMessageData(reader.ReadOuterXml());

                // send this message to GDS for indexing
                SendMessageData(messageData);
            }
        }
示例#21
0
        private static Toc GetNamespaceToc(string assetId, string version = "VS.110", string locale = "en-us")
        {
            var docType     = documentTypes.primary;
            var docSelector = "Mtps.Toc";

            // prepare request
            var request = new getContentRequest
            {
                contentIdentifier  = assetId,
                locale             = locale,
                version            = version,
                requestedDocuments = new[]
                {
                    new requestedDocument
                    {
                        type     = docType,
                        selector = docSelector
                    }
                }
            };

            // get response
            var response = ContentServiceClient.GetContent(new appId(), request);

            // extract primary document
            foreach (var doc in response.primaryDocuments)
            {
                if (doc.primaryFormat == docSelector)
                {
                    var tocElement = doc.Any;
                    var serializer = new XmlSerializer(typeof(Toc));
                    var reader     = new XmlNodeReader(tocElement);
                    return((Toc)serializer.Deserialize(reader));
                }
            }

            return(null);
        }
示例#22
0
    public static void Main()
    {
        // XAML string that defines the WPF controls
        string strXAML = @"
<Window
	xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
	xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
	x:Name=""Window"" Title=""Test program for Windows Presentation Framework"" WindowStartupLocation = ""CenterScreen""
	Width = ""800"" Height = ""600"" ShowInTaskbar = ""True"">
	<TextBlock TextAlignment=""Center"" VerticalAlignment=""Center"" Foreground=""Black"" FontSize=""40"" HorizontalAlignment=""Center"">
	  <TextBlock.Effect><DropShadowEffect ShadowDepth=""4"" Color=""DarkGray"" BlurRadius=""4""/></TextBlock.Effect>
		Test program for<LineBreak/><LineBreak/>Windows Presentation Framework
	</TextBlock>
</Window>";

        // prepare XML document
        XmlDocument XAML = new XmlDocument();

        // read XAML string
        XAML.LoadXml(strXAML);
        // and convert to XML
        XmlNodeReader XMLReader = new XmlNodeReader(XAML);
        // generate WPF object tree
        Window objWindow;

        try
        {               // set XAML root object
            objWindow = (Window)XamlReader.Load(XMLReader);
        }
        catch
        {         // XamlReader generates an exception on error in XAML definition
            MessageBox.Show("Error while creating the WPF controls out of the XAML description", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            return;
        }

        // and show WPF window
        objWindow.ShowDialog();
    }
示例#23
0
 private string SendCommand(string message)
 {
     try
     {
         if (oNativeModeClient.Connected)
         {
             if (message != null && message.Length > 0)
             {
                 string response = oNativeModeClient.SendCommand(message.Trim());
             }
         }
         XmlNodeReader nrdr = oNativeModeClient.LastResponseReader;
         if (nrdr != null && nrdr.ReadToFollowing("Status"))
         {
             if (nrdr.ReadElementContentAsString().Equals("1"))
             {
                 return(nrdr.ReadElementContentAsString());
             }
         }
         else
         {
             return("未连接");
         }
     }
     catch (Cognex.InSight.NativeMode.CvsNativeModeResponseException resEx)
     {
         return("输入参数无效");
     }
     catch (Cognex.InSight.NativeMode.CvsNativeModeTimeoutException timEx)
     {
         return("超时");
     }
     catch (CvsNetworkException notConnected)
     {
         return("未连接");
     }
     return("未找到");
 }
示例#24
0
        public void NodeReaderLookupNamespaceWithValidXml()
        {
            string xml = "<book xmlns:bk='urn:samples'> " +
                         "<title>Pride And Prejudice</title>" +
                         "<bk:genre>novel</bk:genre>" +
                         "</book>";
            XmlNodeReader nodeReader = NodeReaderTestHelper.CreateNodeReader(xml);

            Assert.Equal(string.Empty, nodeReader.LocalName);
            Assert.Equal(string.Empty, nodeReader.Name);
            Assert.Equal(string.Empty, nodeReader.NamespaceURI);
            Assert.Equal(string.Empty, nodeReader.Prefix);
            var namespaceResolver = nodeReader as IXmlNamespaceResolver;

            Assert.Equal(string.Empty, namespaceResolver.LookupNamespace(string.Empty));

            Assert.True(nodeReader.Read());
            Assert.True(nodeReader.Read());
            Assert.True(nodeReader.Read());
            Assert.Null(nodeReader.LookupNamespace(string.Empty));
            namespaceResolver = nodeReader as IXmlNamespaceResolver;
            Assert.Equal(string.Empty, namespaceResolver.LookupNamespace(string.Empty));

            Assert.True(nodeReader.Read());
            Assert.True(nodeReader.Read());
            Assert.Equal("genre", nodeReader.LocalName);
            Assert.Equal("bk:genre", nodeReader.Name);
            Assert.Equal("urn:samples", nodeReader.LookupNamespace(nodeReader.Prefix));
            Assert.Equal("bk", nodeReader.Prefix);

            namespaceResolver = nodeReader as IXmlNamespaceResolver;
            Assert.Equal("bk", namespaceResolver.LookupPrefix("urn:samples"));
            Assert.Equal("urn:samples", namespaceResolver.LookupNamespace("bk"));
            IDictionary <string, string> namespaces = namespaceResolver.GetNamespacesInScope(XmlNamespaceScope.All);

            Assert.True(namespaces.ContainsKey("bk") && namespaces["bk"].Equals("urn:samples"));
            Assert.True(namespaces.ContainsKey("xml"));
        }
示例#25
0
 public static bool TryLoadXaml <TElement>(this XmlDocument source, out TElement element, out ErrorRecord error) //where T1 : FrameworkElement
 {
     error   = default(ErrorRecord);
     element = default(TElement);
     try
     {
         using (var reader = new XmlNodeReader(source))
         {
             var loaded = XamlReader.Load(reader);
             if (loaded is TElement)
             {
                 element = (TElement)loaded;
                 return(true);
             }
             error = new ErrorRecord(new ArgumentException("Template file doesn't yield FrameworkElement", nameof(source)), "Can't DataBind", ErrorCategory.MetadataError, loaded);
         }
     }
     catch (Exception ex)
     {
         error = new ErrorRecord(ex, "Loading Xaml", ErrorCategory.SyntaxError, source);
     }
     return(false);
 }
示例#26
0
        public void NodeReaderReadWithEntityXml()
        {
            string        fst        = "<!ENTITY fst 'Sample String'>]>";
            string        dtd        = "<!DOCTYPE root[<!ELEMENT root (#PCDATA)>" + fst;
            string        xml        = dtd + "<root>&fst;</root>";
            XmlNodeReader nodeReader = NodeReaderTestHelper.CreateNodeReader(xml);

            Assert.True(nodeReader.Read()); //DTD Read
            Assert.Equal(ReadState.Interactive, nodeReader.ReadState);
            Assert.Equal(XmlNodeType.DocumentType, nodeReader.NodeType);

            Assert.True(nodeReader.Read()); //Root Element Read
            Assert.Equal("root", nodeReader.Name);
            Assert.Equal(ReadState.Interactive, nodeReader.ReadState);
            Assert.Equal(XmlNodeType.Element, nodeReader.NodeType);

            Assert.True(nodeReader.Read()); //EntityReference Read
            Assert.Equal(ReadState.Interactive, nodeReader.ReadState);
            Assert.Equal(XmlNodeType.EntityReference, nodeReader.NodeType);
            Assert.False(nodeReader.IsDefault);
            Assert.Equal("fst", nodeReader.Name);
            Assert.Equal("fst", nodeReader.LocalName);
        }
示例#27
0
        public static SqlXml generateKeys(SqlString keySize, SqlString network)
        {
            AsymmetricCipherKeyPair key = BCFunctions.GenerateKeys(Convert.ToInt16(keySize.ToString()));

            ECPublicKeyParameters  publicKeyParam  = (ECPublicKeyParameters)key.Public;
            ECPrivateKeyParameters privateKeyParam = (ECPrivateKeyParameters)key.Private;

            var        privateKey = privateKeyParam.D.ToString();
            BigInteger d          = new BigInteger(privateKey, 10);

            var publicKey = BCFunctions.RetrievePublicKey(keySize.ToString(), d);

            var addressText = "0x" + BitConverter.ToString(BCFunctions.Hash(publicKey, network.ToString())).Replace("-", "");

            var         r      = "<sqroot><D>" + privateKey + "</D><Q>" + publicKey + "</Q><A>" + addressText + "</A></sqroot>";
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(r);
            XmlNodeReader xnr = new XmlNodeReader(xmlDoc);
            SqlXml        rx  = new SqlXml(xnr);

            return(rx);
        }
示例#28
0
        public static T CreateInstance <T>(string serializedType) where T : new()
        {
            var customType = new T();

            var serializer = new XmlSerializer(typeof(T));

            var xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(serializedType);
            var xmlNodeReader = new XmlNodeReader(xmlDocument);

            try
            {
                customType = (T)serializer.Deserialize(xmlNodeReader);
            }
            catch
            {
                // TODO: Add Logging etc here...
                throw;
            }

            return(customType);
        }
示例#29
0
 /// <summary>
 ///     读取XML资源中指定的DataTable的指定行指定列的值
 /// </summary>
 /// <param name="source">XML资源</param>
 /// <param name="xmlType">XML资源类型:文件,字符串</param>
 /// <param name="tableName">表名</param>
 /// <param name="rowIndex">行号</param>
 /// <param name="colIndex">列号</param>
 /// <returns>值,不存在时返回Null</returns>
 public static object GetTableCell(string source, XmlType xmlType, string tableName, int rowIndex, int colIndex)
 {
     try
     {
         var dataSet = new DataSet();
         if (xmlType == XmlType.File)
         {
             dataSet.ReadXml(source);
         }
         else
         {
             var xmlDocument = new XmlDocument();
             xmlDocument.LoadXml(source);
             var xmlNodeReader = new XmlNodeReader(xmlDocument);
             dataSet.ReadXml(xmlNodeReader);
         }
         return(dataSet.Tables[tableName].Rows[rowIndex][colIndex]);
     }
     catch (Exception exception)
     {
         return(null);
     }
 }
示例#30
0
        protected override bool SerializeToXmlElement(XmlWriter writer, String elementName)
        {
            bool dataToWrite = this.XmlElement != null;

            if (dataToWrite && writer != null)
            {
                if (!String.Equals(elementName, ConfigurationStrings.XmlElement, StringComparison.Ordinal))
                {
                    writer.WriteStartElement(elementName);
                }

                using (XmlNodeReader reader = new XmlNodeReader(this.XmlElement))
                {
                    writer.WriteNode(reader, false);
                }

                if (!String.Equals(elementName, ConfigurationStrings.XmlElement, StringComparison.Ordinal))
                {
                    writer.WriteEndElement();
                }
            }
            return(dataToWrite);
        }
示例#31
0
    static List<Book> GetAllBooks(string fileName)
    {
        XmlDocument xmlDocument = new XmlDocument();
        xmlDocument.Load(fileName);

        List<Book> books = new List<Book>();

        XmlNodeList xmlNodes = xmlDocument.GetElementsByTagName("book");

        foreach (XmlNode node in xmlNodes)
        {
            XmlNodeReader xmlNodeReader = new XmlNodeReader(node);

            xmlNodeReader.Read();
            xmlNodeReader.Read();

            Book newBook = XmlReadNext(xmlNodeReader);

            books.Add(newBook);
        }

        return books;
    }
示例#32
0
        DamageResistanceMacro ParseDamageResistanceMacro(string xmlFilename)
        {
            string rootNodeName;

            using (var reader = XmlReader.Create(new StreamReader(xmlFilename)))
            {
                reader.MoveToContent();
                rootNodeName = reader.Name;
            }

            var doc = new XmlDocument();

            doc.Load(xmlFilename);

            var serialiser = new XmlSerializer(typeof(DamageResistanceMacro), new XmlRootAttribute {
                ElementName = rootNodeName
            });

            using var stream = new XmlNodeReader(doc);
            var entity = (DamageResistanceMacro)serialiser.Deserialize(stream);

            return(entity);
        }
示例#33
0
 /// <summary>
 ///     读取XML资源到DataTable中
 /// </summary>
 /// <param name="source">XML资源,文件为路径,否则为XML字符串</param>
 /// <param name="xmlType">XML资源类型:文件,字符串</param>
 /// <param name="tableName">表名称</param>
 /// <returns>DataTable</returns>
 public static DataTable GetTable(string source, XmlType xmlType, string tableName)
 {
     try
     {
         var dataSet = new DataSet();
         if (xmlType == XmlType.File)
         {
             dataSet.ReadXml(source);
         }
         else
         {
             var xmlDocument = new XmlDocument();
             xmlDocument.LoadXml(source);
             var xmlNodeReader = new XmlNodeReader(xmlDocument);
             dataSet.ReadXml(xmlNodeReader);
         }
         return(dataSet.Tables[tableName]);
     }
     catch (Exception exception)
     {
         return(null);
     }
 }
示例#34
0
        public void InvalidConstruction()
        {
            XmlNodeReader nrdr;

            try
            {
                nrdr = new XmlNodeReader(null);
                Assert.Fail("null reference exception is preferable.");
            }
            catch (NullReferenceException)
            {
            }
            nrdr = new XmlNodeReader(new XmlDocument());
            nrdr.Read();
            Assert.AreEqual(ReadState.Error, nrdr.ReadState, "newDoc.ReadState");
            Assert.AreEqual(true, nrdr.EOF, "newDoc.EOF");
            Assert.AreEqual(XmlNodeType.None, nrdr.NodeType, "newDoc.NodeType");
            nrdr = new XmlNodeReader(document.CreateDocumentFragment());
            nrdr.Read();
            Assert.AreEqual(ReadState.Error, nrdr.ReadState, "Fragment.ReadState");
            Assert.AreEqual(true, nrdr.EOF, "Fragment.EOF");
            Assert.AreEqual(XmlNodeType.None, nrdr.NodeType, "Fragment.NodeType");
        }
示例#35
0
    /// <summary>
    /// Retrieves data from SharePoint server using web services.
    /// </summary>
    /// <returns>Dataset or XmlNode</returns>
    protected object GetSharePointData()
    {
        #region "Prepare credentials for authentication"

        ICredentials credentials = null;

        // If there are data in username or password use it for authentication
        if (String.IsNullOrEmpty(Username) && String.IsNullOrEmpty(Password))
        {
            credentials = SharePointFunctions.GetSharePointCredetials();
        }
        else
        {
            credentials = SharePointFunctions.GetSharePointCredetials(Username, Password, useBase64Encoding);
        }

        #endregion

        #region "Retrieve SharePoint data"

        string serviceURL = SPServiceURL;

        // If not direct web service specified, determine web service URL by mode
        if (!serviceURL.EndsWithCSafe(".asmx", true))
        {
            // Remove trailing slash
            serviceURL = serviceURL.TrimEnd('/');

            switch (Mode.ToLowerCSafe())
            {
                case MODE_LIST_ITEMS:
                case MODE_SITE_LISTS:
                    serviceURL += "/_vti_bin/lists.asmx";
                    break;

                case MODE_PICTURE_LIBRARIES:
                case MODE_PICTURE_LIBRARY_ITEMS:
                    serviceURL += "/_vti_bin/imaging.asmx";
                    break;
            }
        }

        // Query web service
        try
        {
            Lists spLists;
            Imaging spImaging;

            switch (Mode.ToLowerCSafe())
            {
                    // Load list items
                case MODE_LIST_ITEMS:

                    // Instantiate Lists service
                    spLists = new Lists(serviceURL);
                    spLists.Credentials = credentials;

                    camlData = LoadListItems(spLists, ListName);
                    break;

                    // Load site lists
                case MODE_SITE_LISTS:
                    // Instantiate Lists service
                    spLists = new Lists(serviceURL);
                    spLists.Credentials = credentials;

                    // Get all SharePoint lists
                    camlData = spLists.GetListCollection();
                    break;

                    // Load picture libraries
                case MODE_PICTURE_LIBRARIES:
                    // Instantiate imaging service
                    spImaging = new Imaging(serviceURL);
                    spImaging.Credentials = credentials;

                    // Get picture libraries
                    camlData = spImaging.ListPictureLibrary();
                    break;

                    // Load picture library items
                case MODE_PICTURE_LIBRARY_ITEMS:
                    // Instantiate imaging service
                    spImaging = new Imaging(serviceURL);
                    spImaging.Credentials = credentials;

                    // Show error if library name empty
                    if (String.IsNullOrEmpty(ListName))
                    {
                        DisplayError(ResHelper.GetString("SharePoint.picslibunspecified"));
                        break;
                    }

                    // Get pictures in libraries, directly (not in folder)
                    camlData = spImaging.GetListItems(ListName, null);
                    break;
            }
        }
        catch (Exception ex)
        {
            DisplayError(ResHelper.GetString("sharepoint.erroradta") + ResHelper.Colon + " " + ex.Message);
        }

        // No data
        if (camlData == null)
        {
            return null;
        }

        #endregion

        #region "Prepare data"

        // Use of XSLT transformation
        if (!UseClassicDataset)
        {
            dataSource = camlData;
        }
        // Use of classic dataset
        else
        {
            // Prepare dataset
            DataSet ds = new DataSet();

            // If datset fields are specified
            if (!String.IsNullOrEmpty(Fields))
            {
                DataTable dt = ds.Tables.Add();

                string[] fields = Fields.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (string field in fields)
                {
                    string currentField = field.Trim();
                    if (!string.IsNullOrEmpty(currentField))
                    {
                        try
                        {
                            dt.Columns.Add(field.Trim());
                        }
                        catch (DuplicateNameException)
                        {
                            mErrorMessage = ResHelper.GetString("sharepoint.duplicateField");
                        }
                    }
                }

                XmlNodeList records = GetDataRecords(camlData);

                List<string> fieldsCheck = new List<string>();
                fieldsCheck.AddRange(fields);

                // Load items to dataset
                foreach (XmlNode record in records)
                {
                    DataRow dr = dt.NewRow();

                    // Add fields
                    foreach (string field in fields)
                    {
                        string currentField = field.Trim();
                        if (!string.IsNullOrEmpty(currentField))
                        {
                            XmlAttribute attr = record.Attributes[currentField];
                            if (attr != null)
                            {
                                dr[currentField] = attr.Value;

                                // At least one record has the field
                                fieldsCheck.Remove(field);
                            }
                        }
                    }

                    dt.Rows.Add(dr);
                }

                // None of retrieved records has fields
                if (fieldsCheck.Count > 0)
                {
                    DisplayError(String.Format(ResHelper.GetString("sharepoint.fieldnotFound"), fieldsCheck[0]));
                    return null;
                }

                // Set daatsource
                dataSource = ds;
            }
            // No fields specified, use all fields
            else
            {
                // Only if CAML contains data record, otherwise dataset would contain wrong values
                if (HasData)
                {
                    camlData.InnerXml = SpecialCharsRegex.Replace(camlData.InnerXml, "_");
                    XmlNodeReader rd = new XmlNodeReader(camlData);
                    ds.ReadXml(rd);
                    rd.Close();

                    switch (Mode.ToLowerCSafe())
                    {
                            // Use last datatable as datasource
                        case MODE_LIST_ITEMS:

                            dataSource = ds.Tables[ds.Tables.Count - 1].DefaultView;
                            break;

                            // Filter hidden lists in dataset
                        case MODE_SITE_LISTS:
                            // Dataset structure changes based on xml, try to use last data table
                            DataTable dt = ds.Tables[ds.Tables.Count - 1];

                            // Show only visible lists
                            dt.DefaultView.RowFilter = "Hidden = 'False'";
                            dataSource = dt.DefaultView;
                            break;

                            // Dateset with picture libraries
                        case MODE_PICTURE_LIBRARIES:
                            dataSource = ds.Tables[ds.Tables.Count - 1].DefaultView;
                            break;

                            // Dataset with pictures
                        case MODE_PICTURE_LIBRARY_ITEMS:
                            dataSource = ds.Tables[ds.Tables.Count - 1].DefaultView;
                            break;
                    }
                }
            }
        }

        #endregion

        ShowRawResponse(camlData);

        return dataSource;
    }
示例#36
0
		public XElement Get(string query)
		{
			try
			{
				//if (!HttpContext.Current.User.Identity.IsAuthenticated)
				//    return ErrorResult("Please sign in first");

				var serviceConnectionString = ConfigurationManager.ConnectionStrings["DBService"];
				if (serviceConnectionString == null)
					return ErrorResult("No 'DBService' connection string");
				string connectionString = serviceConnectionString.ConnectionString;

				// Create a connection to the data source
				using (SqlConnection connection = new SqlConnection(connectionString))
				{
					connection.Open();
					if (connection.State != ConnectionState.Open)
						return ErrorResult("No open connection");

					using (SqlDataAdapter dataAdapter = new SqlDataAdapter(query, connection))
					{
						// "Root" is the root element name
						using (DataSet dataSet = new DataSet("Root"))
						{
							// "Row" is the name of each row in the set
							int rowCount = dataAdapter.Fill(dataSet, "Row");
							if (dataSet.Tables.Count > 0)
							{
								// Indicate we want columns mapped as Xml attributes instead of elements
								//j	foreach (DataColumn column in dataSet.Tables[0].Columns)
								foreach (DataTable table in dataSet.Tables)
									foreach (DataColumn column in table.Columns)
										column.ColumnMapping = MappingType.Attribute;
							}

							// Convert the DataSet into an XElement
#if true
							XElement element = XElement.Parse(dataSet.GetXml(), LoadOptions.None);
#else
							XElement element = null;
							XmlDataDocument xmlDataDocument = new XmlDataDocument(dataSet);
							using (XmlNodeReader reader = new XmlNodeReader(xmlDataDocument))
								element = element.Load(reader, LoadOptions.None);
#endif
							return element;
							//return ErrorResult("Test");
						}
					}
				}
			}
			catch (Exception ex)
			{
				return ErrorResult(ex.Message); //j + Environment.NewLine + Environment.NewLine + e.StackTrace);
			}
		}
示例#37
0
    private Game DeserializeToGame(string text)
    {
        try
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(text);

            Game obj = new Game();
            XmlSerializer serializer = new XmlSerializer(typeof(Game));
            XmlReader reader = new XmlNodeReader(doc);

            obj = serializer.Deserialize(reader) as Game;

            return obj;
        }
        catch (Exception)
        {
            return null;
        }
    }
    private DataSet GetIntBookingRequest()
    {
        DataSet ds = new DataSet();

        #region Variables

        string str = string.Empty;
        string FlightSegmentsID = string.Empty;
        string DepartureAirportCode = string.Empty;
        string ArrivalDateTime = string.Empty;
        string DepartureAirportName = string.Empty;
        string DepartureDateTime = string.Empty;
        string FlightNumber = string.Empty;
        string MarketingAirlineCode = string.Empty;
        string OperatingAirlineCode = string.Empty;
        string OperatingAirlineName = string.Empty;
        string OperatingAirlineFlightNumber = string.Empty;
        string NumStops = string.Empty;
        string LinkSellAgrmnt = string.Empty;
        string Conx = string.Empty;
        string AirpChg = string.Empty;
        string InsideAvailOption = string.Empty;
        string GenTrafRestriction = string.Empty;
        string DaysOperates = string.Empty;
        string JrnyTm = string.Empty;
        string EndDt = string.Empty;
        string StartTerminal = string.Empty;
        string EndTerminal = string.Empty;
        string FltTm = string.Empty;
        string LSAInd = string.Empty;
        string Mile = string.Empty;
        string Availability = string.Empty;
        string BIC = string.Empty;
        string bookingclass = string.Empty;
        string classType = string.Empty;
        string farebasiscode = string.Empty;
        string Rule = string.Empty;
        string PsgrType = string.Empty;
        string BaseFare = string.Empty;
        string Tax = string.Empty;
        string BagInfo = string.Empty;
        string AirEquipType = string.Empty;
        string ArrivalAirportCode = string.Empty;
        string ArrivalAirportName = string.Empty;
        string return1 = string.Empty;
        string id = string.Empty;
        string key = string.Empty;
        string ActualBaseFare = string.Empty;
        string FareTax = string.Empty;
        string STax = string.Empty;
        string TCharge = string.Empty;
        string SCharge = string.Empty;
        string TDiscount = string.Empty;
        string TMarkup = string.Empty;
        string TPartnerCommission = string.Empty;
        string TSdiscount = string.Empty;
        string FarePsgrType = string.Empty;
        string FareBaseFare = string.Empty;
        string FareTax1 = string.Empty;
        string Country = string.Empty;
        string Amt = string.Empty;
        string ocTax = string.Empty;
        string onwardId = string.Empty;
        string OriginDestinationOption_Id = string.Empty;
        string FareDetails_id = string.Empty;
        string FareBreakUp_Id = string.Empty;
        string FareAry_id = string.Empty;
        string FareId = string.Empty;
        string bookingclassFareId = string.Empty;
        string psgrBreakUp_Id = string.Empty;
        string psgrAy_id = string.Empty;
        string country = string.Empty;
        string taxAmt = string.Empty;
        string taxData = string.Empty;
        string taxDataAry_id = string.Empty;

        string faretype = string.Empty;

        string CFareId = string.Empty;
        string CPsgrType = string.Empty;
        string CBaseFare = string.Empty;
        string CFareTax = string.Empty;
        string IFareId = string.Empty;
        string IPsgrType = string.Empty;
        string IBaseFare = string.Empty;
        string IFareTax = string.Empty;

        string CFarePsgrType = string.Empty;
        string CFareBaseFare = string.Empty;
        string CFareTax1 = string.Empty;
        string CBagInfo = string.Empty;
        string IFarePsgrType = string.Empty;
        string IFareBaseFare = string.Empty;
        string IFareTax1 = string.Empty;
        string IBagInfo = string.Empty;
        string taxdatapsgr = string.Empty;

        #endregion
        try
        {
            dsIntFlights = (DataSet)Session["dsIntFlights"];
            string result = null;
            DataTable dtFlightSegment = dsIntFlights.Tables[12];
            if (dtFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegment_ID=" + Convert.ToInt32(lblIntFlightSegmentId.Text));
                FlightSegmentsID = rowFilghtSegment[0]["FlightSegments_Id"].ToString();

            }
            DataTable dtFlightSegments = dsIntFlights.Tables[11];
            if (dtFlightSegments.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegments = dtFlightSegments.Select("FlightSegments_ID=" + FlightSegmentsID);
                onwardId = rowFilghtSegments[0]["Onward_Id"].ToString();
            }
            DataTable dtOnward = dsIntFlights.Tables[10];
            if (dtOnward.Rows.Count > 0)
            {
                DataRow[] rowOnward = dtOnward.Select("Onward_Id=" + onwardId);
                OriginDestinationOption_Id = rowOnward[0]["OriginDestinationOption_Id"].ToString();
            }
            DataTable dtOriginDestinationOption = dsIntFlights.Tables[3];
            if (dtOriginDestinationOption.Rows.Count > 0)
            {
                DataRow[] rowOriginDestinationOption = dtOriginDestinationOption.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                return1 = rowOriginDestinationOption[0]["Return"].ToString();
                id = rowOriginDestinationOption[0]["id"].ToString();
                key = rowOriginDestinationOption[0]["key"].ToString();
            }
            DataTable dtFareDetails = dsIntFlights.Tables[4];
            if (dtFareDetails.Rows.Count > 0)
            {
                DataRow[] rowFareDetails = dtFareDetails.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                Tax = rowFareDetails[0]["Tax"].ToString();
                STax = rowFareDetails[0]["STax"].ToString();
                TCharge = rowFareDetails[0]["TCharge"].ToString();
                SCharge = rowFareDetails[0]["SCharge"].ToString();
                TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                ocTax = rowFareDetails[0]["ocTax"].ToString();
                FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
            }
            DataTable dtFareBreakUp = dsIntFlights.Tables[5];
            if (dtFareBreakUp.Rows.Count > 0)
            {
                DataRow[] rowFareBreakUp = dtFareBreakUp.Select("FareDetails_Id=" + FareDetails_id);
                FareBreakUp_Id = rowFareBreakUp[0]["FareBreakUp_Id"].ToString();

            }
            DataTable dtFareAry = dsIntFlights.Tables[6];
            if (dtFareAry.Rows.Count > 0)
            {
                DataRow[] rowFareAry = dtFareAry.Select("FareBreakUp_Id=" + FareBreakUp_Id);
                FareAry_id = rowFareAry[0]["FareAry_id"].ToString();
            }
            DataTable dtFare = dsIntFlights.Tables[7];
            if (dtFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtFare.Select("FareAry_id=" + FareAry_id);

                PsgrType = rowFare[0]["PsgrType"].ToString();
                BaseFare = rowFare[0]["BaseFare"].ToString();
                FareTax = rowFare[0]["Tax"].ToString();
                FareId = rowFare[0]["Fare_Id"].ToString();
                Session["FareId"] = FareId.ToString();

                foreach (DataRow dr in rowFare)
                {
                    if (faretype == "")
                    {
                        faretype = dr["PsgrType"].ToString() + "," + dr["BaseFare"].ToString() + "," + dr["Tax"].ToString();
                    }
                    else
                    {

                        faretype = faretype + ";" + dr["PsgrType"].ToString() + "," + dr["BaseFare"].ToString() + "," + dr["Tax"].ToString() + ";";
                    }
                }

            }

            DataTable dtBookingClass = dsIntFlights.Tables[13];
            if (dtBookingClass.Rows.Count > 0)
            {
                DataRow[] rowBookingClass = dtBookingClass.Select("FlightSegment_Id=" + lblIntFlightSegmentId.Text);
                Availability = rowBookingClass[0]["Availability"].ToString();
                BIC = rowBookingClass[0]["BIC"].ToString();
            }
            DataTable dtBookingClassFare = dsIntFlights.Tables[14];
            if (dtBookingClassFare.Rows.Count > 0)
            {
                DataRow[] rowBookingClassFare = dtBookingClassFare.Select("FlightSegment_Id=" + lblIntFlightSegmentId.Text);
                bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                classType = rowBookingClassFare[0]["classType"].ToString();
                farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                Rule = rowBookingClassFare[0]["Rule"].ToString();
                if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                {
                    bookingclassFareId = rowBookingClassFare[0]["bookingclassFare_Id"].ToString();
                }

            }
            //Non Mandatory fields
            if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
            {
                DataTable dtPsgrBreakUp = dsIntFlights.Tables[15];
                if (dtPsgrBreakUp.Rows.Count > 0)
                {
                    DataRow[] rowPsgrBreakUp = dtPsgrBreakUp.Select("bookingclassFare_Id=" + bookingclassFareId);
                    psgrBreakUp_Id = rowPsgrBreakUp[0]["psgrBreakUp_Id"].ToString();

                }
                DataTable dtPsgrAry = dsIntFlights.Tables[16];
                if (dtPsgrAry.Rows.Count > 0)
                {
                    DataRow[] rowPsgrAry = dtPsgrAry.Select("psgrBreakUp_Id=" + psgrBreakUp_Id);
                    psgrAy_id = rowPsgrAry[0]["psgrAry_Id"].ToString();

                }
                DataTable dtPsgr = dsIntFlights.Tables[17];
                if (dtPsgr.Rows.Count > 0)
                {
                    DataRow[] rowPsgr = dtPsgr.Select("psgrAry_Id=" + psgrAy_id);
                    FarePsgrType = rowPsgr[0]["psgrType"].ToString();
                    FareBaseFare = rowPsgr[0]["BaseFare"].ToString();
                    FareTax1 = rowPsgr[0]["Tax"].ToString();
                    BagInfo = rowPsgr[0]["BagInfo"].ToString();
                    //child
                    //CFarePsgrType = rowPsgr[1]["psgrType"].ToString();
                    //CFareBaseFare = rowPsgr[1]["BaseFare"].ToString();
                    //CFareTax1 = rowPsgr[1]["Tax"].ToString();
                    //CBagInfo = rowPsgr[1]["BagInfo"].ToString();
                    ////infant
                    //IFarePsgrType = rowPsgr[2]["psgrType"].ToString();
                    //IFareBaseFare = rowPsgr[2]["BaseFare"].ToString();
                    //IFareTax1 = rowPsgr[2]["Tax"].ToString();
                    //IBagInfo = rowPsgr[2]["BagInfo"].ToString();

                }

                if (dtPsgr.Rows.Count > 0)
                {
                    DataRow[] rowPsgr = dtPsgr.Select("psgrAry_Id=" + psgrAy_id);
                    foreach (DataRow rows in rowPsgr)
                    {
                        if (rows.Table.Rows.Count == 0)
                        {
                            taxdatapsgr = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                        else
                        {
                            taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                    }
                }
            }
            //  <Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr>
            DataTable dtTaxDataAry = dsIntFlights.Tables[8];
            if (dtTaxDataAry.Rows.Count > 0)
            {
                DataRow[] rowTaxDataAry = dtTaxDataAry.Select("Fare_id=" + FareId);
                taxDataAry_id = rowTaxDataAry[0]["TaxdataAry_Id"].ToString();
            }
            DataTable dtTaxData = dsIntFlights.Tables[9];
            if (dtTaxData.Rows.Count > 0)
            {
                DataRow[] rowTaxData = dtTaxData.Select("TaxdataAry_Id=" + taxDataAry_id);
                for (int j = 0; j < rowTaxData.Length; j++)
                {
                    if (rowTaxData.Length == 0)
                    {
                        taxData = "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";

                    }
                    else
                    {
                        taxData = taxData + "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                        //ravi
                        //  taxData = taxData + "<Fare><PsgrType>" + dtFare.Rows[j]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dtFare.Rows[j]["BaseFare"].ToString() + "</BaseFare><Tax>" + dtFare.Rows[j]["Tax"].ToString() + "</Tax><TaxDataAry><TaxData><Country>" + rowTaxData[0]["Country"].ToString() + "</Country><Amt>" + rowTaxData[0]["Amt"].ToString() + "</Amt></TaxData><TaxData><Country>" + rowTaxData[1]["Country"].ToString() + "</Country><Amt>" + rowTaxData[1]["Amt"].ToString() + "</Amt></TaxData><TaxData><Country>" + rowTaxData[2]["Country"].ToString() + "</Country><Amt>" + rowTaxData[2]["Amt"].ToString() + "</Amt></TaxData></TaxDataAry></Fare>";

                    }
                }

            }
            if (dtFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtFare.Select("FareAry_id=" + FareAry_id);
                foreach (DataRow row in rowFare)
                {
                    if (row.Table.Rows.Count == 0)
                    {
                        str = "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax><TaxDataAry>" + taxData + "</TaxDataAry></Fare>";
                    }
                    else
                    {
                        str = str + "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax><TaxDataAry>" + taxData + "</TaxDataAry></Fare>";
                    }
                }
            }

            bool res1 = false;

            if (Session["Role"].ToString() == "User")
            {

                //ravi db save

                FlightBAL objFlightBal = new FlightBAL();
                String RefNo = Common.GetFlightsReferenceNo("LJIF");
                Session["Order_Id"] = RefNo.ToString();
                objFlightBal.ReferenceNo = RefNo.ToString();
                objFlightBal.TransId = "0";
                objFlightBal.Status = "Pending";
                objFlightBal.AdultPax = Convert.ToInt32(Session["adultCntInt"]);
                objFlightBal.InfantPax = Convert.ToInt32(Session["infantCntInt"]);
                objFlightBal.ChildPax = Convert.ToInt32(Session["childCntInt"]);
                objFlightBal.Origin_Destination_Id = id;
                objFlightBal.Origin_Destination_Key = key;
                objFlightBal.ActualBasefare = Convert.ToDecimal(ActualBaseFare);
                objFlightBal.Tax = Convert.ToDecimal(Tax);
                objFlightBal.STax = Convert.ToDecimal(STax);
                objFlightBal.TCharge = Convert.ToDecimal(TCharge);
                objFlightBal.Scharge = Convert.ToDecimal(SCharge);
                objFlightBal.TDiscount = Convert.ToDecimal(TDiscount);
                objFlightBal.TMarkUp = Convert.ToDecimal(TMarkup);
                objFlightBal.TPartnerCommission = Convert.ToDecimal(TPartnerCommission);
                objFlightBal.TSDiscount = Convert.ToDecimal(TSdiscount);
                objFlightBal.CreatedBy = Convert.ToInt32(Session["UserID"]);
                objFlightBal.TripMode = "One";
                objFlightBal.ocTax = ocTax;
                objFlightBal.Return = return1;
                objFlightBal.id = id;
                objFlightBal.key = key;

                DataTable dtflightBookingId = objFlightBal.AddDInternationalFlightBooking(objFlightBal);
                Session["BookingID"] = dtflightBookingId.Rows[0]["FlightBookingID"].ToString();

                //fegments

                string customerInfo = string.Empty;
                Table tbladults = (Table)this.UpdatePanel2.FindControl("tblAdultsInt");
                for (int l = 1; l <= Convert.ToInt32(Session["adultCntInt"]); l++)
                {

                    TextBox txtFn = (TextBox)tbladults.FindControl("txtFnInt" + l);
                    TextBox txtLn = (TextBox)tbladults.FindControl("txtLnInt" + l);
                    DropDownList ddlTitle = (DropDownList)tbladults.FindControl("ddlTitleInt" + l);

                    if (customerInfo == string.Empty)
                    {
                        customerInfo = ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "adt" + "|" + "-";
                    }
                    else
                    {
                        customerInfo = customerInfo + ";" + ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "adt" + "|" + "-";
                    }
                    //  xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><psgrtype>adt</psgrtype></CustomerInfo>";
                }

                Table tblChild = (Table)this.UpdatePanel2.FindControl("tblChildInt");
                for (int j = 1; j <= Convert.ToInt32(Session["childCntInt"]); j++)
                {
                    TextBox txtFn = (TextBox)tblChild.FindControl("txtCFnInt" + j);

                    TextBox txtLn = (TextBox)tblChild.FindControl("txtCLnInt" + j);

                    DropDownList ddlTitle = (DropDownList)tblChild.FindControl("ddlCTitleInt" + j);

                    TextBox txtBirthDate = (TextBox)tblChild.FindControl("txtCBirthDateInt" + j);

                    string age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();

                    if (customerInfo == string.Empty)
                    {
                        customerInfo = ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "chd" + "|" + age + "|" + txtBirthDate.Text;
                    }
                    else
                    {
                        customerInfo = customerInfo + ";" + ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "chd" + "|" + age + "|" + txtBirthDate.Text;
                    }
                    //  xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>chd</psgrtype></CustomerInfo>";
                }

                Table tblInfants = (Table)this.UpdatePanel2.FindControl("tblInfantsInt");
                for (int k = 1; k <= Convert.ToInt32(Session["infantCntInt"]); k++)
                {
                    TextBox txtFn = (TextBox)tblInfants.FindControl("txtIFnInt" + k);

                    TextBox txtLn = (TextBox)tblInfants.FindControl("txtILnInt" + k);

                    DropDownList ddlTitle = (DropDownList)tblInfants.FindControl("ddlITitleInt" + k);

                    TextBox txtBirthDate = (TextBox)tblInfants.FindControl("txtIBirthDateInt" + k);
                    string age = string.Empty;
                    if (txtBirthDate != null)
                        age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                    else
                        age = "0";

                    if (customerInfo == string.Empty)
                    {
                        customerInfo = ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "inf" + "|" + age + "|" + txtBirthDate.Text;
                    }
                    else
                    {
                        customerInfo = customerInfo + ";" + ddlTitle.SelectedItem.Text + "|" + txtFn.Text + "|" + txtLn.Text + "|" + "inf" + "|" + age + "|" + txtBirthDate.Text;
                    }
                    //  xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>inf</psgrtype></CustomerInfo>";
                }

                if (dtFlightSegment.Rows.Count > 0)
                {
                    DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                    for (int j = 0; j < rowFilghtSegment.Length; j++)
                    {
                        AirEquipType = rowFilghtSegment[j]["AirEquipType"].ToString();
                        ArrivalAirportCode = rowFilghtSegment[j]["ArrivalAirportCode"].ToString();
                        ArrivalAirportName = rowFilghtSegment[j]["ArrivalAirportName"].ToString();
                        ArrivalDateTime = rowFilghtSegment[j]["ArrivalDateTime"].ToString();
                        DepartureAirportCode = rowFilghtSegment[j]["DepartureAirportCode"].ToString();
                        DepartureAirportName = rowFilghtSegment[j]["DepartureAirportName"].ToString();
                        DepartureDateTime = rowFilghtSegment[j]["DepartureDateTime"].ToString();
                        FlightNumber = rowFilghtSegment[j]["FlightNumber"].ToString();
                        MarketingAirlineCode = rowFilghtSegment[j]["MarketingAirlineCode"].ToString();
                        OperatingAirlineCode = rowFilghtSegment[j]["OperatingAirlineCode"].ToString();
                        OperatingAirlineName = rowFilghtSegment[j]["OperatingAirlineName"].ToString();
                        OperatingAirlineFlightNumber = rowFilghtSegment[j]["OperatingAirlineFlightNumber"].ToString();
                        NumStops = rowFilghtSegment[j]["NumStops"].ToString();
                        LinkSellAgrmnt = rowFilghtSegment[j]["LinkSellAgrmnt"].ToString();
                        Conx = rowFilghtSegment[j]["Conx"].ToString();
                        AirpChg = rowFilghtSegment[j]["AirpChg"].ToString();
                        InsideAvailOption = rowFilghtSegment[j]["InsideAvailOption"].ToString();
                        GenTrafRestriction = rowFilghtSegment[j]["GenTrafRestriction"].ToString();
                        DaysOperates = rowFilghtSegment[j]["DaysOperates"].ToString();
                        JrnyTm = rowFilghtSegment[j]["JrnyTm"].ToString();
                        EndDt = rowFilghtSegment[j]["EndDt"].ToString();
                        StartTerminal = rowFilghtSegment[j]["StartTerminal"].ToString();
                        EndTerminal = rowFilghtSegment[j]["EndTerminal"].ToString();
                        FltTm = rowFilghtSegment[j]["FltTm"].ToString();
                        LSAInd = rowFilghtSegment[j]["LSAInd"].ToString();
                        Mile = rowFilghtSegment[j]["Mile"].ToString();

                        DataTable dtBookingClass1 = dsIntFlights.Tables[13];
                        if (dtBookingClass1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClass = dtBookingClass1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            Availability = rowBookingClass[0]["Availability"].ToString();
                            BIC = rowBookingClass[0]["BIC"].ToString();
                        }

                        DataTable dtBookingClassFare1 = dsIntFlights.Tables[14];
                        if (dtBookingClassFare1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClassFare = dtBookingClassFare1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                            classType = rowBookingClassFare[0]["classType"].ToString();
                            farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                            Rule = rowBookingClassFare[0]["Rule"].ToString();

                        }
                        //   bookingclass = rowFilghtSegment[j]["LSAInd"].ToString();
                        //   classType = rowFilghtSegment[j]["Mile"].ToString();

                        objFlightBal.FlightBookingID = dtflightBookingId.Rows[0]["FlightBookingID"].ToString();//Convert.ToString(Session["BookingID"]);
                        objFlightBal.AirEquipType = AirEquipType;
                        objFlightBal.ArrivalAirportCode = ArrivalAirportCode;
                        objFlightBal.ArrivalAirportName = ArrivalAirportName;
                        objFlightBal.ArrivalDateTime = ArrivalDateTime;
                        objFlightBal.DepartureAirportCode = DepartureAirportCode;
                        objFlightBal.DepartureAirportName = DepartureAirportName;
                        objFlightBal.DepartureDateTime = DepartureDateTime;
                        objFlightBal.FlightNumber = FlightNumber;
                        objFlightBal.MarketingAirlineCode = MarketingAirlineCode;
                        objFlightBal.OperatingAirlineCode = OperatingAirlineCode;
                        objFlightBal.OperatingAirlineName = OperatingAirlineName;
                        objFlightBal.OperatingAirlineFlightNumber = OperatingAirlineFlightNumber;
                        objFlightBal.NumStops = NumStops;
                        objFlightBal.LinkSellAgrmnt = LinkSellAgrmnt;
                        objFlightBal.Conx = Conx;
                        objFlightBal.AirpChg = AirpChg;
                        objFlightBal.InsideAvailOption = InsideAvailOption;
                        objFlightBal.GenTrafRestriction = GenTrafRestriction;
                        objFlightBal.DaysOperates = DaysOperates;
                        objFlightBal.JrnyTm = JrnyTm;
                        objFlightBal.EndDt = EndDt;
                        objFlightBal.StartTerminal = StartTerminal;
                        objFlightBal.EndTerminal = EndTerminal;
                        objFlightBal.FltTm = FltTm;
                        objFlightBal.LSAInd = LSAInd;
                        objFlightBal.Mile = Mile;
                        objFlightBal.Availability = Availability;
                        objFlightBal.BIC = BIC;
                        objFlightBal.emailAddress = txtEmailIDInt.Text.Trim();
                        Session["EmailID"] = txtEmailIDInt.Text.Trim();
                        objFlightBal.telephone = txtMobileNumberInt.Text;
                        Session["MobileNo"] = txtMobileNumberInt.Text;
                        objFlightBal.CreatedBy = Convert.ToInt32(Session["UserID"]);
                        objFlightBal.Customer_Details = customerInfo;
                        objFlightBal.Address = txtCityInt.Text + "," + txtStateInt.Text + "," + ddlCountryInt.SelectedValue + "," + txtPostalCodeInt.Text + ",";
                        Session["customerInfo"] = customerInfo;
                        Session["Address"] = txtCityInt.Text + "," + txtStateInt.Text + "," + ddlCountryInt.SelectedValue + "," + txtPostalCodeInt.Text + ",";
                        objFlightBal.bookingClass = bookingclass;
                        objFlightBal.ClassType = classType;
                        objFlightBal.farebasisCode = farebasiscode;
                        objFlightBal.Fare_Rule = Rule;
                        objFlightBal.PsgrType = FarePsgrType;
                        objFlightBal.BaseFare = FareBaseFare;
                        objFlightBal.psgrTax = FareTax1;
                        objFlightBal.BagInfo = BagInfo;
                        objFlightBal.FarePsgrType = faretype;

                        res1 = objFlightBal.AddInternationalFlightSegment(objFlightBal);

                    }
                }

                if (res1 == true)
                {
                    Response.Redirect("~/pay.aspx?val=true", false);
                }
                //db save end
            }
            else
            {

                FlightBAL objFlightsBal = new FlightBAL();

                #region Pricing
                //  string XmlPricingRequest = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";
                string XmlPricingRequest = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>" + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";
                XmlPricingRequest = XmlPricingRequest + "<onward><FlightSegments>";

                if (dtFlightSegment.Rows.Count > 0)
                {
                    DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                    for (int j = 0; j < rowFilghtSegment.Length; j++)
                    {
                        AirEquipType = rowFilghtSegment[j]["AirEquipType"].ToString();
                        ArrivalAirportCode = rowFilghtSegment[j]["ArrivalAirportCode"].ToString();
                        ArrivalAirportName = rowFilghtSegment[j]["ArrivalAirportName"].ToString();
                        ArrivalDateTime = rowFilghtSegment[j]["ArrivalDateTime"].ToString();
                        DepartureAirportCode = rowFilghtSegment[j]["DepartureAirportCode"].ToString();
                        DepartureAirportName = rowFilghtSegment[j]["DepartureAirportName"].ToString();
                        DepartureDateTime = rowFilghtSegment[j]["DepartureDateTime"].ToString();
                        FlightNumber = rowFilghtSegment[j]["FlightNumber"].ToString();
                        MarketingAirlineCode = rowFilghtSegment[j]["MarketingAirlineCode"].ToString();
                        OperatingAirlineCode = rowFilghtSegment[j]["OperatingAirlineCode"].ToString();
                        OperatingAirlineName = rowFilghtSegment[j]["OperatingAirlineName"].ToString();
                        OperatingAirlineFlightNumber = rowFilghtSegment[j]["OperatingAirlineFlightNumber"].ToString();
                        NumStops = rowFilghtSegment[j]["NumStops"].ToString();
                        LinkSellAgrmnt = rowFilghtSegment[j]["LinkSellAgrmnt"].ToString();
                        Conx = rowFilghtSegment[j]["Conx"].ToString();
                        AirpChg = rowFilghtSegment[j]["AirpChg"].ToString();
                        InsideAvailOption = rowFilghtSegment[j]["InsideAvailOption"].ToString();
                        GenTrafRestriction = rowFilghtSegment[j]["GenTrafRestriction"].ToString();
                        DaysOperates = rowFilghtSegment[j]["DaysOperates"].ToString();
                        JrnyTm = rowFilghtSegment[j]["JrnyTm"].ToString();
                        EndDt = rowFilghtSegment[j]["EndDt"].ToString();
                        StartTerminal = rowFilghtSegment[j]["StartTerminal"].ToString();
                        EndTerminal = rowFilghtSegment[j]["EndTerminal"].ToString();
                        FltTm = rowFilghtSegment[j]["FltTm"].ToString();
                        LSAInd = rowFilghtSegment[j]["LSAInd"].ToString();
                        Mile = rowFilghtSegment[j]["Mile"].ToString();

                        DataTable dtBookingClass1 = dsIntFlights.Tables[13];
                        if (dtBookingClass1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClass = dtBookingClass1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            Availability = rowBookingClass[0]["Availability"].ToString();
                            BIC = rowBookingClass[0]["BIC"].ToString();
                        }

                        DataTable dtBookingClassFare1 = dsIntFlights.Tables[14];
                        if (dtBookingClassFare1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClassFare = dtBookingClassFare1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                            classType = rowBookingClassFare[0]["classType"].ToString();
                            farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                            Rule = rowBookingClassFare[0]["Rule"].ToString();

                        }

                        XmlPricingRequest = XmlPricingRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                        XmlPricingRequest = XmlPricingRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                        // XmlPricingRequest = XmlPricingRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";
                        XmlPricingRequest = XmlPricingRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                        if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                        {
                            XmlPricingRequest = XmlPricingRequest + "<PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup>";
                        }
                        XmlPricingRequest = XmlPricingRequest + "</BookingClassFare></FlightSegment>";
                    }
                }
                XmlPricingRequest = XmlPricingRequest + "</FlightSegments></onward><Return>" + return1 + "</Return><id>" + id + "</id><key>" + key + "</key>";
                XmlPricingRequest = XmlPricingRequest + "</OriginDestinationOption></PriceRequest>";

                DataSet dsPricingResponse = objFlightsBal.GetDatasetFromAPI(XmlPricingRequest, "http://live.arzoo.com:9302/Pricing");

                if (dsPricingResponse.Tables[0].Rows[0]["error"] == string.Empty)
                {
                    //  DataTable dtpricingflightsegment = dsPricingResponse.Tables

                    DataTable dtpricingFlightSegment = dsPricingResponse.Tables["FlightSegment"];
                    if (dtpricingFlightSegment.Rows.Count > 0)
                    {
                        DataRow[] rowFilghtSegment = dtpricingFlightSegment.Select("FlightSegment_ID=" + Convert.ToInt32(lblIntFlightSegmentId.Text));
                        FlightSegmentsID = rowFilghtSegment[0]["FlightSegments_Id"].ToString();

                    }
                    DataTable dtpricingFlightSegments = dsPricingResponse.Tables["FlightSegments"];
                    if (dtpricingFlightSegments.Rows.Count > 0)
                    {
                        DataRow[] rowFilghtSegments = dtpricingFlightSegments.Select("FlightSegments_ID=" + FlightSegmentsID);
                        onwardId = rowFilghtSegments[0]["Onward_Id"].ToString();
                    }
                    DataTable dtpricingOnward = dsPricingResponse.Tables["onward"];
                    if (dtpricingOnward.Rows.Count > 0)
                    {
                        DataRow[] rowOnward = dtpricingOnward.Select("Onward_Id=" + onwardId);
                        OriginDestinationOption_Id = rowOnward[0]["OriginDestinationOption_Id"].ToString();
                    }
                    DataTable dtpricingFareDetails = dsIntFlights.Tables["FareDetails"];
                    if (dtFareDetails.Rows.Count > 0)
                    {
                        DataRow[] rowFareDetails = dtFareDetails.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                        ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                        Tax = rowFareDetails[0]["Tax"].ToString();
                        STax = rowFareDetails[0]["STax"].ToString();
                        TCharge = rowFareDetails[0]["TCharge"].ToString();
                        SCharge = rowFareDetails[0]["SCharge"].ToString();
                        TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                        TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                        TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                        TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                        ocTax = rowFareDetails[0]["ocTax"].ToString();
                        FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
                    }
                }

                #endregion

                string ref1 = Common.GetFlightsReferenceNo("LJIF");

                string xmlRequest = "<Bookingrequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno></creditcardno><PartnerreferenceID>" + ref1 + "</PartnerreferenceID>";
                xmlRequest = xmlRequest + "<personName>";

                // Dynamic generation of names of adults, infants , Child
                Table tbladults = (Table)this.UpdatePanel2.FindControl("tblAdultsInt");
                for (int i = 1; i <= Convert.ToInt32(Session["adultCntInt"]); i++)
                {

                    TextBox txtFn = (TextBox)tbladults.FindControl("txtFnInt" + i);
                    TextBox txtLn = (TextBox)tbladults.FindControl("txtLnInt" + i);
                    DropDownList ddlTitle = (DropDownList)tbladults.FindControl("ddlTitleInt" + i);

                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><psgrtype>adt</psgrtype></CustomerInfo>";
                }

                Table tblChild = (Table)this.UpdatePanel2.FindControl("tblChildInt");
                for (int i = 1; i <= Convert.ToInt32(Session["childCntInt"]); i++)
                {
                    TextBox txtFn = (TextBox)tblChild.FindControl("txtCFnInt" + i);

                    TextBox txtLn = (TextBox)tblChild.FindControl("txtCLnInt" + i);

                    DropDownList ddlTitle = (DropDownList)tblChild.FindControl("ddlCTitleInt" + i);

                    TextBox txtBirthDate = (TextBox)tblChild.FindControl("txtCBirthDateInt" + i);

                    string age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                    //if (Convert.ToInt32(age) > 5)
                    //{
                    //    Literal lit = new Literal();
                    //    lit.Text = txtFn.Text + " Age  between 3 - 5 yrs.";
                    //    this.Controls.Add(lit);
                    //    break;
                    //}

                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>chd</psgrtype></CustomerInfo>";
                }

                Table tblInfants = (Table)this.UpdatePanel2.FindControl("tblInfantsInt");
                for (int i = 1; i <= Convert.ToInt32(Session["infantCntInt"]); i++)
                {
                    TextBox txtFn = (TextBox)tblInfants.FindControl("txtIFnInt" + i);

                    TextBox txtLn = (TextBox)tblInfants.FindControl("txtILnInt" + i);

                    DropDownList ddlTitle = (DropDownList)tblInfants.FindControl("ddlITitleInt" + i);

                    TextBox txtBirthDate = (TextBox)tblInfants.FindControl("txtIBirthDateInt" + i);
                    string age = string.Empty;
                    if (txtBirthDate != null)
                        age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                    else
                        age = "0";
                    //if (Convert.ToInt32(age) == 12)
                    //{
                    //    Literal lit = new Literal();
                    //    lit.Text = txtFn.Text + " Age should be below 1 yr.";
                    //    this.Controls.Add(lit);
                    //    break;
                    //}

                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>inf</psgrtype></CustomerInfo>";
                }

                xmlRequest = xmlRequest + "</personName><telePhone><phoneNumber>" + txtMobileNumInt.Text + "</phoneNumber></telePhone><email><emailAddress>" + txtEmailIDInt.Text + "</emailAddress></email>";
                //xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax><TaxDataAry>";
                //xmlRequest = xmlRequest + taxData + "</TaxDataAry></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";
                xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>";
                xmlRequest = xmlRequest + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";

                if (dtFlightSegment.Rows.Count > 0)
                {
                    DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                    for (int j = 0; j < rowFilghtSegment.Length; j++)
                    {
                        AirEquipType = rowFilghtSegment[j]["AirEquipType"].ToString();
                        ArrivalAirportCode = rowFilghtSegment[j]["ArrivalAirportCode"].ToString();
                        ArrivalAirportName = rowFilghtSegment[j]["ArrivalAirportName"].ToString();
                        ArrivalDateTime = rowFilghtSegment[j]["ArrivalDateTime"].ToString();
                        DepartureAirportCode = rowFilghtSegment[j]["DepartureAirportCode"].ToString();
                        DepartureAirportName = rowFilghtSegment[j]["DepartureAirportName"].ToString();
                        DepartureDateTime = rowFilghtSegment[j]["DepartureDateTime"].ToString();
                        FlightNumber = rowFilghtSegment[j]["FlightNumber"].ToString();
                        MarketingAirlineCode = rowFilghtSegment[j]["MarketingAirlineCode"].ToString();
                        OperatingAirlineCode = rowFilghtSegment[j]["OperatingAirlineCode"].ToString();
                        OperatingAirlineName = rowFilghtSegment[j]["OperatingAirlineName"].ToString();
                        OperatingAirlineFlightNumber = rowFilghtSegment[j]["OperatingAirlineFlightNumber"].ToString();
                        NumStops = rowFilghtSegment[j]["NumStops"].ToString();
                        LinkSellAgrmnt = rowFilghtSegment[j]["LinkSellAgrmnt"].ToString();
                        Conx = rowFilghtSegment[j]["Conx"].ToString();
                        AirpChg = rowFilghtSegment[j]["AirpChg"].ToString();
                        InsideAvailOption = rowFilghtSegment[j]["InsideAvailOption"].ToString();
                        GenTrafRestriction = rowFilghtSegment[j]["GenTrafRestriction"].ToString();
                        DaysOperates = rowFilghtSegment[j]["DaysOperates"].ToString();
                        JrnyTm = rowFilghtSegment[j]["JrnyTm"].ToString();
                        EndDt = rowFilghtSegment[j]["EndDt"].ToString();
                        StartTerminal = rowFilghtSegment[j]["StartTerminal"].ToString();
                        EndTerminal = rowFilghtSegment[j]["EndTerminal"].ToString();
                        FltTm = rowFilghtSegment[j]["FltTm"].ToString();
                        LSAInd = rowFilghtSegment[j]["LSAInd"].ToString();
                        Mile = rowFilghtSegment[j]["Mile"].ToString();

                        DataTable dtBookingClass1 = dsIntFlights.Tables[13];
                        if (dtBookingClass1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClass = dtBookingClass1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            Availability = rowBookingClass[0]["Availability"].ToString();
                            BIC = rowBookingClass[0]["BIC"].ToString();
                        }

                        DataTable dtBookingClassFare1 = dsIntFlights.Tables[14];
                        if (dtBookingClassFare1.Rows.Count > 0)
                        {
                            DataRow[] rowBookingClassFare = dtBookingClassFare1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                            bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                            classType = rowBookingClassFare[0]["classType"].ToString();
                            farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                            Rule = rowBookingClassFare[0]["Rule"].ToString();

                        }

                        xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                        xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                        xmlRequest = xmlRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                        if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                        {
                            xmlRequest = xmlRequest + "<PsgrBreakup><PsgrAry><Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup>";
                        }
                        xmlRequest = xmlRequest + "</BookingClassFare></FlightSegment>";
                    }
                }
                xmlRequest = xmlRequest + "</FlightSegments></onward><Return>" + return1 + "</Return><id>" + id + "</id><key>" + key + "</key>";
                xmlRequest = xmlRequest + "</OriginDestinationOption></Bookingrequest>";

                StringBuilder stt = new StringBuilder();

                stt.Append("xmlRequest");
                stt.Append("=");
                stt.Append(Server.UrlEncode(xmlRequest));
                // stt.Append((xmlRequest).Replace("+", "%2B"));

                byte[] requestData = Encoding.UTF8.GetBytes(stt.ToString());

                //byte[] requestData = System.Text.Encoding.UTF8.GetBytes(xmlRequest.Replace("+","%2B"));

                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Booking");

                //request.Accept = @"text/plain,application/xml";
                //request.ContentType = @"application/xml";
                //request.Method = @"POST";
                request.Method = "POST";
                request.ContentType = "application/x-www-form-urlencoded";
                request.Accept = "application/json";
                // request.Accept = "en-us,en;q=0.5";

                //request.ContentType = "multipart/form-data";
                request.ContentLength = requestData.Length;

                using (Stream requestStream = request.GetRequestStream())
                {
                    requestStream.Write(requestData, 0, requestData.Length);
                }
                using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                {
                    using (Stream stream = response.GetResponseStream())
                    {
                        using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                            result = reader.ReadToEnd();
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(result);
                        XmlNodeReader xmlReader = new XmlNodeReader(doc);

                        ds.ReadXml(xmlReader);
                    }
                }

                //result = "<Bookingresponse><OriginDestinationOption><FareDetails><ActualBaseFare>85035</ActualBaseFare><Tax>4079</Tax><STax>1055</STax><TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>0</TDiscount><TMarkup>150</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax></Fare></FareAry></FareBreakup></FareDetails><onward><FlightSegments><FlightSegment><AirEquipType>77W</AirEquipType><ArrivalAirportCode>LHR</ArrivalAirportCode><ArrivalAirportName>LONDON&lt;BR&gt; (HEATHROW)</ArrivalAirportName><ArrivalDateTime>2010-02-26T06:35:00</ArrivalDateTime><DepartureAirportCode>BOM</DepartureAirportCode><DepartureAirportName>MUMBAI&lt;BR&gt; (CHHATRAPATI SHIVAJI INTERNATIONAL)</DepartureAirportName><DepartureDateTime>2010-02-26T02:05:00</DepartureDateTime><FlightNumber>4131</FlightNumber><MarketingAirlineCode>BD</MarketingAirlineCode><OperatingAirlineCode>BD</OperatingAirlineCode><OperatingAirlineName>British Midland</OperatingAirlineName><OperatingAirlineFlightNumber>4131</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>Y</BIC></BookingClass><BookingClassFare><bookingclass>Y</bookingclass><classType>Economy</classType><farebasiscode>rb8QAsvpFIPpZo9gBUBg+6BMOP0MtJ7L</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment><FlightSegment><AirEquipType>346</AirEquipType><ArrivalAirportCode>JFK</ArrivalAirportCode><ArrivalAirportName>NEW YORK&lt;BR&gt; (JOHN F KENNEDY INTL)</ArrivalAirportName><ArrivalDateTime>2010-02-26T12:20:00</ArrivalDateTime><DepartureAirportCode>LHR</DepartureAirportCode><DepartureAirportName>LONDON&lt;BR&gt; (HEATHROW)</DepartureAirportName><DepartureDateTime>2010-02-26T09:20:00</DepartureDateTime><FlightNumber>8223</FlightNumber><MarketingAirlineCode>CO</MarketingAirlineCode><OperatingAirlineCode>CO</OperatingAirlineCode><OperatingAirlineName>Continental Airlines </OperatingAirlineName><OperatingAirlineFlightNumber>8223</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>4</Availability><BIC>L</BIC></BookingClass><BookingClassFare><bookingclass>L</bookingclass><classType>Economy</classType><farebasiscode>rb8QAsvpFIPpZo9gBUBg+6BMOP0MtJ7L</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></onward><Return/><id>arzoo100</id><key>ayCbutV8CZjQweTiPhdGIT52/cnXSmDtWDF6uoVa0Yx+dIrODcZqUYV1i7vZuywrXxtmsFOjbi9n4urlPHf4zxGFVKSEVPuglBZfw/aOkGOFdYu72bssKyww8nhfPbQTtwJT+FL3EYT6Z0r5IgK9i8O9cVe5sN0jK6gQR/0VsA3jPu65QFu4leESvkw2tYVo0MHk4j4XRiFoKIn0f2tgo+sVQZmUH8fjjct7YYgqWIoUUZ48kBq4e/0pg3DmQVVVo2Q3a0AUQSXLUP1Wu6PBd4V1i7vZuywrSdRter3iPenjPu65QFu4lbsv+JV45WPGtyljvg7883Sh2gnY0OmCJCn868u75ToLhXWLu9m7LCuMmusGneSEdRuxNaSOsudhnGqNtXQ916PjPu65QFu4lU2r9RVG+D9a0MHk4j4XRiFoKIn0f2tgozK2rkfhSWEWx6xZaH0ssx82RPW27flqmu5f2a5HBe02z/lJy0jWbT0M1G6o3Y+hzWfi6uU8d/jPAJdXKqYIvc5G93zQPY0iVQD8L1fsyfdm6xVBmZQfx+ONy3thiCpYihlAiI3xsTJF4z7uuUBbuJUEGsOfbTr3UF/rxHYOApxUsDfYCka6IQumFoD34DG1PbcCU/hS9xGEMwKsr63khSb3Qspj6nxBZe9bfmEZ7GUgEriX6+12U2wkVz4JY1XabcCU/hS9xGEcUGtscRHmuLDvXFXubDdIz12g5QheQXO4z7uuUBbuJVmadCAqLb2y2fi6uU8d/jPS1i6Qoti3wtoJoL9ZE4l6rEu1ZiKp4vJfk8fwf1jcc9f68R2DgKcVK1lGTAnSPxSl9HJUgz+eC+FdYu72bssKzNAqSxshbWRYUz9VFYzmixqeExNPowVA78GaMTl9BYe0fUDu2DE3rHDvXFXubDdI3dYiTg2zkNgU+gGkoFGtlfAPC2FpjoIsV/rxHYOApxURZOpRI/EzoEVg7MnTiMjPoV1i7vZuywrp7AOSJb8tei2GAYztr4tGO6Udvv6goYtX+vEdg4CnFThuwJPu5BuYitpzzDzl21bJ/v5/y98kwILsR2pjhA21YV1i7vZuywrGJgEwhHzH+9n4urlPHf4zwMsIQITsGsy0MHk4j4XRiFoKIn0f2tgowznwUkbWS71w71xV7mw3SOi9DZLo5De59CaB/YiXgfO40U/DdrAcfnP5jcg4z9RPIZB8/lb/sd5w71xV7mw3SNZoQyFRfkMl+M+7rlAW7iVOm7uM/9yhhNn4urlPHf4z7kR+x0lYQ5LX+vEdg4CnFRKt+2PZYo+CjOuGPE4fK4oZ+Lq5Tx3+M9KeFGbag7+buM+7rlAW7iVdKLgjh+EGg8Mv3JUr8Yz2NNESEN0N1nFqHicn8G1rgW8dJypOMfNAYV1i7vZuywrLDDyeF89tBO3AlP4UvcRhPpnSvkiAr2L00RIQ3Q3WcWoeJyfwbWuBfSvd+pfPzkTw71xV7mw3SNdcG/zHitfN1rAgZFeAikBjct7YYgqWIpXyYBKr/eg5uM+7rlAW7iVygQsiztYTQ9f68R2DgKcVBCq+RQJHE/z</key></OriginDestinationOption><telePhone><phoneNumber>9879961339</phoneNumber></telePhone><email><emailAddress>[email protected]</emailAddress></email><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>Given By Arzoo.com</Clientid><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno>1234567890123456</creditcardno><error></error><personName><CustomerInfo><givenName>Sagar</givenName><surName>Arora</surName><nameReference>Mr.</nameReference><psgrtype>adt</psgrtype></CustomerInfo></personName><status>SUCCESS</status><transid>A396009</transid></Bookingresponse>";

                //   XmlDocument doc = new XmlDocument();
                //   doc.LoadXml(result);
                //   XmlNodeReader xmlReader = new XmlNodeReader(doc);

                //   ds.ReadXml(xmlReader);

            }
        }

        catch (Exception ex)
        {
            if (ex.Message.Contains("409"))
            {
                lblerror.Text = "Please contact administrator";
                lblerror.Visible = true;
            }
        }
        return ds;
    }
        private DataSet methodround()
        {
        try
        {
            #region Variables
            string str = string.Empty;
            string FlightSegmentsID = string.Empty;
            string DepartureAirportCode = string.Empty;
            string ArrivalDateTime = string.Empty;
            string DepartureAirportName = string.Empty;
            string DepartureDateTime = string.Empty;
            string FlightNumber = string.Empty;
            string MarketingAirlineCode = string.Empty;
            string OperatingAirlineCode = string.Empty;
            string OperatingAirlineName = string.Empty;
            string OperatingAirlineFlightNumber = string.Empty;
            string NumStops = string.Empty;
            string LinkSellAgrmnt = string.Empty;
            string Conx = string.Empty;
            string AirpChg = string.Empty;
            string InsideAvailOption = string.Empty;
            string GenTrafRestriction = string.Empty;
            string DaysOperates = string.Empty;
            string JrnyTm = string.Empty;
            string EndDt = string.Empty;
            string StartTerminal = string.Empty;
            string EndTerminal = string.Empty;
            string FltTm = string.Empty;
            string LSAInd = string.Empty;
            string Mile = string.Empty;
            string Availability = string.Empty;
            string BIC = string.Empty;
            string bookingclass = string.Empty;
            string classType = string.Empty;
            string farebasiscode = string.Empty;
            string Rule = string.Empty;
            string PsgrType = string.Empty;
            string BaseFare = string.Empty;
            string Tax = string.Empty;
            string BagInfo = string.Empty;
            string AirEquipType = string.Empty;
            string ArrivalAirportCode = string.Empty;
            string ArrivalAirportName = string.Empty;
            string return1 = string.Empty;
            string id = string.Empty;
            string key = string.Empty;
            string ActualBaseFare = string.Empty;
            string FareTax = string.Empty;
            string STax = string.Empty;
            string TCharge = string.Empty;
            string SCharge = string.Empty;
            string TDiscount = string.Empty;
            string TMarkup = string.Empty;
            string TPartnerCommission = string.Empty;
            string TSdiscount = string.Empty;
            string FarePsgrType = string.Empty;
            string FareBaseFare = string.Empty;
            string FareTax1 = string.Empty;
            string Country = string.Empty;
            string Amt = string.Empty;
            string ocTax = string.Empty;
            string onwardId = string.Empty;
            string OriginDestinationOption_Id = string.Empty;
            string FareDetails_id = string.Empty;
            string FareBreakUp_Id = string.Empty;
            string FareAry_id = string.Empty;
            string FareId = string.Empty;
            string bookingclassFareId = string.Empty;
            string psgrBreakUp_Id = string.Empty;
            string psgrAy_id = string.Empty;
            string country = string.Empty;
            string taxAmt = string.Empty;
            string taxData = string.Empty;
            string taxDataAry_id = string.Empty;
            string returnId = string.Empty;

            string FlightSegmentsIDRet = string.Empty;
            string DepartureAirportCodeRet = string.Empty;
            string ArrivalDateTimeRet = string.Empty;
            string DepartureAirportNameRet = string.Empty;
            string DepartureDateTimeRet = string.Empty;
            string FlightNumberRet = string.Empty;
            string MarketingAirlineCodeRet = string.Empty;
            string OperatingAirlineCodeRet = string.Empty;
            string OperatingAirlineNameRet = string.Empty;
            string OperatingAirlineFlightNumberRet = string.Empty;
            string NumStopsRet = string.Empty;
            string LinkSellAgrmntRet = string.Empty;
            string ConxRet = string.Empty;
            string AirpChgRet = string.Empty;
            string InsideAvailOptionRet = string.Empty;
            string GenTrafRestrictionRet = string.Empty;
            string DaysOperatesRet = string.Empty;
            string JrnyTmRet = string.Empty;
            string EndDtRet = string.Empty;
            string StartTerminalRet = string.Empty;
            string EndTerminalRet = string.Empty;
            string FltTmRet = string.Empty;
            string LSAIndRet = string.Empty;
            string MileRet = string.Empty;
            string AvailabilityRet = string.Empty;
            string BICRet = string.Empty;
            string bookingclassRet = string.Empty;
            string classTypeRet = string.Empty;
            string farebasiscodeRet = string.Empty;
            string RuleRet = string.Empty;
            string PsgrTypeRet = string.Empty;
            string BaseFareRet = string.Empty;
            string TaxRet = string.Empty;
            string BagInfoRet = string.Empty;
            string AirEquipTypeRet = string.Empty;
            string ArrivalAirportCodeRet = string.Empty;
            string ArrivalAirportNameRet = string.Empty;

            string idRet = string.Empty;
            string keyRet = string.Empty;
            string ActualBaseFareRet = string.Empty;
            string FareTaxRet = string.Empty;
            string STaxRet = string.Empty;
            string TChargeRet = string.Empty;
            string SChargeRet = string.Empty;
            string TDiscountRet = string.Empty;
            string TMarkupRet = string.Empty;
            string TPartnerCommissionRet = string.Empty;
            string TSdiscountRet = string.Empty;
            string FarePsgrTypeRet = string.Empty;
            string FareBaseFareRet = string.Empty;
            string FareTax1Ret = string.Empty;
            string CountryRet = string.Empty;
            string AmtRet = string.Empty;
            string ocTaxRet = string.Empty;
            string onwardIdRet = string.Empty;
            string OriginDestinationOption_IdRet = string.Empty;
            string FareDetails_idRet = string.Empty;
            string FareBreakUp_IdRet = string.Empty;
            string FareAry_idRet = string.Empty;
            string FareIdRet = string.Empty;
            string bookingclassFareIdRet = string.Empty;
            string psgrBreakUp_IdRet = string.Empty;
            string psgrAy_idRet = string.Empty;
            string countryRet = string.Empty;
            string taxAmtRet = string.Empty;
            string taxDataRet = string.Empty;
            string taxDataAry_idRet = string.Empty;
            string returnIdRet = string.Empty;

            string taxdatapsgr = string.Empty;
            string taxdatapsgrRet = string.Empty;
            #endregion

            #region old

            //DataTable dtPricingreqFare = dsIntFlights.Tables["Fare"];
            //if (dtPricingreqFare.Rows.Count > 0)
            //{
            //    DataRow[] rowFare = dtPricingreqFare.Select("FareAry_id=" + FareAry_id);
            //    foreach (DataRow row in rowFare)
            //    {
            //        if (row.Table.Rows.Count == 0)
            //        {
            //            str = "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax></Fare>";
            //        }
            //        else
            //        {
            //            str = str + "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
            //        }
            //    }
            //}

            //FlightBAL objFlightsBal = new FlightBAL();
            //string xmlpricingrequestforInt = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype>";
            //xmlpricingrequestforInt = xmlpricingrequestforInt + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>" + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";//<Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax></Fare>
            //xmlpricingrequestforInt = xmlpricingrequestforInt + "<onward><FlightSegments>";

            //DataTable dtpricingreqOnward = dsIntFlights.Tables["Onward"];
            //if (dtpricingreqOnward.Rows.Count > 0)
            //{
            //    DataRow[] rowOnward = dtpricingreqOnward.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
            //    onwardId = rowOnward[0]["onward_id"].ToString();
            //}
            //DataTable dtpricingreqFlightSegments = dsIntFlights.Tables["FlightSegments"];
            //if (dtpricingreqFlightSegments.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegments = dtpricingreqFlightSegments.Select("onward_id=" + onwardId);
            //    FlightSegmentsID = rowFlightSegments[0]["FlightSegments_Id"].ToString();
            //}
            //DataTable dtpricingreqFlightSegment = dsIntFlights.Tables["FlightSegment"];
            //DataTable dtpricingreqBookingClass = dsIntFlights.Tables["BookingClass"];
            //DataTable dtpricingreqBookingClassFare = dsIntFlights.Tables["BookingClassFare"];
            //DataTable dtpricingreqPsgrBreakUp = dsIntFlights.Tables["PsgrBreakUp"];
            //DataTable dtpricingreqPsgrAry = dsIntFlights.Tables["PsgrAry"];
            //DataTable dtpricingreqPsgr = dsIntFlights.Tables["Psgr"];
            //DataTable dtpricingreqTaxDataAry = dsIntFlights.Tables["TaxDataAry"];
            //DataTable dtpricingreqTaxData = dsIntFlights.Tables["TaxData"];

            //if (dtpricingreqFlightSegment.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegment = dtpricingreqFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
            //    for (int i = 0; i < rowFlightSegment.Length; i++)
            //    {

            //        AirEquipType = rowFlightSegment[i]["AirEquipType"].ToString();
            //        ArrivalAirportCode = rowFlightSegment[i]["ArrivalAirportCode"].ToString();
            //        ArrivalAirportName = rowFlightSegment[i]["ArrivalAirportName"].ToString();
            //        ArrivalDateTime = rowFlightSegment[i]["ArrivalDateTime"].ToString();
            //        DepartureAirportCode = rowFlightSegment[i]["DepartureAirportCode"].ToString();
            //        DepartureAirportName = rowFlightSegment[i]["DepartureAirportName"].ToString();
            //        DepartureDateTime = rowFlightSegment[i]["DepartureDateTime"].ToString();
            //        FlightNumber = rowFlightSegment[i]["FlightNumber"].ToString();
            //        MarketingAirlineCode = rowFlightSegment[i]["MarketingAirlineCode"].ToString();
            //        OperatingAirlineCode = rowFlightSegment[i]["OperatingAirlineCode"].ToString();
            //        OperatingAirlineName = rowFlightSegment[i]["OperatingAirlineName"].ToString();
            //        OperatingAirlineFlightNumber = rowFlightSegment[i]["OperatingAirlineFlightNumber"].ToString();
            //        NumStops = rowFlightSegment[i]["NumStops"].ToString();
            //        LinkSellAgrmnt = rowFlightSegment[i]["LinkSellAgrmnt"].ToString();
            //        Conx = rowFlightSegment[i]["Conx"].ToString();
            //        AirpChg = rowFlightSegment[i]["AirpChg"].ToString();
            //        InsideAvailOption = rowFlightSegment[i]["InsideAvailOption"].ToString();
            //        GenTrafRestriction = rowFlightSegment[i]["GenTrafRestriction"].ToString();
            //        DaysOperates = rowFlightSegment[i]["DaysOperates"].ToString();
            //        JrnyTm = rowFlightSegment[i]["JrnyTm"].ToString();
            //        EndDt = rowFlightSegment[i]["EndDt"].ToString();
            //        StartTerminal = rowFlightSegment[i]["StartTerminal"].ToString();
            //        EndTerminal = rowFlightSegment[i]["EndTerminal"].ToString();
            //        FltTm = rowFlightSegment[i]["FltTm"].ToString();
            //        LSAInd = rowFlightSegment[i]["LSAInd"].ToString();
            //        Mile = rowFlightSegment[i]["Mile"].ToString();

            //        if (dtpricingreqBookingClass.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClass = dtpricingreqBookingClass.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
            //            Availability = rowBookingClass[0]["Availability"].ToString();
            //            BIC = rowBookingClass[0]["BIC"].ToString();
            //        }

            //        if (dtpricingreqBookingClassFare.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClassFare = dtpricingreqBookingClassFare.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
            //            bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
            //            classType = rowBookingClassFare[0]["classType"].ToString();
            //            farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
            //            Rule = rowBookingClassFare[0]["Rule"].ToString();
            //            bookingclassFareId = rowBookingClassFare[0]["bookingclassFare_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgrBreakUp.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrBreakUp = dtpricingreqPsgrBreakUp.Select("bookingclassFare_Id=" + bookingclassFareId);
            //            psgrBreakUp_Id = rowPsgrBreakUp[0]["psgrBreakUp_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgrAry.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrAry = dtpricingreqPsgrAry.Select("psgrBreakUp_Id=" + psgrBreakUp_Id);
            //            psgrAy_id = rowPsgrAry[0]["psgrAry_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgr.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgr = dtpricingreqPsgr.Select("psgrAry_Id=" + psgrAy_id);
            //            FarePsgrType = rowPsgr[0]["psgrType"].ToString();
            //            FareBaseFare = rowPsgr[0]["BaseFare"].ToString();
            //            FareTax1 = rowPsgr[0]["Tax"].ToString();
            //            BagInfo = rowPsgr[0]["BagInfo"].ToString();

            //        }

            //        if (dtpricingreqTaxDataAry.Rows.Count > 0)
            //        {
            //            DataRow[] rowTaxDataAry = dtpricingreqTaxDataAry.Select("Fare_id=" + FareId);
            //            taxDataAry_id = rowTaxDataAry[0]["TaxdataAry_Id"].ToString();
            //        }

            //        if (dtpricingreqTaxData.Rows.Count > 0)
            //        {
            //            DataRow[] rowTaxData = dtpricingreqTaxData.Select("TaxdataAry_Id=" + taxDataAry_id);
            //            for (int j = 0; j < rowTaxData.Length; j++)
            //            {
            //                if (rowTaxData.Length == 0)
            //                {
            //                    taxData = "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
            //                }
            //                else
            //                {
            //                    taxData = taxData + "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
            //                }
            //            }

            //        }

            //        if (dtpricingreqPsgr.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgr = dtpricingreqPsgr.Select("psgrAry_Id=" + psgrAy_id);
            //            foreach (DataRow rows in rowPsgr)
            //            {
            //                if (rows.Table.Rows.Count == 0)
            //                {
            //                    taxdatapsgr = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
            //                }
            //                else
            //                {
            //                    taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
            //                }
            //            }
            //        }

            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr>

            //    }
            //}
            #endregion
            DataSet ds = new DataSet();
            FlightBAL objFlightsBal = new FlightBAL();
            string ReferenceNo = Convert.ToString(Session["Order_Id"]);
            DataSet dtid = objFlightsBal.FGetInternationalFlightDetails(ReferenceNo);

            #region oneway

            // return1 = dtid.Tables[0].Rows[0]["Return1"].ToString();
            id1 = dtid.Tables[0].Rows[0]["id"].ToString();
            key = dtid.Tables[0].Rows[0]["Key1"].ToString();
            string[] actualBaseFare = dtid.Tables[0].Rows[0]["ActualBasefare"].ToString().Split('.');
            ActualBaseFare = actualBaseFare[0].ToString();
            string[] tx = dtid.Tables[0].Rows[0]["Tax"].ToString().Split('.');
            Tax = tx[0].ToString();
            string[] stx = dtid.Tables[0].Rows[0]["STax"].ToString().Split('.');
            STax = stx[0].ToString();
            string[] schrge = dtid.Tables[0].Rows[0]["Scharge"].ToString().Split('.');
            SCharge = schrge[0].ToString();
            string[] tdis = dtid.Tables[0].Rows[0]["TDiscount"].ToString().Split('.');
            TDiscount = tdis[0].ToString();
            string[] tpartcomm = dtid.Tables[0].Rows[0]["TPartnerCommission"].ToString().Split('.');
            TPartnerCommission = tpartcomm[0].ToString();
            string[] tsdisc = dtid.Tables[0].Rows[0]["TSDiscount"].ToString().Split('.');
            TSdiscount = tsdisc[0].ToString();
            ocTax = dtid.Tables[0].Rows[0]["Octax"].ToString();
            string[] tmrkup = dtid.Tables[0].Rows[0]["TMarkUp"].ToString().Split('.');
            TMarkup = tmrkup[0].ToString();
            string[] tchge = dtid.Tables[0].Rows[0]["TCharge"].ToString().Split('.');
            TCharge = tchge[0].ToString();
            string ReferenceNo1 = dtid.Tables[0].Rows[0]["Int_Booking_Id"].ToString();
            DataSet dsdbsave = objFlightsBal.GetInternationalFlightDetails1(ReferenceNo1);

            if (dsdbsave.Tables.Count > 0)
            {
                if (dsdbsave.Tables[0].Rows.Count > 0)
                {
                    //foreach (DataRow row in dsdbsave.Tables[0].Rows)
                    //{
                    if (dsdbsave.Tables[0].Rows[0]["FarePsgrType"].ToString().Contains(";"))
                    {
                        rows = dsdbsave.Tables[0].Rows[0]["FarePsgrType"].ToString().Split(';');
                        int count = rows.Count();
                        for (int i = 0; i < count; i++)
                        {
                            if (rows[i].Contains("|"))
                            {
                                string[] str2 = rows[i].ToString().Split('|');

                                Irows = str2.ToString().Split(',');
                            }
                            else
                            {
                                Irows = rows[i].ToString().Split(',');

                            }
                            // Irows = rows.ToString().Split(',');
                            if (str == "")
                            {
                                str = "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";
                                //taxdatapsgr = "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            }
                            else
                            {

                                if (Irows[0].ToString() == "")
                                {
                                }
                                else
                                {
                                    str = str + "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
                                    // taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                    taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                }
                            }
                        }
                    }
                    else
                    {
                        Irows = dsdbsave.Tables[0].Rows[0]["FarePsgrType"].ToString().Split(',');

                        // Irows = rows.ToString().Split(',');
                        if (str == "")
                        {
                            str = "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";
                            //taxdatapsgr = "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                        else
                        {
                            str = str + "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
                            // taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }

                    }
                    //}
                    //  string XmlPricingRequest = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";

                    xmlpricingrequestforInt = "<PriceRequest><noadults>" + dtid.Tables[0].Rows[0]["AdultPax"].ToString() + "</noadults><nochild>" + dtid.Tables[0].Rows[0]["ChildPax"].ToString() + "</nochild><noinfant>" + dtid.Tables[0].Rows[0]["InfantPax"].ToString() + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>" + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<onward><FlightSegments>";

                    //foreach (DataRow row in dsdbsave.Tables[0].Rows)
                    //{
                    AirEquipType = dsdbsave.Tables[0].Rows[0]["AirEquipType"].ToString();
                    ArrivalAirportCode = dsdbsave.Tables[0].Rows[0]["ArrivalAirportCode"].ToString();
                    ArrivalAirportName = dsdbsave.Tables[0].Rows[0]["ArrivalAirportName"].ToString();
                    ArrivalDateTime = dsdbsave.Tables[0].Rows[0]["ArrivalDateTime"].ToString();
                    DepartureAirportCode = dsdbsave.Tables[0].Rows[0]["DepartureAirportCode"].ToString();
                    DepartureAirportName = dsdbsave.Tables[0].Rows[0]["DepartureAirportName"].ToString();
                    DepartureDateTime = dsdbsave.Tables[0].Rows[0]["DepartureDateTime"].ToString();
                    FlightNumber = dsdbsave.Tables[0].Rows[0]["FlightNumber"].ToString();
                    MarketingAirlineCode = dsdbsave.Tables[0].Rows[0]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCode = dsdbsave.Tables[0].Rows[0]["OperatingAirlineCode"].ToString();
                    OperatingAirlineName = dsdbsave.Tables[0].Rows[0]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumber = dsdbsave.Tables[0].Rows[0]["OperatingAirlineFlightNumber"].ToString();
                    NumStops = dsdbsave.Tables[0].Rows[0]["NumStops"].ToString();
                    LinkSellAgrmnt = dsdbsave.Tables[0].Rows[0]["LinkSellAgrmnt"].ToString();
                    Conx = dsdbsave.Tables[0].Rows[0]["Conx"].ToString();
                    AirpChg = dsdbsave.Tables[0].Rows[0]["AirpChg"].ToString();
                    InsideAvailOption = dsdbsave.Tables[0].Rows[0]["InsideAvailOption"].ToString();
                    GenTrafRestriction = dsdbsave.Tables[0].Rows[0]["GenTrafRestriction"].ToString();
                    DaysOperates = dsdbsave.Tables[0].Rows[0]["DaysOperates"].ToString();
                    JrnyTm = dsdbsave.Tables[0].Rows[0]["JrnyTm"].ToString();
                    EndDt = dsdbsave.Tables[0].Rows[0]["EndDt"].ToString();
                    StartTerminal = dsdbsave.Tables[0].Rows[0]["StartTerminal"].ToString();
                    EndTerminal = dsdbsave.Tables[0].Rows[0]["EndTerminal"].ToString();
                    FltTm = dsdbsave.Tables[0].Rows[0]["FltTm"].ToString();
                    LSAInd = dsdbsave.Tables[0].Rows[0]["LSAInd"].ToString();
                    Mile = dsdbsave.Tables[0].Rows[0]["Mile"].ToString();

                    Availability = dsdbsave.Tables[0].Rows[0]["Availability"].ToString();
                    BIC = dsdbsave.Tables[0].Rows[0]["BIC"].ToString();
                    bookingclass = dsdbsave.Tables[0].Rows[0]["bookingclass"].ToString();
                    classType = dsdbsave.Tables[0].Rows[0]["classType"].ToString();
                    farebasiscode = dsdbsave.Tables[0].Rows[0]["farebasiscode"].ToString();
                    Rule = dsdbsave.Tables[0].Rows[0]["Fare_Rule"].ToString();

                    FarePsgrType = dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString();
                    FareBaseFare = dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString();
                    FareTax1 = dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString();
                    BagInfo = dsdbsave.Tables[0].Rows[0]["BagInfo"].ToString();

                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                    // xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";

                    // }

                }
            }

            #endregion

            xmlpricingrequestforInt = xmlpricingrequestforInt + "</FlightSegments></onward><Return><FlightSegments>";
            #region old return

            //DataTable dtpricingreqReturn = dsIntFlights.Tables["Return"];
            //if (dtpricingreqReturn.Rows.Count > 0)
            //{
            //    DataRow[] rowReturn = dtpricingreqReturn.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
            //    returnId = rowReturn[0]["return_id"].ToString();
            //}
            //DataTable dtpricingreqFlightSegmentsRet = dsIntFlights.Tables["FlightSegments"];
            //if (dtpricingreqFlightSegmentsRet.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegmentsRet = dtpricingreqFlightSegmentsRet.Select("return_id=" + returnId);
            //    FlightSegmentsIDRet = rowFlightSegmentsRet[0]["FlightSegments_Id"].ToString();
            //}
            //DataTable dtpricingreqFlightSegmentRet = dsIntFlights.Tables["FlightSegment"];
            //DataTable dtpricingreqBookingClassRet = dsIntFlights.Tables["BookingClass"];
            //DataTable dtpricingreqBookingClassFareRet = dsIntFlights.Tables["BookingClassFare"];
            //DataTable dtpricingreqPsgrBreakUpRet = dsIntFlights.Tables["PsgrBreakUp"];
            //DataTable dtpricingreqPsgrAryRet = dsIntFlights.Tables["PsgrAry"];
            //DataTable dtpricingreqPsgrRet = dsIntFlights.Tables["Psgr"];
            //DataTable dtpricingreqTaxDataAryRet = dsIntFlights.Tables["TaxDataAry"];
            //DataTable dtpricingreqTaxDataRet = dsIntFlights.Tables["TaxData"];

            //if (dtpricingreqFlightSegmentRet.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegmentRet = dtpricingreqFlightSegmentRet.Select("FlightSegments_Id=" + FlightSegmentsIDRet);
            //    for (int i = 0; i < rowFlightSegmentRet.Length; i++)
            //    {

            //        AirEquipTypeRet = rowFlightSegmentRet[i]["AirEquipType"].ToString();
            //        ArrivalAirportCodeRet = rowFlightSegmentRet[i]["ArrivalAirportCode"].ToString();
            //        ArrivalAirportNameRet = rowFlightSegmentRet[i]["ArrivalAirportName"].ToString();
            //        ArrivalDateTimeRet = rowFlightSegmentRet[i]["ArrivalDateTime"].ToString();
            //        DepartureAirportCodeRet = rowFlightSegmentRet[i]["DepartureAirportCode"].ToString();
            //        DepartureAirportNameRet = rowFlightSegmentRet[i]["DepartureAirportName"].ToString();
            //        DepartureDateTimeRet = rowFlightSegmentRet[i]["DepartureDateTime"].ToString();
            //        FlightNumberRet = rowFlightSegmentRet[i]["FlightNumber"].ToString();
            //        MarketingAirlineCodeRet = rowFlightSegmentRet[i]["MarketingAirlineCode"].ToString();
            //        OperatingAirlineCodeRet = rowFlightSegmentRet[i]["OperatingAirlineCode"].ToString();
            //        OperatingAirlineNameRet = rowFlightSegmentRet[i]["OperatingAirlineName"].ToString();
            //        OperatingAirlineFlightNumberRet = rowFlightSegmentRet[i]["OperatingAirlineFlightNumber"].ToString();
            //        NumStopsRet = rowFlightSegmentRet[i]["NumStops"].ToString();
            //        LinkSellAgrmntRet = rowFlightSegmentRet[i]["LinkSellAgrmnt"].ToString();
            //        ConxRet = rowFlightSegmentRet[i]["Conx"].ToString();
            //        AirpChgRet = rowFlightSegmentRet[i]["AirpChg"].ToString();
            //        InsideAvailOptionRet = rowFlightSegmentRet[i]["InsideAvailOption"].ToString();
            //        GenTrafRestrictionRet = rowFlightSegmentRet[i]["GenTrafRestriction"].ToString();
            //        DaysOperatesRet = rowFlightSegmentRet[i]["DaysOperates"].ToString();
            //        JrnyTmRet = rowFlightSegmentRet[i]["JrnyTm"].ToString();
            //        EndDtRet = rowFlightSegmentRet[i]["EndDt"].ToString();
            //        StartTerminalRet = rowFlightSegmentRet[i]["StartTerminal"].ToString();
            //        EndTerminalRet = rowFlightSegmentRet[i]["EndTerminal"].ToString();
            //        FltTmRet = rowFlightSegmentRet[i]["FltTm"].ToString();
            //        LSAIndRet = rowFlightSegmentRet[i]["LSAInd"].ToString();
            //        MileRet = rowFlightSegmentRet[i]["Mile"].ToString();

            //        if (dtpricingreqBookingClassRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClassRet = dtpricingreqBookingClassRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
            //            AvailabilityRet = rowBookingClassRet[0]["Availability"].ToString();
            //            BICRet = rowBookingClassRet[0]["BIC"].ToString();
            //        }

            //        if (dtpricingreqBookingClassFareRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClassFareRet = dtpricingreqBookingClassFareRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
            //            bookingclassRet = rowBookingClassFareRet[0]["bookingclass"].ToString();
            //            classTypeRet = rowBookingClassFareRet[0]["classType"].ToString();
            //            farebasiscodeRet = rowBookingClassFareRet[0]["farebasiscode"].ToString();
            //            RuleRet = rowBookingClassFareRet[0]["Rule"].ToString();
            //            bookingclassFareIdRet = rowBookingClassFareRet[0]["bookingclassFare_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgrBreakUpRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrBreakUpRet = dtpricingreqPsgrBreakUpRet.Select("bookingclassFare_Id=" + bookingclassFareIdRet);
            //            psgrBreakUp_IdRet = rowPsgrBreakUpRet[0]["psgrBreakUp_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgrAryRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrAryRet = dtpricingreqPsgrAryRet.Select("psgrBreakUp_Id=" + psgrBreakUp_IdRet);
            //            psgrAy_idRet = rowPsgrAryRet[0]["psgrAry_Id"].ToString();

            //        }

            //        if (dtpricingreqPsgrRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrRet = dtpricingreqPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
            //            FarePsgrTypeRet = rowPsgrRet[0]["psgrType"].ToString();
            //            FareBaseFareRet = rowPsgrRet[0]["BaseFare"].ToString();
            //            FareTax1Ret = rowPsgrRet[0]["Tax"].ToString();
            //            BagInfoRet = rowPsgrRet[0]["BagInfo"].ToString();

            //        }

            //        if (dtpricingreqPsgrRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgr = dtpricingreqPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
            //            foreach (DataRow rows in rowPsgr)
            //            {
            //                if (rows.Table.Rows.Count == 0)
            //                {
            //                    taxdatapsgrRet = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
            //                }
            //                else
            //                {
            //                    taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
            //                }
            //            }
            //        }

            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
            //        xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

            //    }
            //}
            #endregion

            #region return
            //idRet = dtid.Tables[0].Rows[1]["id"].ToString();
            //keyRet = dtid.Tables[0].Rows[1]["Key1"].ToString();
            //ActualBaseFareRet = dtid.Tables[0].Rows[1]["ActualBasefare"].ToString();
            //TaxRet = dtid.Tables[0].Rows[1]["Tax"].ToString();
            //STaxRet = dtid.Tables[0].Rows[1]["STax"].ToString();
            //SChargeRet = dtid.Tables[0].Rows[1]["Scharge"].ToString();
            //TDiscountRet = dtid.Tables[0].Rows[1]["TDiscount"].ToString();
            //TPartnerCommissionRet = dtid.Tables[0].Rows[1]["TPartnerCommission"].ToString();
            //TSdiscountRet = dtid.Tables[0].Rows[1]["TSDiscount"].ToString();
            //ocTaxRet = dtid.Tables[0].Rows[1]["Octax"].ToString();
            //TMarkupRet = dtid.Tables[0].Rows[1]["TMarkUp"].ToString();
            //TChargeRet = dtid.Tables[0].Rows[1]["TCharge"].ToString();

            //string ReferenceNo2 = dtid.Tables[0].Rows[1]["Int_Booking_Id"].ToString();
            //DataSet dsdbsaveRet = objFlightsBal.GetInternationalFlightDetails1(ReferenceNo2);

            if (dsdbsave.Tables.Count > 0)
            {
                if (dsdbsave.Tables[0].Rows.Count > 0)
                {
                    //foreach (DataRow row in dsdbsave.Tables[0].Rows)
                    //{
                    str = "";
                    if (dsdbsave.Tables[0].Rows[1]["FarePsgrType"].ToString().Contains(";"))
                    {
                        rows = dsdbsave.Tables[0].Rows[1]["FarePsgrType"].ToString().Split(';');
                        int count = rows.Count();
                        for (int i = 0; i < count; i++)
                        {
                            if (rows.Contains("|"))
                            {
                                string[] str2 = rows[i].ToString().Split('|');

                                Irows = str2.ToString().Split(',');
                            }
                            else
                            {
                                Irows = rows[i].ToString().Split(',');
                            }
                            // Irows = rows.ToString().Split(',');

                            if (str == "")
                            {
                                str = "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";
                                // taxdatapsgrRet = "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[1]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[1]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[1]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            }
                            else
                            {
                                if (Irows[0].ToString() == "")
                                {
                                }
                                else
                                {

                                    str = str + "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
                                    //  taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[1]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[1]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[1]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                    taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                                }
                            }
                        }
                    }
                    else
                    {
                        Irows = dsdbsave.Tables[0].Rows[0]["FarePsgrType"].ToString().Split(',');

                        // Irows = rows.ToString().Split(',');
                        if (str == "")
                        {
                            str = "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";
                            // taxdatapsgrRet = "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[1]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[1]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[1]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                        else
                        {
                            str = str + "<Fare><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
                            // taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + dsdbsave.Tables[0].Rows[1]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dsdbsave.Tables[0].Rows[1]["BaseFare"].ToString() + "</BaseFare><Tax>" + dsdbsave.Tables[0].Rows[1]["psgrTax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                            taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + Irows[0].ToString() + "</PsgrType><BaseFare>" + Irows[1].ToString() + "</BaseFare><Tax>" + Irows[2].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }

                    }

                    // foreach (DataRow row in dsdbsave.Tables[0].Rows)
                    //{
                    AirEquipTypeRet = dsdbsave.Tables[0].Rows[1]["AirEquipType"].ToString();
                    ArrivalAirportCodeRet = dsdbsave.Tables[0].Rows[1]["ArrivalAirportCode"].ToString();
                    ArrivalAirportNameRet = dsdbsave.Tables[0].Rows[1]["ArrivalAirportName"].ToString();
                    ArrivalDateTimeRet = dsdbsave.Tables[0].Rows[1]["ArrivalDateTime"].ToString();
                    DepartureAirportCodeRet = dsdbsave.Tables[0].Rows[1]["DepartureAirportCode"].ToString();
                    DepartureAirportNameRet = dsdbsave.Tables[0].Rows[1]["DepartureAirportName"].ToString();
                    DepartureDateTimeRet = dsdbsave.Tables[0].Rows[1]["DepartureDateTime"].ToString();
                    FlightNumberRet = dsdbsave.Tables[0].Rows[1]["FlightNumber"].ToString();
                    MarketingAirlineCodeRet = dsdbsave.Tables[0].Rows[1]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCodeRet = dsdbsave.Tables[0].Rows[1]["OperatingAirlineCode"].ToString();
                    OperatingAirlineNameRet = dsdbsave.Tables[0].Rows[1]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumberRet = dsdbsave.Tables[0].Rows[1]["OperatingAirlineFlightNumber"].ToString();
                    NumStopsRet = dsdbsave.Tables[0].Rows[1]["NumStops"].ToString();
                    LinkSellAgrmntRet = dsdbsave.Tables[0].Rows[1]["LinkSellAgrmnt"].ToString();
                    ConxRet = dsdbsave.Tables[0].Rows[1]["Conx"].ToString();
                    AirpChgRet = dsdbsave.Tables[0].Rows[1]["AirpChg"].ToString();
                    InsideAvailOptionRet = dsdbsave.Tables[0].Rows[1]["InsideAvailOption"].ToString();
                    GenTrafRestrictionRet = dsdbsave.Tables[0].Rows[1]["GenTrafRestriction"].ToString();
                    DaysOperatesRet = dsdbsave.Tables[0].Rows[1]["DaysOperates"].ToString();
                    JrnyTmRet = dsdbsave.Tables[0].Rows[1]["JrnyTm"].ToString();
                    EndDtRet = dsdbsave.Tables[0].Rows[1]["EndDt"].ToString();
                    StartTerminalRet = dsdbsave.Tables[0].Rows[1]["StartTerminal"].ToString();
                    EndTerminalRet = dsdbsave.Tables[0].Rows[1]["EndTerminal"].ToString();
                    FltTmRet = dsdbsave.Tables[0].Rows[1]["FltTm"].ToString();
                    LSAIndRet = dsdbsave.Tables[0].Rows[1]["LSAInd"].ToString();
                    MileRet = dsdbsave.Tables[0].Rows[1]["Mile"].ToString();

                    AvailabilityRet = dsdbsave.Tables[0].Rows[1]["Availability"].ToString();
                    BICRet = dsdbsave.Tables[0].Rows[1]["BIC"].ToString();
                    bookingclassRet = dsdbsave.Tables[0].Rows[1]["bookingclass"].ToString();
                    classTypeRet = dsdbsave.Tables[0].Rows[1]["classType"].ToString();
                    farebasiscodeRet = dsdbsave.Tables[0].Rows[1]["farebasiscode"].ToString();
                    RuleRet = dsdbsave.Tables[0].Rows[1]["Fare_Rule"].ToString();

                    FarePsgrTypeRet = dsdbsave.Tables[0].Rows[1]["PsgrType"].ToString();
                    FareBaseFareRet = dsdbsave.Tables[0].Rows[1]["BaseFare"].ToString();
                    FareTax1Ret = dsdbsave.Tables[0].Rows[1]["psgrTax"].ToString();
                    BagInfoRet = dsdbsave.Tables[0].Rows[1]["BagInfo"].ToString();

                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

            #endregion

                    xmlpricingrequestforInt = xmlpricingrequestforInt + "</FlightSegments></Return><id>" + id1 + "</id><key>" + key + "</key>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "</OriginDestinationOption></PriceRequest>";

                    DataSet dsPricingResponse = objFlightsBal.GetDatasetFromAPI(xmlpricingrequestforInt, "http://59.162.33.102:9301/Pricing");
                    if (dsPricingResponse != null)
                    {
                        if (dsPricingResponse.Tables.Count > 0)
                        {
                            if (!dsPricingResponse.Tables[0].Columns.Contains("error"))
                            {
                                DataTable dtpricingresFareDetails = dsPricingResponse.Tables["FareDetails"];
                                if (dtpricingresFareDetails.Rows.Count > 0)
                                {
                                    DataRow[] rowFareDetails = dtpricingresFareDetails.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                                    ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                                    Tax = rowFareDetails[0]["Tax"].ToString();
                                    STax = rowFareDetails[0]["STax"].ToString();
                                    TCharge = rowFareDetails[0]["TCharge"].ToString();
                                    SCharge = rowFareDetails[0]["SCharge"].ToString();
                                    TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                                    TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                                    TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                                    TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                                    ocTax = rowFareDetails[0]["ocTax"].ToString();
                                    FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
                                }
                            }
                        }
                    }

                }

            }
            #endregion
            string xmlRequest;

            #region new bookrequest onward

            string ref1 = Session["Order_Id"].ToString();

            xmlRequest = "<Bookingrequest><noadults>" + dtid.Tables[0].Rows[0]["AdultPax"].ToString() + "</noadults><nochild>" + dtid.Tables[0].Rows[0]["ChildPax"].ToString() + "</nochild><noinfant>" + dtid.Tables[0].Rows[0]["InfantPax"].ToString() + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno></creditcardno><PartnerreferenceID>" + ref1 + "</PartnerreferenceID>";
            xmlRequest = xmlRequest + "<personName>";

            ///details changing
            //   string strname = Convert.ToString(Session["customerInfo"]);
            string strname = dsdbsave.Tables[0].Rows[0]["CustomerDetails"].ToString();
            string[] strrows = strname.ToString().Split(';');
            int id2 = strrows.Count();
            for (int m = 0; m < id2; m++)
            {
                if (strrows[m].Contains("adt"))
                {
                    string[] stradt = strrows[m].ToString().Split('|');
                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + stradt[1].ToString() + "</givenName><surName>" + stradt[2].ToString() + "</surName><nameReference>" + stradt[0].ToString() + "</nameReference><psgrtype>adt</psgrtype></CustomerInfo>";
                }
                if (strrows[m].Contains("chd"))
                {
                    string[] strchd = strrows[m].ToString().Split('|');
                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + strchd[1].ToString() + "</givenName><surName>" + strchd[2].ToString() + "</surName><nameReference>" + strchd[0].ToString() + "</nameReference><dob>" + strchd[5].ToString() + "</dob><age>" + strchd[4].ToString() + "</age><psgrtype>chd</psgrtype></CustomerInfo>";
                }
                if (strrows[m].Contains("inf"))
                {
                    string[] strinf = strrows[m].ToString().Split('|');
                    xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + strinf[1].ToString() + "</givenName><surName>" + strinf[2].ToString() + "</surName><nameReference>" + strinf[0].ToString() + "</nameReference><dob>" + strinf[5].ToString() + "</dob><age>" + strinf[4].ToString() + "</age><psgrtype>inf</psgrtype></CustomerInfo>";

                }
            }
            xmlRequest = xmlRequest + "</personName><telePhone><phoneNumber>" + dsdbsave.Tables[0].Rows[0]["Telephone"].ToString() + "</phoneNumber></telePhone><email><emailAddress>" + dsdbsave.Tables[0].Rows[0]["EmailAddress"].ToString() + "</emailAddress></email>";
            //xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax><TaxDataAry>";
            //xmlRequest = xmlRequest + taxData + "</TaxDataAry></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";
            xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>";
            xmlRequest = xmlRequest + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";

            //foreach (DataRow row in dsdbsave.Tables[0].Rows)
            //{
            AirEquipType = dsdbsave.Tables[0].Rows[0]["AirEquipType"].ToString();
            ArrivalAirportCode = dsdbsave.Tables[0].Rows[0]["ArrivalAirportCode"].ToString();
            ArrivalAirportName = dsdbsave.Tables[0].Rows[0]["ArrivalAirportName"].ToString();
            ArrivalDateTime = dsdbsave.Tables[0].Rows[0]["ArrivalDateTime"].ToString();
            DepartureAirportCode = dsdbsave.Tables[0].Rows[0]["DepartureAirportCode"].ToString();
            DepartureAirportName = dsdbsave.Tables[0].Rows[0]["DepartureAirportName"].ToString();
            DepartureDateTime = dsdbsave.Tables[0].Rows[0]["DepartureDateTime"].ToString();
            FlightNumber = dsdbsave.Tables[0].Rows[0]["FlightNumber"].ToString();
            MarketingAirlineCode = dsdbsave.Tables[0].Rows[0]["MarketingAirlineCode"].ToString();
            OperatingAirlineCode = dsdbsave.Tables[0].Rows[0]["OperatingAirlineCode"].ToString();
            OperatingAirlineName = dsdbsave.Tables[0].Rows[0]["OperatingAirlineName"].ToString();
            OperatingAirlineFlightNumber = dsdbsave.Tables[0].Rows[0]["OperatingAirlineFlightNumber"].ToString();
            NumStops = dsdbsave.Tables[0].Rows[0]["NumStops"].ToString();
            LinkSellAgrmnt = dsdbsave.Tables[0].Rows[0]["LinkSellAgrmnt"].ToString();
            Conx = dsdbsave.Tables[0].Rows[0]["Conx"].ToString();
            AirpChg = dsdbsave.Tables[0].Rows[0]["AirpChg"].ToString();
            InsideAvailOption = dsdbsave.Tables[0].Rows[0]["InsideAvailOption"].ToString();
            GenTrafRestriction = dsdbsave.Tables[0].Rows[0]["GenTrafRestriction"].ToString();
            DaysOperates = dsdbsave.Tables[0].Rows[0]["DaysOperates"].ToString();
            JrnyTm = dsdbsave.Tables[0].Rows[0]["JrnyTm"].ToString();
            EndDt = dsdbsave.Tables[0].Rows[0]["EndDt"].ToString();
            StartTerminal = dsdbsave.Tables[0].Rows[0]["StartTerminal"].ToString();
            EndTerminal = dsdbsave.Tables[0].Rows[0]["EndTerminal"].ToString();
            FltTm = dsdbsave.Tables[0].Rows[0]["FltTm"].ToString();
            LSAInd = dsdbsave.Tables[0].Rows[0]["LSAInd"].ToString();
            Mile = dsdbsave.Tables[0].Rows[0]["Mile"].ToString();

            Availability = dsdbsave.Tables[0].Rows[0]["Availability"].ToString();
            BIC = dsdbsave.Tables[0].Rows[0]["BIC"].ToString();
            bookingclass = dsdbsave.Tables[0].Rows[0]["bookingclass"].ToString();
            classType = dsdbsave.Tables[0].Rows[0]["classType"].ToString();
            farebasiscode = dsdbsave.Tables[0].Rows[0]["farebasiscode"].ToString();
            Rule = dsdbsave.Tables[0].Rows[0]["Fare_Rule"].ToString();

            FarePsgrType = dsdbsave.Tables[0].Rows[0]["PsgrType"].ToString();
            FareBaseFare = dsdbsave.Tables[0].Rows[0]["BaseFare"].ToString();
            FareTax1 = dsdbsave.Tables[0].Rows[0]["psgrTax"].ToString();
            BagInfo = dsdbsave.Tables[0].Rows[0]["BagInfo"].ToString();

            xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
            xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
            xmlRequest = xmlRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";

            // }

            #endregion

            xmlRequest = xmlRequest + "</FlightSegments></onward><Return><FlightSegments>";
            #region old return

            //DataTable dtReturn = dsIntFlights.Tables["Return"];
            //if (dtReturn.Rows.Count > 0)
            //{
            //    DataRow[] rowReturn = dtReturn.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
            //    returnId = rowReturn[0]["return_id"].ToString();
            //}
            //DataTable dtFlightSegmentsRet = dsIntFlights.Tables["FlightSegments"];
            //if (dtFlightSegmentsRet.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegmentsRet = dtFlightSegmentsRet.Select("return_id=" + returnId);
            //    FlightSegmentsIDRet = rowFlightSegmentsRet[0]["FlightSegments_Id"].ToString();
            //}
            //DataTable dtFlightSegmentRet = dsIntFlights.Tables["FlightSegment"];
            //DataTable dtBookingClassRet = dsIntFlights.Tables["BookingClass"];
            //DataTable dtBookingClassFareRet = dsIntFlights.Tables["BookingClassFare"];
            //DataTable dtPsgrBreakUpRet = dsIntFlights.Tables["PsgrBreakUp"];
            //DataTable dtPsgrAryRet = dsIntFlights.Tables["PsgrAry"];
            //DataTable dtPsgrRet = dsIntFlights.Tables["Psgr"];
            //DataTable dtTaxDataAryRet = dsIntFlights.Tables["TaxDataAry"];
            //DataTable dtTaxDataRet = dsIntFlights.Tables["TaxData"];

            //if (dtFlightSegmentRet.Rows.Count > 0)
            //{
            //    DataRow[] rowFlightSegmentRet = dtFlightSegmentRet.Select("FlightSegments_Id=" + FlightSegmentsIDRet);
            //    for (int i = 0; i < rowFlightSegmentRet.Length; i++)
            //    {

            //        AirEquipTypeRet = rowFlightSegmentRet[i]["AirEquipType"].ToString();
            //        ArrivalAirportCodeRet = rowFlightSegmentRet[i]["ArrivalAirportCode"].ToString();
            //        ArrivalAirportNameRet = rowFlightSegmentRet[i]["ArrivalAirportName"].ToString();
            //        ArrivalDateTimeRet = rowFlightSegmentRet[i]["ArrivalDateTime"].ToString();
            //        DepartureAirportCodeRet = rowFlightSegmentRet[i]["DepartureAirportCode"].ToString();
            //        DepartureAirportNameRet = rowFlightSegmentRet[i]["DepartureAirportName"].ToString();
            //        DepartureDateTimeRet = rowFlightSegmentRet[i]["DepartureDateTime"].ToString();
            //        FlightNumberRet = rowFlightSegmentRet[i]["FlightNumber"].ToString();
            //        MarketingAirlineCodeRet = rowFlightSegmentRet[i]["MarketingAirlineCode"].ToString();
            //        OperatingAirlineCodeRet = rowFlightSegmentRet[i]["OperatingAirlineCode"].ToString();
            //        OperatingAirlineNameRet = rowFlightSegmentRet[i]["OperatingAirlineName"].ToString();
            //        OperatingAirlineFlightNumberRet = rowFlightSegmentRet[i]["OperatingAirlineFlightNumber"].ToString();
            //        NumStopsRet = rowFlightSegmentRet[i]["NumStops"].ToString();
            //        LinkSellAgrmntRet = rowFlightSegmentRet[i]["LinkSellAgrmnt"].ToString();
            //        ConxRet = rowFlightSegmentRet[i]["Conx"].ToString();
            //        AirpChgRet = rowFlightSegmentRet[i]["AirpChg"].ToString();
            //        InsideAvailOptionRet = rowFlightSegmentRet[i]["InsideAvailOption"].ToString();
            //        GenTrafRestrictionRet = rowFlightSegmentRet[i]["GenTrafRestriction"].ToString();
            //        DaysOperatesRet = rowFlightSegmentRet[i]["DaysOperates"].ToString();
            //        JrnyTmRet = rowFlightSegmentRet[i]["JrnyTm"].ToString();
            //        EndDtRet = rowFlightSegmentRet[i]["EndDt"].ToString();
            //        StartTerminalRet = rowFlightSegmentRet[i]["StartTerminal"].ToString();
            //        EndTerminalRet = rowFlightSegmentRet[i]["EndTerminal"].ToString();
            //        FltTmRet = rowFlightSegmentRet[i]["FltTm"].ToString();
            //        LSAIndRet = rowFlightSegmentRet[i]["LSAInd"].ToString();
            //        MileRet = rowFlightSegmentRet[i]["Mile"].ToString();

            //        if (dtBookingClassRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClassRet = dtBookingClassRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
            //            AvailabilityRet = rowBookingClassRet[0]["Availability"].ToString();
            //            BICRet = rowBookingClassRet[0]["BIC"].ToString();
            //        }

            //        if (dtBookingClassFareRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowBookingClassFareRet = dtBookingClassFareRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
            //            bookingclassRet = rowBookingClassFareRet[0]["bookingclass"].ToString();
            //            classTypeRet = rowBookingClassFareRet[0]["classType"].ToString();
            //            farebasiscodeRet = rowBookingClassFareRet[0]["farebasiscode"].ToString();
            //            RuleRet = rowBookingClassFareRet[0]["Rule"].ToString();
            //            bookingclassFareIdRet = rowBookingClassFareRet[0]["bookingclassFare_Id"].ToString();

            //        }

            //        if (dtPsgrBreakUpRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrBreakUpRet = dtPsgrBreakUpRet.Select("bookingclassFare_Id=" + bookingclassFareIdRet);
            //            psgrBreakUp_IdRet = rowPsgrBreakUpRet[0]["psgrBreakUp_Id"].ToString();

            //        }

            //        if (dtPsgrAryRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrAryRet = dtPsgrAryRet.Select("psgrBreakUp_Id=" + psgrBreakUp_IdRet);
            //            psgrAy_idRet = rowPsgrAryRet[0]["psgrAry_Id"].ToString();

            //        }

            //        if (dtPsgrRet.Rows.Count > 0)
            //        {
            //            DataRow[] rowPsgrRet = dtPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
            //            FarePsgrTypeRet = rowPsgrRet[0]["psgrType"].ToString();
            //            FareBaseFareRet = rowPsgrRet[0]["BaseFare"].ToString();
            //            FareTax1Ret = rowPsgrRet[0]["Tax"].ToString();
            //            BagInfoRet = rowPsgrRet[0]["BagInfo"].ToString();

            //        }

            //        //if (dtTaxDataAryRet.Rows.Count > 0)
            //        //{
            //        //    DataRow[] rowTaxDataAryRet = dtTaxDataAryRet.Select("Fare_id=" + FareIdRet);
            //        //    taxDataAry_id = rowTaxDataAryRet[0]["TaxdataAry_Id"].ToString();
            //        //}

            //        //if (dtTaxDataRet.Rows.Count > 0)
            //        //{
            //        //    DataRow[] rowTaxDataRet = dtTaxDataRet.Select("TaxdataAry_Id=" + taxDataAry_idRet);
            //        //    for (int j = 0; j < rowTaxDataRet.Length; j++)
            //        //    {
            //        //        if (rowTaxDataRet.Length == 0)
            //        //        {
            //        //            taxDataRet = "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
            //        //        }
            //        //        else
            //        //        {
            //        //            taxDataRet = taxDataRet + "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
            //        //        }
            //        //    }

            //        //}

            //        xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
            //        xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
            //        xmlRequest = xmlRequest + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

            //    }
            //}
            #endregion
            #region bookrequest return

            xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
            xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
            xmlRequest = xmlRequest + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

            xmlRequest = xmlRequest + "</FlightSegments></Return><id>" + id1 + "</id><key>" + key + "</key>";
            xmlRequest = xmlRequest + "</OriginDestinationOption></Bookingrequest>";

            #endregion

            DataSet dsResponse = new DataSet();

            StringBuilder stt = new StringBuilder();

            stt.Append("xmlRequest");
            stt.Append("=");
            stt.Append(Server.UrlEncode(xmlRequest));

            byte[] requestData = Encoding.UTF8.GetBytes(stt.ToString());

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Booking");
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.Accept = "application/json";

            request.ContentLength = requestData.Length;

            using (Stream requestStream = request.GetRequestStream())
            {
                requestStream.Write(requestData, 0, requestData.Length);
            }
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                        result = reader.ReadToEnd();
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(result);
                    XmlNodeReader xmlReader = new XmlNodeReader(doc);

                    dsResponse.ReadXml(xmlReader);
                }
            }
            return dsResponse;

        }
        catch (Exception ex)
        {

            throw;

        }

        }
示例#40
0
	public LevelGridComponent.SCellValue[,] DeserializeGridData(TextAsset asset)
	{

		XmlDocument doc = new XmlDocument();
		doc.LoadXml(asset.text);
		XmlSerializer serializer = new XmlSerializer(typeof(GridDataSerilizetion));
		XmlReader reader = new XmlNodeReader(doc.ChildNodes[1]);

		GridDataSerilizetion sr = (GridDataSerilizetion)serializer.Deserialize(reader);
		LevelGridComponent.SCellValue[,] resutl = new SCellValue[sr.Height,sr.Widht];

		int q=0;

		foreach(var a in sr.Cells)
		{
			SCellValue tmp = new SCellValue();
			tmp.CellContainValue = a.CellContainValue;
			tmp.ConerListVertexIndexes = (int[]) a.ConerListVertexIndexes.Clone();
			resutl[a.X,a.Y]=tmp;
		}


		return resutl;
	}
示例#41
0
 internal List<string> DeserializeToList(string text)
 {
     XmlDocument doc = new XmlDocument();
     doc.LoadXml(text);
     XmlSerializer xmls = new XmlSerializer(typeof(List<string>));
     XmlReader reader = new XmlNodeReader(doc);
     List<string> list = xmls.Deserialize(reader) as List<string>;
     if (list == null)
     {
         list = new List<string>();
     }
     return list;
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        //string xmlRequest1 = "<PriceRequest><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>77743504</Clientid><Clientpassword>*C6AB4F2C7F3C8C948CF18FBEA508B3E8830154D0</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>1000</ActualBaseFare><Tax>5184</Tax><STax>13</STax><TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>0</TDiscount><TMarkup>0</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>ADT</PsgrType><BaseFare>1000</BaseFare><Tax>5184</Tax></Fare></FareAry></FareBreakup><ocTax>0</ocTax></FareDetails><onward><FlightSegments><FlightSegment><AirEquipType>319</AirEquipType><ArrivalAirportCode>BOM</ArrivalAirportCode><ArrivalAirportName>MUMBAI</ArrivalAirportName><ArrivalDateTime>2012-12-15T23:05:00</ArrivalDateTime><DepartureAirportCode>BLR</DepartureAirportCode><DepartureAirportName>BANGALORE</DepartureAirportName><DepartureDateTime>2012-12-15T21:40:00</DepartureDateTime><FlightNumber>57</FlightNumber><MarketingAirlineCode>AI</MarketingAirlineCode><OperatingAirlineCode>AI</OperatingAirlineCode><OperatingAirlineName>Air India </OperatingAirlineName><OperatingAirlineFlightNumber>57</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm>85</JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>85</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>E</BIC></BookingClass><BookingClassFare><bookingclass>E</bookingclass><classType>Economy</classType><farebasiscode>wOV2SPbPbKYens5pMtaPkYnDM963BJmv</farebasiscode><Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>1000</BaseFare><Tax>5184</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></onward><Return><FlightSegments><FlightSegment><AirEquipType>319</AirEquipType><ArrivalAirportCode>BLR</ArrivalAirportCode><ArrivalAirportName>BANGALORE</ArrivalAirportName><ArrivalDateTime>2012-12-16T07:50:00</ArrivalDateTime><DepartureAirportCode>BOM</DepartureAirportCode><DepartureAirportName>MUMBAI</DepartureAirportName><DepartureDateTime>2012-12-16T06:15:00</DepartureDateTime><FlightNumber>603</FlightNumber><MarketingAirlineCode>AI</MarketingAirlineCode><OperatingAirlineCode>AI</OperatingAirlineCode><OperatingAirlineName>Air India </OperatingAirlineName><OperatingAirlineFlightNumber>603</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm>95</JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>95</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>E</BIC></BookingClass><BookingClassFare><bookingclass>E</bookingclass><classType>Economy</classType><farebasiscode>wOV2SPbPbKaCDnbK4mqIXRihwzerI1ne</farebasiscode><Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>1000</BaseFare><Tax>5184</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></Return><id>arzoo11</id><key>VPKmHGlQh9Nf68R2DgKcVEb0gG2ZuxB2FLqYOFDxMR3QweTiPhdGIWgoifR/a2CjF0y8ZIwbhDbDvXFXubDdI0yOy54o8SWMZ+Lq5Tx3+M+2Q/P5Ci0UbF/rxHYOApxUDGWf4lPayrbQweTiPhdGIWgoifR/a2Cj6xVBmZQfx+ONy3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cCU/hS9xGE+mdK+SICvYvDvXFXubDdIyuoEEf9FbAN4z7uuUBbuJV0ouCOH4QaD+k2w/1qSPBE4z7uuUBbuJVNq/UVRvg/WtDB5OI+F0YhaCiJ9H9rYKNiGWZ6hnYEx2fi6uU8d/jPAJdXKqYIvc4G4/CnURsDDTRYOvT4LVSE6xVBmZQfx+ONy3thiCpYikgRopJOZai5w71xV7mw3SOesti0ItOrM+qV6E/q3ryX4z7uuUBbuJVda06JiVzmQUUgFFphcCIuvnVFO8AedynQweTiPhdGIWgoifR/a2Cj/x562eQ8mWGFdYu72bssKykPmE7e7Vckw71xV7mw3SMM4z/e5ecAlWfi6uU8d/jP6QTJIx7E7Cjbx5zXegGAqsFRya6sKP09Sl4PTujxTq6MdVbaZLgdZmfi6uU8d/jPc0vlJ6zY98Jf68R2DgKcVEq37Y9lij4K0MHk4j4XRiFoKIn0f2tgo51XOIbdOgzsjct7YYgqWIpMQTjfSsjs79DB5OI+F0YhjwQ49dcmD0Zf68R2DgKcVEb0gG2ZuxB2Ymljz7Jt+uxf68R2DgKcVIdXMpFp5ybFpzEnkkuqrQOFdYu72bssK8B/JXVs9wCQpsXbYPlh18e3AlP4UvcRhPszpM3pCk/Y8rOOQMBvKzF7N7wk78NqqWfi6uU8d/jPLmp2mCCDyS/6HY9WWHlNq43Le2GIKliKadxQ6KRNzfZf68R2DgKcVOG7Ak+7kG5iwEhReMn6OwqzU04tGMz9NQuxHamOEDbVhXWLu9m7LCux62ssK0JY7eM+7rlAW7iVfZJw+YOHO2pf68R2DgKcVMLEthddewVqJ7aSSWnh5fmFdYu72bssKwnJRP/BQ9ShWgiWz87bQd6dUa/9uomqs+7CdvGAl0R2K93ud9fi+3mFdYu72bssK/mKCFwKiLWJtwJT+FL3EYRUYaKc70aEusO9cVe5sN0jof5yvfPeDtPjPu65QFu4lUmyf7gwDarOZk6/VHXsuA9K+aSnWj/m/puvinZBp1sD8Be4EBVranF6OlZecQ402/y3byvX9EEQjct7YYgqWIoUUZ48kBq4e4V1i7vZuywrLDDyeF89tBPwF7gQFWtqcXo6Vl5xDjTbZAkUMnAhCee3AlP4UvcRhHiI8KrWfN9LX+vEdg4CnFRzilKpKQyGezvpme4elChwtwJT+FL3EYSnqucah/n2/F/rxHYOApxUoQF7zhL9jcRf68R2DgKcVCB0cQSVLEagq7GeXeeb+55n4urlPHf4zyNTdMhpz8OLZ+Lq5Tx3+M81gDZwUvU5ixRRnjyQGrh7OBqQFB0C1pien+rHTKbEQyzNx7W8ezRi/dTqd6KPbtDQweTiPhdGIbr9FdWgB5am</key></OriginDestinationOption></PriceRequest>";
        //string xmlRequest = "xmlRequest=%3cBookingrequest%3e%3cnoadults%3e1%3c%2fnoadults%3e%3cnochild%3e0%3c%2fnochild%3e%3cnoinfant%3e0%3c%2fnoinfant%3e%3cClientid%3e77743504%3c%2fClientid%3e%3cClientpassword%3e*C6AB4F2C7F3C8C948CF18FBEA508B3E8830154D0%3c%2fClientpassword%3e%3cClienttype%3eArzooINTLWS1.0%3c%2fClienttype%3e%3ccreditcardno%3e1234567890123456%3c%2fcreditcardno%3e%3cPartnerreferenceID%3e100215%3c%2fPartnerreferenceID%3e%3cpersonName%3e%3cCustomerInfo%3e%3cgivenName%3eBindu%3c%2fgivenName%3e+%3csurName%3eB%3c%2fsurName%3e%3cnameReference%3eMrs.%3c%2fnameReference%3e%3cpsgrtype%3eadt%3c%2fpsgrtype%3e%3c%2fCustomerInfo%3e%3c%2fpersonName%3e%3ctelePhone%3e%3cphoneNumber%3e9701213996%3c%2fphoneNumber%3e%3c%2ftelePhone%3e%3cemail%3e%3cemailAddress%3ebindu.v%40i2space.com%3c%2femailAddress%3e%3c%2femail%3e%3cOriginDestinationOption%3e%3cFareDetails%3e%3cActualBaseFare%3e21250%3c%2fActualBaseFare%3e%3cTax%3e19675%3c%2fTax%3e%3cSTax%3e264%3c%2fSTax%3e%3cTCharge%3e0%3c%2fTCharge%3e%3cSCharge%3e0%3c%2fSCharge%3e%3cTDiscount%3e0%3c%2fTDiscount%3e%3cTMarkup%3e0%3c%2fTMarkup%3e%3cTPartnerCommission%3e0%3c%2fTPartnerCommission%3e%3cTSdiscount%3e0%3c%2fTSdiscount%3e%3cFareBreakup%3e%3cFareAry%3e%3cFare%3e%3cPsgrType%3eADT%3c%2fPsgrType%3e%3cBaseFare%3e21250%3c%2fBaseFare%3e%3cTax%3e19675%3c%2fTax%3e%3cTaxDataAry%3e%3cTaxData%3e%3cCountry%3eYQ%3c%2fCountry%3e%3cAmt%3e0%3c%2fAmt%3e%3c%2fTaxData%3e%3cTaxData%3e%3cCountry%3eWO%3c%2fCountry%3e%3cAmt%3e7108%3c%2fAmt%3e%3c%2fTaxData%3e%3cTaxData%3e%3cCountry%3eOther%3c%2fCountry%3e%3cAmt%3e12567%3c%2fAmt%3e%3c%2fTaxData%3e%3c%2fTaxDataAry%3e%3c%2fFare%3e%3c%2fFareAry%3e%3c%2fFareBreakup%3e%3cocTax%3e0%3c%2focTax%3e%3c%2fFareDetails%3e%3conward%3e%3cFlightSegments%3e%3cFlightSegment%3e%3cAirEquipType%3e744%3c%2fAirEquipType%3e%3cArrivalAirportCode%3eLHR%3c%2fArrivalAirportCode%3e%3cArrivalAirportName%3eLondon%3c%2fArrivalAirportName%3e%3cArrivalDateTime%3e2012-11-19T13%3a25%3a00%3c%2fArrivalDateTime%3e%3cDepartureAirportCode%3eBLR%3c%2fDepartureAirportCode%3e%3cDepartureAirportName%3eBANGALORE%3c%2fDepartureAirportName%3e%3cDepartureDateTime%3e2012-11-19T07%3a50%3a00%3c%2fDepartureDateTime%3e%3cFlightNumber%3e6656%3c%2fFlightNumber%3e%3cMarketingAirlineCode%3eAA%3c%2fMarketingAirlineCode%3e%3cOperatingAirlineCode%3eBA%3c%2fOperatingAirlineCode%3e%3cOperatingAirlineName%3eAmerican+Airlines+%3c%2fOperatingAirlineName%3e%3cOperatingAirlineFlightNumber%3e6656%3c%2fOperatingAirlineFlightNumber%3e%3cNumStops%3e0%3c%2fNumStops%3e%3cLinkSellAgrmnt+%2f%3e%3cConx%3eN%3c%2fConx%3e%3cAirpChg%3eN%3c%2fAirpChg%3e%3cInsideAvailOption%3eC%3c%2fInsideAvailOption%3e%3cGenTrafRestriction%3e%3f%3c%2fGenTrafRestriction%3e%3cDaysOperates%3eNA%3c%2fDaysOperates%3e%3cJrnyTm%3e665%3c%2fJrnyTm%3e%3cEndDt+%2f%3e%3cStartTerminal+%2f%3e%3cEndTerminal+%2f%3e%3cFltTm%3e665%3c%2fFltTm%3e%3cLSAInd%3eR%3c%2fLSAInd%3e%3cMile%3e0%3c%2fMile%3e%3cBookingClass%3e%3cAvailability%3e1%3c%2fAvailability%3e%3cBIC%3eS%3c%2fBIC%3e%3c%2fBookingClass%3e%3cBookingClassFare%3e%3cbookingclass%3eS%3c%2fbookingclass%3e%3cclassType%3eEconomy%3c%2fclassType%3e%3cfarebasiscode%3eZeHo17My7PSA3CBU2WO9J34bX8FEuX61F9zkShsUkYU%3d%3c%2ffarebasiscode%3e%3cRule%3eCancellation+Penalty%3a+All+bookings+done+are+subject+to+the+cancellation+penalty+levied+by+the+respective+airline.%26lt%3bbr%26gt%3bIn+addition+to+the+airline''s+cancellation+penalty%2c+we+charge+a+service+fee+of+Rs.+200+per+passenger+for+all+cancellations.%7cDate+Change+Penalty%3a+In+addition+to+the+airline''s+date+change+penalty%2c+we+charge+a+service+fee+of+Rs.+250+per+passenger+for+any+date+changes.%7c%3c%2fRule%3e%3cPsgrBreakup%3e%3cPsgrAry%3e%3cPsgr%3e%3cPsgrType%3eADT%3c%2fPsgrType%3e%3cBaseFare%3e21250%3c%2fBaseFare%3e%3cTax%3e19675%3c%2fTax%3e%3cBagInfo+%2f%3e%3c%2fPsgr%3e%3c%2fPsgrAry%3e%3c%2fPsgrBreakup%3e%3c%2fBookingClassFare%3e%3c%2fFlightSegment%3e%3cFlightSegment%3e%3cAirEquipType%3e777%3c%2fAirEquipType%3e%3cArrivalAirportCode%3eJFK%3c%2fArrivalAirportCode%3e%3cArrivalAirportName%3eNEW+YORK%3c%2fArrivalAirportName%3e%3cArrivalDateTime%3e2012-11-19T18%3a10%3a00%3c%2fArrivalDateTime%3e%3cDepartureAirportCode%3eLHR%3c%2fDepartureAirportCode%3e%3cDepartureAirportName%3eLondon%3c%2fDepartureAirportName%3e%3cDepartureDateTime%3e2012-11-19T15%3a15%3a00%3c%2fDepartureDateTime%3e%3cFlightNumber%3e6134%3c%2fFlightNumber%3e%3cMarketingAirlineCode%3eAA%3c%2fMarketingAirlineCode%3e%3cOperatingAirlineCode%3eBA%3c%2fOperatingAirlineCode%3e%3cOperatingAirlineName%3eAmerican+Airlines+%3c%2fOperatingAirlineName%3e%3cOperatingAirlineFlightNumber%3e6134%3c%2fOperatingAirlineFlightNumber%3e%3cNumStops%3e0%3c%2fNumStops%3e%3cLinkSellAgrmnt+%2f%3e%3cConx%3eN%3c%2fConx%3e%3cAirpChg%3eN%3c%2fAirpChg%3e%3cInsideAvailOption%3eC%3c%2fInsideAvailOption%3e%3cGenTrafRestriction%3e%3f%3c%2fGenTrafRestriction%3e%3cDaysOperates%3eNA%3c%2fDaysOperates%3e%3cJrnyTm%3e985%3c%2fJrnyTm%3e%3cEndDt+%2f%3e%3cStartTerminal+%2f%3e%3cEndTerminal+%2f%3e%3cFltTm%3e985%3c%2fFltTm%3e%3cLSAInd%3eR%3c%2fLSAInd%3e%3cMile%3e0%3c%2fMile%3e%3cBookingClass%3e%3cAvailability%3e7%3c%2fAvailability%3e%3cBIC%3eS%3c%2fBIC%3e%3c%2fBookingClass%3e%3cBookingClassFare%3e%3cbookingclass%3eS%3c%2fbookingclass%3e%3cclassType%3eEconomy%3c%2fclassType%3e%3cfarebasiscode%3eZeHo17My7PSA3CBU2WO9J34bX8FEuX61F9zkShsUkYU%3d%3c%2ffarebasiscode%3e%3cRule%3eCancellation+Penalty%3a+All+bookings+done+are+subject+to+the+cancellation+penalty+levied+by+the+respective+airline.%26lt%3bbr%26gt%3bIn+addition+to+the+airline''s+cancellation+penalty%2c+we+charge+a+service+fee+of+Rs.+200+per+passenger+for+all+cancellations.%7cDate+Change+Penalty%3a+In+addition+to+the+airline''s+date+change+penalty%2c+we+charge+a+service+fee+of+Rs.+250+per+passenger+for+any+date+changes.%7c%3c%2fRule%3e%3cPsgrBreakup%3e%3cPsgrAry%3e%3cPsgr%3e%3cPsgrType%3eADT%3c%2fPsgrType%3e%3cBaseFare%3e21250%3c%2fBaseFare%3e%3cTax%3e19675%3c%2fTax%3e%3cBagInfo+%2f%3e%3c%2fPsgr%3e%3c%2fPsgrAry%3e%3c%2fPsgrBreakup%3e%3c%2fBookingClassFare%3e%3c%2fFlightSegment%3e%3c%2fFlightSegments%3e%3c%2fonward%3e%3cReturn+%2f%3e%3cid%3earzoo13%3c%2fid%3e%3ckey%3ezWbxBFyA059f68R2DgKcVEb0gG2ZuxB2eOVHvZcIhsrrFUGZlB%2fH443Le2GIKliKcDol4S0eYt5n4urlPHf4zwkxESOCSurS2zJT2fsu8E6Ny3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cCU%2fhS9xGE%2bmdK%2bSICvYvDvXFXubDdIyuoEEf9FbAN4z7uuUBbuJWfy8uNPG%2f9b2fi6uU8d%2fjPtkPz%2bQotFGxf68R2DgKcVAxln%2bJT2sq20MHk4j4XRiE%2bdv3J10pg7QerGRHTwDoP0MHk4j4XRiFoKIn0f2tgo%2f6%2fbBnC356utwJT%2bFL3EYQxhMrs9%2bLl73qUfflxOSlgjct7YYgqWIooknPUNPq0fsMbz0mCCnYdPxS%2fgiio89vDvXFXubDdI5p3QtIQ6TM%2bX%2bvEdg4CnFSHVzKRaecmxRqaN5ZXELxy0MHk4j4XRiFoKIn0f2tgo08iYOkW5WfDVAdtvjUETBAUbFQMZCvw%2frcCU%2fhS9xGEV%2fKirOjbVWVf68R2DgKcVIdXMpFp5ybFFnoP%2frNoJySNy3thiCpYinP52%2ba6dCWv4z7uuUBbuJUr4zgoGssePSsZx2FQz4QzMi4GIKZ%2fbQN5v2nhdWyUxWkXlLIRnKfWBOVnFhmDx7P%2bRkIizk8EmY3Le2GIKliKvHScqTjHzQGFdYu72bssK9yA%2fLGYY4DttwJT%2bFL3EYR8llOd%2fAvvBcO9cVe5sN0jaHWZ74lyniM%2bCXHuBVUeI0eCjTlyW%2bv3IvPKAXmAs%2fXjPu65QFu4lRIiMi13yfqv0MHk4j4XRiFoKIn0f2tgo3rxF%2fw%2fvseO0MHk4j4XRiFoKIn0f2tgo08iYOkW5WfDtBFngPW6tS4UbFQMZCvw%2frcCU%2fhS9xGEPmH%2brCYA9GVn4urlPHf4z%2fKpTLVv6TwZmq%2fOLBKU%2burDvXFXubDdI76GeeoT8f7%2fmZIC7bwXLBPEyJNwmQ0Hhl%2frxHYOApxUwsS2F117BWpVx8rwsmCp%2f7cCU%2fhS9xGEO2M3JTnaOUPjPu65QFu4lcYxXFxB1Lxm2zJT2fsu8E6Ny3thiCpYiskg7jRgjK6SgNO9QJL9N%2bkUA6rZxn6L2roVT2rwaaIHT9JeYXDjtB74LCthwRi6QuM%2b7rlAW7iVci%2fYXLUgYhtn4urlPHf4z0sauaT5dh0YX%2bvEdg4CnFRm6meIMgjYjdDB5OI%2bF0YhaCiJ9H9rYKMzmFBNkf0Z9F%2frxHYOApxU8q6B7%2ffP8qZn4urlPHf4z6xCf1SAy2vSGs5%2fDTSC7BXjPu65QFu4lXSi4I4fhBoPMaaYjNFAcsm3AlP4UvcRhPpnSvkiAr2Lw71xV7mw3SMrqBBH%2fRWwDeM%2b7rlAW7iVdKLgjh%2bEGg9kUDg3MAXg5eM%2b7rlAW7iV3nbymUm4szIU66LMw4VmWYV1i7vZuywr4wJX2WV2PV5f68R2DgKcVAxln%2bJT2sq20MHk4j4XRiEuvf9jqO9829DB5OI%2bF0YhE8ZmQzVYvJbgy4cv1MfIol%2frxHYOApxUuPBYmR6Sgw5f68R2DgKcVCB0cQSVLEagT%2be92o4%2fqz5f68R2DgKcVMcBF2dlbtCnrziqklPvBLLl8OEMpKE9Rrqlvng58vzQsS7VmIqni8k6cEhUG%2fjNng%3d%3d%3c%2fkey%3e%3c%2fOriginDestinationOption%3e%3c%2fBookingrequest%3e";
        //string xmlRequest = "xmlRequest=%3cEticketRequest%3e%3cClientid%3e77743504%3c%2fClientid%3e%3cClientpassword%3e*C6AB4F2C7F3C8C948CF18FBEA508B3E8830154D0%3c%2fClientpassword%3e%3cClienttype%3eArzooINTLWS1.0%3c%2fClienttype%3e%3ctransid%3eA396009%3c%2ftransid%3e%3c%2fEticketRequest%3e";

        //StringBuilder stt = new StringBuilder();
        //stt.Append((xmlRequest));

        //byte[] requestData =
        //    UTF8Encoding.UTF8.GetBytes(stt.ToString());

        //HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/BookingStatus");

        //request.Method = "POST";
        //request.ContentType = "application/x-www-form-urlencoded";
        //request.Accept = "application/json";

        //request.ContentType = "multipart/form-data";
        //request.ContentLength = requestData.Length;

        //using (Stream requestStream = request.GetRequestStream())
        //{
        //    requestStream.Write(requestData, 0, requestData.Length);
        //}

        //DataSet ds = new DataSet();
        //string result = string.Empty;
        //using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
        //{
        //    using (Stream stream = response.GetResponseStream())
        //    {
        //        using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
        //            result = reader.ReadToEnd();
        //        XmlDocument doc = new XmlDocument();
        //        doc.LoadXml(result);
        //        XmlNodeReader xmlReader = new XmlNodeReader(doc);

        //        ds.ReadXml(xmlReader);
        //    }
        //}

        //#region unwanted Code
        //string xmlRequest1 = "<Bookingrequest>";
        //xmlRequest1 = xmlRequest1 + "<noadults>1</noadults>";
        //xmlRequest1 = xmlRequest1 + "<nochild>0</nochild>";
        //xmlRequest1 = xmlRequest1 + "<noinfant>0</noinfant>";
        //xmlRequest1 = xmlRequest1 + "<Clientid>77743504</Clientid>";
        //xmlRequest1 = xmlRequest1 + "<Clientpassword>*C6AB4F2C7F3C8C948CF18FBEA508B3E8830154D0</Clientpassword>";
        //xmlRequest1 = xmlRequest1 + "<Clienttype>ArzooINTLWS1.0</Clienttype>";
        //xmlRequest1 = xmlRequest1 + "<creditcardno />";
        //xmlRequest1 = xmlRequest1 + "<PartnerreferenceID>LJIF7585341</PartnerreferenceID>";
        //xmlRequest1 = xmlRequest1 + "<personName>";
        //xmlRequest1 = xmlRequest1 + "<CustomerInfo>";
        //xmlRequest1 = xmlRequest1 + "<givenName>Bindu</givenName>";
        //xmlRequest1 = xmlRequest1 + "<surName>Bhargavi</surName>";
        //xmlRequest1 = xmlRequest1 + "<nameReference>Mrs.</nameReference>";
        //xmlRequest1 = xmlRequest1 + "<psgrtype>adt</psgrtype>";
        //xmlRequest1 = xmlRequest1 + "</CustomerInfo>";
        //xmlRequest1 = xmlRequest1 + "</personName>";
        //xmlRequest1 = xmlRequest1 + "<telePhone>";
        //xmlRequest1 = xmlRequest1 + "<phoneNumber>9701213996</phoneNumber>";
        //xmlRequest1 = xmlRequest1 + "</telePhone>";
        //xmlRequest1 = xmlRequest1 + "<email>";
        //xmlRequest1 = xmlRequest1 + "<emailAddress>[email protected]</emailAddress>";
        //xmlRequest1 = xmlRequest1 + "</email>";
        //xmlRequest1 = xmlRequest1 + "<OriginDestinationOption>";
        //xmlRequest1 = xmlRequest1 + "<FareDetails>";
        //xmlRequest1 = xmlRequest1 + "<ActualBaseFare>47695</ActualBaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>39808</Tax>";
        //xmlRequest1 = xmlRequest1 + "<STax>592</STax>";
        //xmlRequest1 = xmlRequest1 + "<TCharge>0</TCharge>";
        //xmlRequest1 = xmlRequest1 + "<SCharge>5446</SCharge>";
        //xmlRequest1 = xmlRequest1 + "<TDiscount>1432</TDiscount>";
        //xmlRequest1 = xmlRequest1 + "<TMarkup>0</TMarkup>";
        //xmlRequest1 = xmlRequest1 + "<TPartnerCommission>0</TPartnerCommission>";
        //xmlRequest1 = xmlRequest1 + "<TSdiscount>0</TSdiscount>";
        //xmlRequest1 = xmlRequest1 + "<FareBreakup>";
        //xmlRequest1 = xmlRequest1 + "<FareAry>";
        //xmlRequest1 = xmlRequest1 + "<Fare>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>ADT</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>27210</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "</Fare>";
        //xmlRequest1 = xmlRequest1 + "<Fare>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>CH</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>20485</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "</Fare>";
        //xmlRequest1 = xmlRequest1 + "</FareAry>";
        //xmlRequest1 = xmlRequest1 + "</FareBreakup>";
        //xmlRequest1 = xmlRequest1 + "<ocTax>0</ocTax>";
        //xmlRequest1 = xmlRequest1 + "</FareDetails>";
        //xmlRequest1 = xmlRequest1 + "<onward>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegments>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<AirEquipType>333</AirEquipType>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportCode>MUC</ArrivalAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "MUNICH&lt;BR&gt; (FRANZ JOSEF STRAUSS)";
        //xmlRequest1 = xmlRequest1 + "</ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalDateTime>2010-03-26T05:55:00</ArrivalDateTime>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportCode>BOM</DepartureAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "MUMBAI&lt;BR&gt; (CHHATRAPATI SHIVAJI INTERNATIONAL)";
        //xmlRequest1 = xmlRequest1 + "</DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "<DepartureDateTime>2010-03-26T01:50:00</DepartureDateTime>";
        //xmlRequest1 = xmlRequest1 + "<FlightNumber>765</FlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<MarketingAirlineCode>LH</MarketingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineCode>LH</OperatingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineName>Lufthansa </OperatingAirlineName>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineFlightNumber>765</OperatingAirlineFlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<NumStops>0</NumStops>";
        //xmlRequest1 = xmlRequest1 + "<LinkSellAgrmnt></LinkSellAgrmnt>";
        //xmlRequest1 = xmlRequest1 + "<Conx>N</Conx>";
        //xmlRequest1 = xmlRequest1 + "<AirpChg>N</AirpChg>";
        //xmlRequest1 = xmlRequest1 + "<InsideAvailOption>C</InsideAvailOption>";
        //xmlRequest1 = xmlRequest1 + "<GenTrafRestriction>?</GenTrafRestriction>";
        //xmlRequest1 = xmlRequest1 + "<DaysOperates>NA</DaysOperates>";
        //xmlRequest1 = xmlRequest1 + "<JrnyTm></JrnyTm>";
        //xmlRequest1 = xmlRequest1 + "<EndDt></EndDt>";
        //xmlRequest1 = xmlRequest1 + "<StartTerminal></StartTerminal>";
        //xmlRequest1 = xmlRequest1 + "<EndTerminal></EndTerminal>";
        //xmlRequest1 = xmlRequest1 + "<FltTm>0</FltTm>";
        //xmlRequest1 = xmlRequest1 + "<LSAInd>R</LSAInd>";
        //xmlRequest1 = xmlRequest1 + "<Mile>0</Mile>";
        //xmlRequest1 = xmlRequest1 + "<BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<Availability>9</Availability>";
        //xmlRequest1 = xmlRequest1 + "<BIC>V</BIC>";
        //xmlRequest1 = xmlRequest1 + "</BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "<bookingclass>V</bookingclass>";
        //xmlRequest1 = xmlRequest1 + "<classType>Economy</classType>";
        //xmlRequest1 = xmlRequest1 + "<farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "yqM5v0NYhXsaIN1nmxAEWRgIoQLXTIV0";
        //xmlRequest1 = xmlRequest1 + "</farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "<Rule></Rule>";
        //xmlRequest1 = xmlRequest1 + "<PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "<PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>ADT</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>27210</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>CH</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>20485</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "</PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "</PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "</BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<AirEquipType>320</AirEquipType>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportCode>LHR</ArrivalAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "LONDON&lt;BR&gt; (HEATHROW)";
        //xmlRequest1 = xmlRequest1 + "</ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalDateTime>2010-03-26T12:30:00</ArrivalDateTime>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportCode>MUC</DepartureAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "MUNICH&lt;BR&gt; (FRANZ JOSEF STRAUSS)";
        //xmlRequest1 = xmlRequest1 + "</DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "<DepartureDateTime>2010-03-26T11:25:00</DepartureDateTime>";
        //xmlRequest1 = xmlRequest1 + "<FlightNumber>4754</FlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<MarketingAirlineCode>LH</MarketingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineCode>LH</OperatingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineName>Lufthansa </OperatingAirlineName>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineFlightNumber>4754</OperatingAirlineFlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<NumStops>0</NumStops>";
        //xmlRequest1 = xmlRequest1 + "<LinkSellAgrmnt></LinkSellAgrmnt>";
        //xmlRequest1 = xmlRequest1 + "<Conx>N</Conx>";
        //xmlRequest1 = xmlRequest1 + "<AirpChg>N</AirpChg>";
        //xmlRequest1 = xmlRequest1 + "<InsideAvailOption>C</InsideAvailOption>";
        //xmlRequest1 = xmlRequest1 + "<GenTrafRestriction>?</GenTrafRestriction>";
        //xmlRequest1 = xmlRequest1 + "<DaysOperates>NA</DaysOperates>";
        //xmlRequest1 = xmlRequest1 + "<JrnyTm></JrnyTm>";
        //xmlRequest1 = xmlRequest1 + "<EndDt></EndDt>";
        //xmlRequest1 = xmlRequest1 + "<StartTerminal></StartTerminal>";
        //xmlRequest1 = xmlRequest1 + "<EndTerminal></EndTerminal>";
        //xmlRequest1 = xmlRequest1 + "<FltTm>0</FltTm>";
        //xmlRequest1 = xmlRequest1 + "<LSAInd>R</LSAInd>";
        //xmlRequest1 = xmlRequest1 + "<Mile>0</Mile>";
        //xmlRequest1 = xmlRequest1 + "<BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<Availability>9</Availability>";
        //xmlRequest1 = xmlRequest1 + "<BIC>V</BIC>";
        //xmlRequest1 = xmlRequest1 + "</BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "<bookingclass>V</bookingclass>";
        //xmlRequest1 = xmlRequest1 + "<classType>Economy</classType>";
        //xmlRequest1 = xmlRequest1 + "<farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "yqM5v0NYhXsaIN1nmxAEWRgIoQLXTIV0";
        //xmlRequest1 = xmlRequest1 + "</farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "<Rule></Rule>";
        //xmlRequest1 = xmlRequest1 + "<PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "<PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>ADT</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>27210</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>CH</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>20485</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "</PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "</PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "</BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegments>";
        //xmlRequest1 = xmlRequest1 + "</onward>";
        //xmlRequest1 = xmlRequest1 + "<Return>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegments>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<AirEquipType>321</AirEquipType>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportCode>FRA</ArrivalAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "FRANKFURT&lt;BR&gt; (RHEIN-MAIN INTERNATIONAL)";
        //xmlRequest1 = xmlRequest1 + "</ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalDateTime>2010-04-02T12:15:00</ArrivalDateTime>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportCode>LHR</DepartureAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "LONDON&lt;BR&gt; (HEATHROW)";
        //xmlRequest1 = xmlRequest1 + "</DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "<DepartureDateTime>2010-04-02T09:45:00</DepartureDateTime>";
        //xmlRequest1 = xmlRequest1 + "<FlightNumber>4725</FlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<MarketingAirlineCode>LH</MarketingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineCode>LH</OperatingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineName>Lufthansa </OperatingAirlineName>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineFlightNumber>4725</OperatingAirlineFlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<NumStops>0</NumStops>";
        //xmlRequest1 = xmlRequest1 + "<LinkSellAgrmnt></LinkSellAgrmnt>";
        //xmlRequest1 = xmlRequest1 + "<Conx>N</Conx>";
        //xmlRequest1 = xmlRequest1 + "<AirpChg>N</AirpChg>";
        //xmlRequest1 = xmlRequest1 + "<InsideAvailOption>C</InsideAvailOption>";
        //xmlRequest1 = xmlRequest1 + "<GenTrafRestriction>?</GenTrafRestriction>";
        //xmlRequest1 = xmlRequest1 + "<DaysOperates>NA</DaysOperates>";
        //xmlRequest1 = xmlRequest1 + "<JrnyTm></JrnyTm>";
        //xmlRequest1 = xmlRequest1 + "<EndDt></EndDt>";
        //xmlRequest1 = xmlRequest1 + "<StartTerminal></StartTerminal>";
        //xmlRequest1 = xmlRequest1 + "<EndTerminal></EndTerminal>";
        //xmlRequest1 = xmlRequest1 + "<FltTm>0</FltTm>";
        //xmlRequest1 = xmlRequest1 + "<LSAInd>R</LSAInd>";
        //xmlRequest1 = xmlRequest1 + "<Mile>0</Mile>";
        //xmlRequest1 = xmlRequest1 + "<BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<Availability>9</Availability>";
        //xmlRequest1 = xmlRequest1 + "<BIC>U</BIC>";
        //xmlRequest1 = xmlRequest1 + "</BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "<bookingclass>U</bookingclass>";
        //xmlRequest1 = xmlRequest1 + "<classType>Economy</classType>";
        //xmlRequest1 = xmlRequest1 + "<farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "WUE4MEEYPYSZLA+s0/6mnYnDM963BJmv</farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "<Rule></Rule>";
        //xmlRequest1 = xmlRequest1 + "<PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "<PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>ADT</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>27210</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>CH</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>20485</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "</PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "</PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "</BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "<AirEquipType>744</AirEquipType>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportCode>BOM</ArrivalAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "MUMBAI&lt;BR&gt; (CHHATRAPATI SHIVAJI INTERNATIONAL)";
        //xmlRequest1 = xmlRequest1 + "</ArrivalAirportName>";
        //xmlRequest1 = xmlRequest1 + "<ArrivalDateTime>2010-04-03T01:00:00</ArrivalDateTime>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportCode>FRA</DepartureAirportCode>";
        //xmlRequest1 = xmlRequest1 + "<DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "FRANKFURT&lt;BR&gt; (RHEIN-MAIN INTERNATIONAL)";
        //xmlRequest1 = xmlRequest1 + "</DepartureAirportName>";
        //xmlRequest1 = xmlRequest1 + "<DepartureDateTime>2010-04-02T13:30:00</DepartureDateTime>";
        //xmlRequest1 = xmlRequest1 + "<FlightNumber>756</FlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<MarketingAirlineCode>LH</MarketingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineCode>LH</OperatingAirlineCode>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineName>Lufthansa </OperatingAirlineName>";
        //xmlRequest1 = xmlRequest1 + "<OperatingAirlineFlightNumber>756</OperatingAirlineFlightNumber>";
        //xmlRequest1 = xmlRequest1 + "<NumStops>0</NumStops>";
        //xmlRequest1 = xmlRequest1 + "<LinkSellAgrmnt></LinkSellAgrmnt>";
        //xmlRequest1 = xmlRequest1 + "<Conx>N</Conx>";
        //xmlRequest1 = xmlRequest1 + "<AirpChg>N</AirpChg>";
        //xmlRequest1 = xmlRequest1 + "<InsideAvailOption>C</InsideAvailOption>";
        //xmlRequest1 = xmlRequest1 + "<GenTrafRestriction>?</GenTrafRestriction>";
        //xmlRequest1 = xmlRequest1 + "<DaysOperates>NA</DaysOperates>";
        //xmlRequest1 = xmlRequest1 + "<JrnyTm></JrnyTm>";
        //xmlRequest1 = xmlRequest1 + "<EndDt></EndDt>";
        //xmlRequest1 = xmlRequest1 + "<StartTerminal></StartTerminal>";
        //xmlRequest1 = xmlRequest1 + "<EndTerminal></EndTerminal>";
        //xmlRequest1 = xmlRequest1 + "<FltTm>0</FltTm>";
        //xmlRequest1 = xmlRequest1 + "<LSAInd>R</LSAInd>";
        //xmlRequest1 = xmlRequest1 + "<Mile>0</Mile>";
        //xmlRequest1 = xmlRequest1 + "<BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<Availability>9</Availability>";
        //xmlRequest1 = xmlRequest1 + "<BIC>U</BIC>";
        //xmlRequest1 = xmlRequest1 + "</BookingClass>";
        //xmlRequest1 = xmlRequest1 + "<BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "<bookingclass>U</bookingclass>";
        //xmlRequest1 = xmlRequest1 + "<classType>Economy</classType>";
        //xmlRequest1 = xmlRequest1 + "<farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "WUE4MEEYPYSZLA+s0/6mnYnDM963BJmv";
        //xmlRequest1 = xmlRequest1 + "</farebasiscode>";
        //xmlRequest1 = xmlRequest1 + "<Rule></Rule>";
        //xmlRequest1 = xmlRequest1 + "<PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "<PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>ADT</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>27210</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "<Psgr>";
        //xmlRequest1 = xmlRequest1 + "<PsgrType>CH</PsgrType>";
        //xmlRequest1 = xmlRequest1 + "<BaseFare>20485</BaseFare>";
        //xmlRequest1 = xmlRequest1 + "<Tax>19904</Tax>";
        //xmlRequest1 = xmlRequest1 + "<BagInfo></BagInfo>";
        //xmlRequest1 = xmlRequest1 + "</Psgr>";
        //xmlRequest1 = xmlRequest1 + "</PsgrAry>";
        //xmlRequest1 = xmlRequest1 + "</PsgrBreakup>";
        //xmlRequest1 = xmlRequest1 + "</BookingClassFare>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegment>";
        //xmlRequest1 = xmlRequest1 + "</FlightSegments>";
        //xmlRequest1 = xmlRequest1 + "</Return>";
        //xmlRequest1 = xmlRequest1 + "<id>arzoo100</id>";
        //xmlRequest1 = xmlRequest1 + "<key>";
        //xmlRequest1 = xmlRequest1 + "ayCbutV8CZjQweTiPhdGIT52/cnXSmDtW0+odNovIFOF8un5";
        //xmlRequest1 = xmlRequest1 + "AJPBb7V2tDREqpGU0xnw71xV7mw3SP/kC8yBwxIOl/rxHYOApxURZOpRI/EzoF";
        //xmlRequest1 = xmlRequest1 + "d7dK7fhve+hILDZeewhkbrcFyMeloNkLDvXFXubDdI3dYiTg2zkNgIHhU4iQld3Fl";
        //xmlRequest1 = xmlRequest1 + "ClCzmIhe3l/rxHY/W9n4urlPHf4z+njlwFtB3IO6xVBmZQfx+ONy3thiCpYihRRnjy";
        //xmlRequest1 = xmlRequest1 + "QGrh7hXWLu9m7LCssMPJ4Xz20E/AXuBAVa2pxejpWXnEONNsWMLyOaJ/46rcC";
        //xmlRequest1 = xmlRequest1 + "U/hS9xGEPmH+rCYA9GVn4urlPHf4z41sVU7IkWB1idvC1SOSkJo8Clq4QtPJH5e";
        //xmlRequest1 = xmlRequest1 + "OG+w/Tp6htwJT+FL3EYRl9UiNoisc9HyTOZugcDuuD6wCvTuWoqZn4urlPHf4zy";
        //xmlRequest1 = xmlRequest1 + "5qdpggg8kv+h2PVlh5TauNy3thiCpYimncUOikTc32qTDxvbKXRkDNVdEncBXTyf";
        //xmlRequest1 = xmlRequest1 + "wRxKcdia+BmFbl5xc5AzXW3zphRsDlX1/rxHYOApxU4bsCT7uQbmIrac8w85dt";
        //xmlRequest1 = xmlRequest1 + "W7V5rv0yg1HCC7EdqY4QNtWFdYu72bssK4zVZNpWlHODZ+Lq5Tx3+M95+o/T";
        //xmlRequest1 = xmlRequest1 + "OJ/CBNDB5OI+F0YhaCiJ9H9rYKPC8MQS0HHvuMO9cVe5sN0jovQ2S6OQ3ufQ";
        //xmlRequest1 = xmlRequest1 + "mgf2Il4HzuNFPw3awHH5z+Y3IOM/UTyGQfP5W/7HecO9cVe5sN0jwh2QYDQazt";
        //xmlRequest1 = xmlRequest1 + "jjPu65QFu4lWZp0ICotvbLZ+Lq5Tx3+M9IEf8zMi+Fm1/rxHYOApxUSrftj2WKPg";
        //xmlRequest1 = xmlRequest1 + "ozrhjxOHyuKGfi6uU8d/jPgGO60OqILA7QweTiPhdGIWgoifR/a2CjkIThVrkAvqG3";
        //xmlRequest1 = xmlRequest1 + "AlP4UvcRhDKnfx36LGjsnKBVHMf4TZhhf/d6g0XR7quCWXdxw6/CkpXKP6Yc0bv";
        //xmlRequest1 = xmlRequest1 + "jPu65QFu4lV1rTomJXOZBCXxoVW8LhSSKpD2toj/Wf9DB5OI+F0YhaCiJ9H9rYK";
        //xmlRequest1 = xmlRequest1 + "P+v2wZwt+errcCU/hS9xGEsEPWeqQOQ+x7X3kobL84XAtD2ApLfOtn0MHk4j4";
        //xmlRequest1 = xmlRequest1 + "XRiFoKIn0f2tgo9VvT6P2JVxHWG/ThsKfQLEUbFQMZCvw/rcCU/hS9xGE1lb8XeE";
        //xmlRequest1 = xmlRequest1 + "H6pdf68R2DgKcVIBWKDaHLUsEbsrlvDwzO6mNy3thiCpYipiWCrDARrV04z7uuU";
        //xmlRequest1 = xmlRequest1 + "BbuJWM+ajbeG1zEHBqb5AoGvBY2JxE7jZebWp/khFJiE2pyBUWR4ycou2a4z7u";
        //xmlRequest1 = xmlRequest1 + "uUBbuJUHwyZQ7PU8hS9xGEsEPWeqQOQ+x7X3kobL84XAtD2ApLfOtn0MHk4j";
        //xmlRequest1 = xmlRequest1 + "4XRiFoKIn0f2tgo9VvT6P2JVxHWG/ThsKfQLEUbFQMZCvw/rcCU/hS9xGE1lb8Xe";
        //xmlRequest1 = xmlRequest1 + "EH6pdf68R2DgKcVIBWKDaHLhS9xGEsEPWeqQOQ+x7X3kobL84XAtD2ApLfOtn";
        //xmlRequest1 = xmlRequest1 + "0MHk4j4XRiFoKIn0f2tgo9VvT6P2JVxHWG/ThsKfQLEUbFQMZCvw/rcCU/hS9xG";
        //xmlRequest1 = xmlRequest1 + "E1lb8XeEH6pdf68R2DgKcVIBWKDaHLUsEbsrlvDwzO6mNy3thiCpYipiWCrDARr";
        //xmlRequest1 = xmlRequest1 + "V04z7uuUBbuJWM+ajbeG1zEHBqb5AoGvBY2JxE7jZebWpUsEbsrlvDwzO6mNy";
        //xmlRequest1 = xmlRequest1 + "3thiCpYipiWCrDARrV04z7uuUBbuJWM+ajbeG1zEHBqb5AoGvBY2JxE7jZebWpL";
        //xmlRequest1 = xmlRequest1 + "Gfi6uU8d/jPuRH7HSVhDktf68R2DgKcVEWTqUSPxM6B0MHk4j4XRiFoKIn0f2tgo";
        //xmlRequest1 = xmlRequest1 + "zOYUE2R/Rn0X+vEdg4CnFTyroHv98/ypmfi OApxUzm3JG/E8ydN69zaM+";
        //xmlRequest1 = xmlRequest1 + "</key>";
        //xmlRequest1 = xmlRequest1 + "</OriginDestinationOption>";
        //xmlRequest1 = xmlRequest1 + "</Bookingrequest>";
        //#endregion

           string XmlPricingRequest = "<PriceRequest> <noadults>1</noadults> <nochild>0</nochild> <noinfant>0</noinfant> <Clientid>43838</Clientid><Clientpassword>*DC0500F443C3062D74DD92EBB0C396B1E13DCEC6</Clientpassword>";
        XmlPricingRequest = XmlPricingRequest + "<Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails>  <ActualBaseFare>25800</ActualBaseFare><Tax>17890</Tax> <STax>176</STax> <TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>1423</TDiscount><TMarkup>0</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare> <PsgrType>ADT</PsgrType><BaseFare>25800</BaseFare> <Tax>17890</Tax><TaxDataAry><TaxData><Country>IN</Country>      <Amt>00000260</Amt></TaxData><TaxData> <Country>JN</Country> <Amt>00001946</Amt> </TaxData> <TaxData><Country>WO</Country><Amt>00000225</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>US</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00000926</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>XA</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00000277</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>XY</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00000388</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>YC</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00000305</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>YQ</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00013243</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>YR</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>00000300</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<TaxData>";
        XmlPricingRequest = XmlPricingRequest + "<Country>Other</Country>";
        XmlPricingRequest = XmlPricingRequest + "<Amt>20</Amt>";
        XmlPricingRequest = XmlPricingRequest + "</TaxData>";
        XmlPricingRequest = XmlPricingRequest + "</TaxDataAry>";
        XmlPricingRequest = XmlPricingRequest + "</Fare>";
        XmlPricingRequest = XmlPricingRequest + "</FareAry>";
        XmlPricingRequest = XmlPricingRequest + "</FareBreakup>";
        XmlPricingRequest = XmlPricingRequest + "<ocTax>0</ocTax>";
        XmlPricingRequest = XmlPricingRequest + "</FareDetails>";
        XmlPricingRequest = XmlPricingRequest + "<onward>";
        XmlPricingRequest = XmlPricingRequest + "<FlightSegments>";
        XmlPricingRequest = XmlPricingRequest + "<FlightSegment>";
        XmlPricingRequest = XmlPricingRequest + "<AirEquipType>788</AirEquipType>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalAirportCode>DEL</ArrivalAirportCode>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalAirportName>NEW DELHI</ArrivalAirportName>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalDateTime>2012-12-29T22:45:00</ArrivalDateTime>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureAirportCode>BLR</DepartureAirportCode>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureAirportName>BANGALORE</DepartureAirportName>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureDateTime>2012-12-29T20:05:00</DepartureDateTime>";
        XmlPricingRequest = XmlPricingRequest + "<FlightNumber>404</FlightNumber>";
        XmlPricingRequest = XmlPricingRequest + "<MarketingAirlineCode>AI</MarketingAirlineCode>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineCode>AI</OperatingAirlineCode>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineName>Air India </OperatingAirlineName>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineFlightNumber>404</OperatingAirlineFlightNumber>";
        XmlPricingRequest = XmlPricingRequest + "<NumStops>0</NumStops>";
        XmlPricingRequest = XmlPricingRequest + "<LinkSellAgrmnt>SS</LinkSellAgrmnt>";
        XmlPricingRequest = XmlPricingRequest + "<Conx>Y</Conx>";
        XmlPricingRequest = XmlPricingRequest + "<AirpChg>N</AirpChg>";
        XmlPricingRequest = XmlPricingRequest + "<InsideAvailOption>L</InsideAvailOption>";
        XmlPricingRequest = XmlPricingRequest + "<GenTrafRestriction>?</GenTrafRestriction>";
        XmlPricingRequest = XmlPricingRequest + "<DaysOperates>NNNNNNY</DaysOperates>";
        XmlPricingRequest = XmlPricingRequest + "<JrnyTm>1260</JrnyTm>";
        XmlPricingRequest = XmlPricingRequest + "<EndDt>20121229</EndDt>";
        XmlPricingRequest = XmlPricingRequest + "<StartTerminal>?</StartTerminal>";
        XmlPricingRequest = XmlPricingRequest + "<EndTerminal>3</EndTerminal>";
        XmlPricingRequest = XmlPricingRequest + "<FltTm>160</FltTm>";
        XmlPricingRequest = XmlPricingRequest + "<LSAInd>N</LSAInd>";
        XmlPricingRequest = XmlPricingRequest + "<Mile>1063</Mile>";
        XmlPricingRequest = XmlPricingRequest + "<BookingClass>";
        XmlPricingRequest = XmlPricingRequest + "<Availability>009</Availability>";
        XmlPricingRequest = XmlPricingRequest + "<BIC>V</BIC>";
        XmlPricingRequest = XmlPricingRequest + "</BookingClass>";
        XmlPricingRequest = XmlPricingRequest + "<BookingClassFare>";
        XmlPricingRequest = XmlPricingRequest + "<bookingclass>V</bookingclass>";
        XmlPricingRequest = XmlPricingRequest + "<classType>Economy</classType>";
        XmlPricingRequest = XmlPricingRequest + "<farebasiscode>sFum/ZEojgraGwaWWxpMCA==</farebasiscode>";
        XmlPricingRequest = XmlPricingRequest + "<Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule>";
        XmlPricingRequest = XmlPricingRequest + "</BookingClassFare>";
        XmlPricingRequest = XmlPricingRequest + "</FlightSegment>";
        XmlPricingRequest = XmlPricingRequest + "<FlightSegment>";
        XmlPricingRequest = XmlPricingRequest + "<AirEquipType>77W</AirEquipType>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalAirportCode>JFK</ArrivalAirportCode>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalAirportName>NEW YORK</ArrivalAirportName>";
        XmlPricingRequest = XmlPricingRequest + "<ArrivalDateTime>2012-12-30T06:35:00</ArrivalDateTime>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureAirportCode>DEL</DepartureAirportCode>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureAirportName>NEW DELHI</DepartureAirportName>";
        XmlPricingRequest = XmlPricingRequest + "<DepartureDateTime>2012-12-30T01:35:00</DepartureDateTime>";
        XmlPricingRequest = XmlPricingRequest + "<FlightNumber>101</FlightNumber>";
        XmlPricingRequest = XmlPricingRequest + "<MarketingAirlineCode>AI</MarketingAirlineCode>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineCode>AI</OperatingAirlineCode>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineName>Air India </OperatingAirlineName>";
        XmlPricingRequest = XmlPricingRequest + "<OperatingAirlineFlightNumber>101</OperatingAirlineFlightNumber>";
        XmlPricingRequest = XmlPricingRequest + "<NumStops>0</NumStops>";
        XmlPricingRequest = XmlPricingRequest + "<LinkSellAgrmnt>SS</LinkSellAgrmnt>";
        XmlPricingRequest = XmlPricingRequest + "<Conx>N</Conx>";
        XmlPricingRequest = XmlPricingRequest + "<AirpChg>N</AirpChg>";
        XmlPricingRequest = XmlPricingRequest + "<InsideAvailOption>L</InsideAvailOption>";
        XmlPricingRequest = XmlPricingRequest + "<GenTrafRestriction>?</GenTrafRestriction>";
        XmlPricingRequest = XmlPricingRequest + "<DaysOperates>YNNNNNN</DaysOperates>";
        XmlPricingRequest = XmlPricingRequest + "<JrnyTm>1260</JrnyTm>";
        XmlPricingRequest = XmlPricingRequest + "<EndDt>20121230</EndDt>";
        XmlPricingRequest = XmlPricingRequest + "<StartTerminal>3</StartTerminal>";
        XmlPricingRequest = XmlPricingRequest + "<EndTerminal>4</EndTerminal>";
        XmlPricingRequest = XmlPricingRequest + "<FltTm>930</FltTm>";
        XmlPricingRequest = XmlPricingRequest + "<LSAInd>N</LSAInd>";
        XmlPricingRequest = XmlPricingRequest + "<Mile>7305</Mile>";
        XmlPricingRequest = XmlPricingRequest + "<BookingClass>";
        XmlPricingRequest = XmlPricingRequest + "<Availability>009</Availability>";
        XmlPricingRequest = XmlPricingRequest + "<BIC>U</BIC>";
        XmlPricingRequest = XmlPricingRequest + "</BookingClass>";
        XmlPricingRequest = XmlPricingRequest + "<BookingClassFare>";
        XmlPricingRequest = XmlPricingRequest + "<bookingclass>U</bookingclass>";
        XmlPricingRequest = XmlPricingRequest + "<classType>Economy</classType>";
        XmlPricingRequest = XmlPricingRequest + "<farebasiscode>sFum/ZEojgpfTZ6ZnChMcg==</farebasiscode>";
        XmlPricingRequest = XmlPricingRequest + "<Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule>";
        XmlPricingRequest = XmlPricingRequest + "</BookingClassFare>";
        XmlPricingRequest = XmlPricingRequest + "</FlightSegment>";
        XmlPricingRequest = XmlPricingRequest + "</FlightSegments>";
        XmlPricingRequest = XmlPricingRequest + "</onward>";
        XmlPricingRequest = XmlPricingRequest + "<Return />";
        XmlPricingRequest = XmlPricingRequest + "<id>arzoo20</id>";
        XmlPricingRequest = XmlPricingRequest + "<key>";
        XmlPricingRequest = XmlPricingRequest + "jT9o8XSks4Bf68R2DgKcVEb0gG2ZuxB2dAtSUvDyEiXrFUGZlB/H443Le2GIKliK1+IxT5Jdd6Fn";
        XmlPricingRequest = XmlPricingRequest + "4urlPHf4zxD8QTDQfGjoBj9z7v8mh1yNy3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cC";
        XmlPricingRequest = XmlPricingRequest + "U/hS9xGEC7b/0X1r309f68R2DgKcVAxln+JT2sq20MHk4j4XRiFoKIn0f2tgo+sVQZmUH8fjjct7";
        XmlPricingRequest = XmlPricingRequest + "YYgqWIoUUZ48kBq4e4V1i7vZuywrLDDyeF89tBPwF7gQFWtqcXo6Vl5xDjTboJMfYCoEGU63AlP4";
        XmlPricingRequest = XmlPricingRequest + "UvcRhKqEsvx45gkOZ+Lq5Tx3+M/NfRPEeZ+vSTJ8MsOj03doX+vEdg4CnFThuwJPu5BuYiAqobdQ";
        XmlPricingRequest = XmlPricingRequest + "e4cRFsX9UI2964kLsR2pjhA21YV1i7vZuywr3W2lKbmCvwzjPu65QFu4lddTHJZfHE9MInpVWQlr";
        XmlPricingRequest = XmlPricingRequest + "c15n4urlPHf4zwCXVyqmCL3Oyc5Dqj4xCNQRuH89aE+uV+sVQZmUH8fjjct7YYgqWIpcdThEZ41q";
        XmlPricingRequest = XmlPricingRequest + "o8O9cVe5sN0jLySZ32oU3TNn4urlPHf4z2NDQuv6NOBd2zJT2fsu8E6Ny3thiCpYip/OMyAe6P6A";
        XmlPricingRequest = XmlPricingRequest + "ujuL6ITNQ9eTcyC2UaC7jv5GQiLOTwSZjct7YYgqWIpjZrpPm50dZsO9cVe5sN0jW+Z6qJFt2tTj";
        XmlPricingRequest = XmlPricingRequest + "Pu65QFu4lUQ0KBTmijXcZ+Lq5Tx3+M9LWLpCi2LfC2gmgv1kTiXqsS7VmIqni8k4kywQAk+zK1/r";
        XmlPricingRequest = XmlPricingRequest + "xHYOApxUrWUZMCdI/FKX0clSDP54L4V1i7vZuywrM0CpLGyFtZGsIHOguwMYS4V1i7vZuywrepvj";
        XmlPricingRequest = XmlPricingRequest + "ewkAKBwu6QxzJB5R4JxqjbV0Pdej4z7uuUBbuJUUiRbdnppDXdDB5OI+F0YhaCiJ9H9rYKOXuNwG";
        XmlPricingRequest = XmlPricingRequest + "q53u14u2IEZPqlsRjct7YYgqWIoVLJu1YyUkJRj3IUHplYRjPxS/giio89vDvXFXubDdI5Vl3JcL";
        XmlPricingRequest = XmlPricingRequest + "jRh3X+vEdg4CnFTHjOYAlluBWou2IEZPqlsRjct7YYgqWIpXfC4pn5KKsMO9cVe5sN0j/FBgGM7S";
        XmlPricingRequest = XmlPricingRequest + "vpd/dfSuALUKz2seKYY6qtlWPYdjWiFRFpLDvXFXubDdI3WCs5v7MChBX+vEdg4CnFQcBUSXUAnc";
        XmlPricingRequest = XmlPricingRequest + "KtDB5OI+F0YhaCiJ9H9rYKMGdVt1F/d6w43Le2GIKliKTEE430rI7O/QweTiPhdGIY8EOPXXJg9G";
        XmlPricingRequest = XmlPricingRequest + "X+vEdg4CnFRG9IBtmbsQdv6XPm9NQecjZ+Lq5Tx3+M+sQn9UgMtr0j7apZTWr4idw71xV7mw3SMr";
        XmlPricingRequest = XmlPricingRequest + "qBBH/RWwDeM+7rlAW7iVn8vLjTxv/W9n4urlPHf4z6xCf1SAy2vSn9IL2tLxTktn4urlPHf4z0HX";
        XmlPricingRequest = XmlPricingRequest + "zlqxlv3h4rYDll/+Pwq3AlP4UvcRhK4wWDnzRGtf0MHk4j4XRiFoKIn0f2tgo161VZVvSXB90MHk";
        XmlPricingRequest = XmlPricingRequest + "4j4XRiEhPwkxP+1/6dDB5OI+F0YhE8ZmQzVYvJYYJKrcHuPYJJUgaT8utUVocKxceCT8ZcM+U+Ja";
        XmlPricingRequest = XmlPricingRequest + "aL+4KnCsXHgk/GXD4rPAuuMbP187Se8Ni7NgzGfi6uU8d/jPI1N0yGnPw4tn4urlPHf4zzWANnBS";
        XmlPricingRequest = XmlPricingRequest + "9TmLrBkjRt+2EXIGP3Pu/yaHXGN79eHghyxmpBal2nQlGVq5KmPKJOYJlYCMyqRKZf0wvCdH4oPW";
        XmlPricingRequest = XmlPricingRequest + "Id59r9ByVqdVqsUdVs/YZ9T4fa/QclanVaquAY6if9fHxJarQXZsX8bKX+vEdg4CnFSwdDskLGeL";
        XmlPricingRequest = XmlPricingRequest + "f1/rxHYOApxUIHRxBJUsRqAszUbBSPx0CIOP2Hm+YIP0OBqQFB0C1phfPXcYamWomeXw4QykoT1G";
        XmlPricingRequest = XmlPricingRequest + "1chOxdOP8mKWiB4ljlVCkCzNx7W8ezRikH3WkQQIL6Eszce1vHs0Yv3U6neij27Q4YwZArw+YyPQ";
        XmlPricingRequest = XmlPricingRequest + "weTiPhdGIebUJ2nE62zI0MHk4j4XRiETxmZDNVi8lpXlMQ6SdIk/LM3Htbx7NGIz69HaxiMED9DB";
        XmlPricingRequest = XmlPricingRequest + "5OI+F0YhE8ZmQzVYvJaFSfPE2vt6fEeCjTlyW+v3NanJYhNiFV4=";
        XmlPricingRequest = XmlPricingRequest + "</key>";
        XmlPricingRequest = XmlPricingRequest + "</OriginDestinationOption>";
        XmlPricingRequest = XmlPricingRequest + "</PriceRequest>";

        XmlPricingRequest = "<PriceRequest><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>43838</Clientid><Clientpassword>*DC0500F443C3062D74DD92EBB0C396B1E13DCEC6</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>25800</ActualBaseFare><Tax>17890</Tax><STax>176</STax><TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>1423</TDiscount><TMarkup>0</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>ADT</PsgrType><BaseFare>25800</BaseFare><Tax>17890</Tax><TaxDataAry><TaxData><Country>IN</Country><Amt>00000260</Amt></TaxData><TaxData><Country>JN</Country><Amt>00001946</Amt></TaxData><TaxData><Country>WO</Country><Amt>00000225</Amt></TaxData><TaxData><Country>US</Country><Amt>00000926</Amt></TaxData><TaxData><Country>XA</Country><Amt>00000277</Amt></TaxData><TaxData><Country>XY</Country><Amt>00000388</Amt></TaxData><TaxData><Country>YC</Country><Amt>00000305</Amt></TaxData><TaxData><Country>YQ</Country><Amt>00013243</Amt></TaxData><TaxData><Country>YR</Country><Amt>00000300</Amt></TaxData><TaxData><Country>Other</Country><Amt>20</Amt></TaxData></TaxDataAry></Fare></FareAry></FareBreakup><ocTax>0</ocTax></FareDetails><onward><FlightSegments><FlightSegment><AirEquipType>788</AirEquipType><ArrivalAirportCode>DEL</ArrivalAirportCode><ArrivalAirportName>NEW DELHI</ArrivalAirportName><ArrivalDateTime>2012-12-29T22:45:00</ArrivalDateTime><DepartureAirportCode>BLR</DepartureAirportCode><DepartureAirportName>BANGALORE</DepartureAirportName><DepartureDateTime>2012-12-29T20:05:00</DepartureDateTime><FlightNumber>404</FlightNumber><MarketingAirlineCode>AI</MarketingAirlineCode><OperatingAirlineCode>AI</OperatingAirlineCode><OperatingAirlineName>Air India </OperatingAirlineName><OperatingAirlineFlightNumber>404</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt>SS</LinkSellAgrmnt><Conx>Y</Conx><AirpChg>N</AirpChg><InsideAvailOption>S</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NNNNNNY</DaysOperates><JrnyTm>1260</JrnyTm><EndDt>20121229</EndDt><StartTerminal>?</StartTerminal><EndTerminal>3</EndTerminal><FltTm>160</FltTm><LSAInd>N</LSAInd><Mile>1063</Mile><BookingClass><Availability>009</Availability><BIC>V</BIC></BookingClass><BookingClassFare><bookingclass>V</bookingclass><classType>Economy</classType><farebasiscode>sFum/ZEojgraGwaWWxpMCA==</farebasiscode><Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule></BookingClassFare></FlightSegment><FlightSegment><AirEquipType>77W</AirEquipType><ArrivalAirportCode>JFK</ArrivalAirportCode><ArrivalAirportName>NEW YORK</ArrivalAirportName><ArrivalDateTime>2012-12-30T06:35:00</ArrivalDateTime><DepartureAirportCode>DEL</DepartureAirportCode><DepartureAirportName>NEW DELHI</DepartureAirportName><DepartureDateTime>2012-12-30T01:35:00</DepartureDateTime><FlightNumber>101</FlightNumber><MarketingAirlineCode>AI</MarketingAirlineCode><OperatingAirlineCode>AI</OperatingAirlineCode><OperatingAirlineName>Air India </OperatingAirlineName><OperatingAirlineFlightNumber>101</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt>SS</LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>S</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>YNNNNNN</DaysOperates><JrnyTm>1260</JrnyTm><EndDt>20121230</EndDt><StartTerminal>3</StartTerminal><EndTerminal>4</EndTerminal><FltTm>930</FltTm><LSAInd>N</LSAInd><Mile>7305</Mile><BookingClass><Availability>009</Availability><BIC>V</BIC></BookingClass><BookingClassFare><bookingclass>V</bookingclass><classType>Economy</classType><farebasiscode>sFum/ZEojgraGwaWWxpMCA==</farebasiscode><Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule></BookingClassFare></FlightSegment></FlightSegments></onward><Return></Return><id>arzoo20</id><key>jT9o8XSks4Bf68R2DgKcVEb0gG2ZuxB2dAtSUvDyEiXrFUGZlB/H443Le2GIKliK1+IxT5Jdd6Fn4urlPHf4zxD8QTDQfGjoBj9z7v8mh1yNy3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cCU/hS9xGEC7b/0X1r309f68R2DgKcVAxln+JT2sq20MHk4j4XRiFoKIn0f2tgo+sVQZmUH8fjjct7YYgqWIoUUZ48kBq4e4V1i7vZuywrLDDyeF89tBPwF7gQFWtqcXo6Vl5xDjTboJMfYCoEGU63AlP4UvcRhKqEsvx45gkOZ+Lq5Tx3+M/NfRPEeZ+vSTJ8MsOj03doX+vEdg4CnFThuwJPu5BuYiAqobdQe4cRFsX9UI2964kLsR2pjhA21YV1i7vZuywr3W2lKbmCvwzjPu65QFu4lddTHJZfHE9MInpVWQlrc15n4urlPHf4zwCXVyqmCL3Oyc5Dqj4xCNQRuH89aE+uV+sVQZmUH8fjjct7YYgqWIpcdThEZ41qo8O9cVe5sN0jLySZ32oU3TNn4urlPHf4z2NDQuv6NOBd2zJT2fsu8E6Ny3thiCpYip/OMyAe6P6AujuL6ITNQ9eTcyC2UaC7jv5GQiLOTwSZjct7YYgqWIpjZrpPm50dZsO9cVe5sN0jW+Z6qJFt2tTjPu65QFu4lUQ0KBTmijXcZ+Lq5Tx3+M9LWLpCi2LfC2gmgv1kTiXqsS7VmIqni8k4kywQAk+zK1/rxHYOApxUrWUZMCdI/FKX0clSDP54L4V1i7vZuywrM0CpLGyFtZGsIHOguwMYS4V1i7vZuywrepvjewkAKBwu6QxzJB5R4JxqjbV0Pdej4z7uuUBbuJUUiRbdnppDXdDB5OI+F0YhaCiJ9H9rYKOXuNwGq53u14u2IEZPqlsRjct7YYgqWIoVLJu1YyUkJRj3IUHplYRjPxS/giio89vDvXFXubDdI5Vl3JcLjRh3X+vEdg4CnFTHjOYAlluBWou2IEZPqlsRjct7YYgqWIpXfC4pn5KKsMO9cVe5sN0j/FBgGM7Svpd/dfSuALUKz2seKYY6qtlWPYdjWiFRFpLDvXFXubDdI3WCs5v7MChBX+vEdg4CnFQcBUSXUAncKtDB5OI+F0YhaCiJ9H9rYKMGdVt1F/d6w43Le2GIKliKTEE430rI7O/QweTiPhdGIY8EOPXXJg9GX+vEdg4CnFRG9IBtmbsQdv6XPm9NQecjZ+Lq5Tx3+M+sQn9UgMtr0j7apZTWr4idw71xV7mw3SMrqBBH/RWwDeM+7rlAW7iVn8vLjTxv/W9n4urlPHf4z6xCf1SAy2vSn9IL2tLxTktn4urlPHf4z0HXzlqxlv3h4rYDll/+Pwq3AlP4UvcRhK4wWDnzRGtf0MHk4j4XRiFoKIn0f2tgo161VZVvSXB90MHk4j4XRiEhPwkxP+1/6dDB5OI+F0YhE8ZmQzVYvJYYJKrcHuPYJJUgaT8utUVocKxceCT8ZcM+U+JaaL+4KnCsXHgk/GXD4rPAuuMbP187Se8Ni7NgzGfi6uU8d/jPI1N0yGnPw4tn4urlPHf4zzWANnBS9TmLrBkjRt+2EXIGP3Pu/yaHXGN79eHghyxmpBal2nQlGVq5KmPKJOYJlYCMyqRKZf0wvCdH4oPWId59r9ByVqdVqsUdVs/YZ9T4fa/QclanVaquAY6if9fHxJarQXZsX8bKX+vEdg4CnFSwdDskLGeLf1/rxHYOApxUIHRxBJUsRqAszUbBSPx0CIOP2Hm+YIP0OBqQFB0C1phfPXcYamWomeXw4QykoT1G1chOxdOP8mKWiB4ljlVCkCzNx7W8ezRikH3WkQQIL6Eszce1vHs0Yv3U6neij27Q4YwZArw+YyPQweTiPhdGIebUJ2nE62zI0MHk4j4XRiETxmZDNVi8lpXlMQ6SdIk/LM3Htbx7NGIz69HaxiMED9DB5OI+F0YhE8ZmQzVYvJaFSfPE2vt6fEeCjTlyW+v3NanJYhNiFV4=</key></OriginDestinationOption></PriceRequest>";
        string result = string.Empty;
        DataSet ds = new DataSet();

        StringBuilder stt = new StringBuilder();

        stt.Append("xmlRequest");
        stt.Append("=");
        stt.Append(Server.UrlEncode(XmlPricingRequest));

        byte[] requestData = Encoding.UTF8.GetBytes(stt.ToString());

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Pricing");
        request.Method = "POST";
        request.ContentType = "application/x-www-form-urlencoded";
        request.Accept = "application/json";

        request.ContentLength = requestData.Length;

        using (Stream requestStream = request.GetRequestStream())
        {
            requestStream.Write(requestData, 0, requestData.Length);
        }
        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
        {
            using (Stream stream = response.GetResponseStream())
            {
                using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                    result = reader.ReadToEnd();
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(result);
                XmlNodeReader xmlReader = new XmlNodeReader(doc);

                ds.ReadXml(xmlReader);
            }
        }
    }
    private DataSet GetRoundtripIntBookingRequest()
    {
        DataSet dsResponse = new DataSet();
        dsIntFlights = (DataSet)Session["dsIntFlights"];
        string result = string.Empty;
        try
        {
            #region Variables
            string str = string.Empty;
            string FlightSegmentsID = string.Empty;
            string DepartureAirportCode = string.Empty;
            string ArrivalDateTime = string.Empty;
            string DepartureAirportName = string.Empty;
            string DepartureDateTime = string.Empty;
            string FlightNumber = string.Empty;
            string MarketingAirlineCode = string.Empty;
            string OperatingAirlineCode = string.Empty;
            string OperatingAirlineName = string.Empty;
            string OperatingAirlineFlightNumber = string.Empty;
            string NumStops = string.Empty;
            string LinkSellAgrmnt = string.Empty;
            string Conx = string.Empty;
            string AirpChg = string.Empty;
            string InsideAvailOption = string.Empty;
            string GenTrafRestriction = string.Empty;
            string DaysOperates = string.Empty;
            string JrnyTm = string.Empty;
            string EndDt = string.Empty;
            string StartTerminal = string.Empty;
            string EndTerminal = string.Empty;
            string FltTm = string.Empty;
            string LSAInd = string.Empty;
            string Mile = string.Empty;
            string Availability = string.Empty;
            string BIC = string.Empty;
            string bookingclass = string.Empty;
            string classType = string.Empty;
            string farebasiscode = string.Empty;
            string Rule = string.Empty;
            string PsgrType = string.Empty;
            string BaseFare = string.Empty;
            string Tax = string.Empty;
            string BagInfo = string.Empty;
            string AirEquipType = string.Empty;
            string ArrivalAirportCode = string.Empty;
            string ArrivalAirportName = string.Empty;
            string return1 = string.Empty;
            string id = string.Empty;
            string key = string.Empty;
            string ActualBaseFare = string.Empty;
            string FareTax = string.Empty;
            string STax = string.Empty;
            string TCharge = string.Empty;
            string SCharge = string.Empty;
            string TDiscount = string.Empty;
            string TMarkup = string.Empty;
            string TPartnerCommission = string.Empty;
            string TSdiscount = string.Empty;
            string FarePsgrType = string.Empty;
            string FareBaseFare = string.Empty;
            string FareTax1 = string.Empty;
            string Country = string.Empty;
            string Amt = string.Empty;
            string ocTax = string.Empty;
            string onwardId = string.Empty;
            string OriginDestinationOption_Id = string.Empty;
            string FareDetails_id = string.Empty;
            string FareBreakUp_Id = string.Empty;
            string FareAry_id = string.Empty;
            string FareId = string.Empty;
            string bookingclassFareId = string.Empty;
            string psgrBreakUp_Id = string.Empty;
            string psgrAy_id = string.Empty;
            string country = string.Empty;
            string taxAmt = string.Empty;
            string taxData = string.Empty;
            string taxDataAry_id = string.Empty;
            string returnId = string.Empty;

            string FlightSegmentsIDRet = string.Empty;
            string DepartureAirportCodeRet = string.Empty;
            string ArrivalDateTimeRet = string.Empty;
            string DepartureAirportNameRet = string.Empty;
            string DepartureDateTimeRet = string.Empty;
            string FlightNumberRet = string.Empty;
            string MarketingAirlineCodeRet = string.Empty;
            string OperatingAirlineCodeRet = string.Empty;
            string OperatingAirlineNameRet = string.Empty;
            string OperatingAirlineFlightNumberRet = string.Empty;
            string NumStopsRet = string.Empty;
            string LinkSellAgrmntRet = string.Empty;
            string ConxRet = string.Empty;
            string AirpChgRet = string.Empty;
            string InsideAvailOptionRet = string.Empty;
            string GenTrafRestrictionRet = string.Empty;
            string DaysOperatesRet = string.Empty;
            string JrnyTmRet = string.Empty;
            string EndDtRet = string.Empty;
            string StartTerminalRet = string.Empty;
            string EndTerminalRet = string.Empty;
            string FltTmRet = string.Empty;
            string LSAIndRet = string.Empty;
            string MileRet = string.Empty;
            string AvailabilityRet = string.Empty;
            string BICRet = string.Empty;
            string bookingclassRet = string.Empty;
            string classTypeRet = string.Empty;
            string farebasiscodeRet = string.Empty;
            string RuleRet = string.Empty;
            string PsgrTypeRet = string.Empty;
            string BaseFareRet = string.Empty;
            string TaxRet = string.Empty;
            string BagInfoRet = string.Empty;
            string AirEquipTypeRet = string.Empty;
            string ArrivalAirportCodeRet = string.Empty;
            string ArrivalAirportNameRet = string.Empty;

            string idRet = string.Empty;
            string keyRet = string.Empty;
            string ActualBaseFareRet = string.Empty;
            string FareTaxRet = string.Empty;
            string STaxRet = string.Empty;
            string TChargeRet = string.Empty;
            string SChargeRet = string.Empty;
            string TDiscountRet = string.Empty;
            string TMarkupRet = string.Empty;
            string TPartnerCommissionRet = string.Empty;
            string TSdiscountRet = string.Empty;
            string FarePsgrTypeRet = string.Empty;
            string FareBaseFareRet = string.Empty;
            string FareTax1Ret = string.Empty;
            string CountryRet = string.Empty;
            string AmtRet = string.Empty;
            string ocTaxRet = string.Empty;
            string onwardIdRet = string.Empty;
            string OriginDestinationOption_IdRet = string.Empty;
            string FareDetails_idRet = string.Empty;
            string FareBreakUp_IdRet = string.Empty;
            string FareAry_idRet = string.Empty;
            string FareIdRet = string.Empty;
            string bookingclassFareIdRet = string.Empty;
            string psgrBreakUp_IdRet = string.Empty;
            string psgrAy_idRet = string.Empty;
            string countryRet = string.Empty;
            string taxAmtRet = string.Empty;
            string taxDataRet = string.Empty;
            string taxDataAry_idRet = string.Empty;
            string returnIdRet = string.Empty;

            string taxdatapsgr = string.Empty;
            string taxdatapsgrRet = string.Empty;
            #endregion

            #region Pricing

            DataTable dtPricingreqOriginDestinationOption = dsIntFlights.Tables["OriginDestinationOption"];
            if (dtPricingreqOriginDestinationOption.Rows.Count > 0)
            {
                DataRow[] rowOriginDestinationOption = dtPricingreqOriginDestinationOption.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                id = rowOriginDestinationOption[0]["id"].ToString();
                key = rowOriginDestinationOption[0]["key"].ToString();

            }

            //Get Details From roundtrip response
            DataTable dtPricingreqFareDetails = dsIntFlights.Tables["FareDetails"];
            if (dtPricingreqFareDetails.Rows.Count > 0)
            {
                DataRow[] rowFareDetails = dtPricingreqFareDetails.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                Tax = rowFareDetails[0]["Tax"].ToString();
                STax = rowFareDetails[0]["STax"].ToString();
                TCharge = rowFareDetails[0]["TCharge"].ToString();
                SCharge = rowFareDetails[0]["SCharge"].ToString();
                TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                ocTax = rowFareDetails[0]["ocTax"].ToString();
                FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
            }
            DataTable dtPricingreqFareBreakUp = dsIntFlights.Tables["FareBreakUp"];
            if (dtPricingreqFareBreakUp.Rows.Count > 0)
            {
                DataRow[] rowFareBreakUp = dtPricingreqFareBreakUp.Select("FareDetails_Id=" + FareDetails_id);
                FareBreakUp_Id = rowFareBreakUp[0]["FareBreakUp_Id"].ToString();

            }
            DataTable dtPricingreqFareAry = dsIntFlights.Tables["FareAry"];
            if (dtPricingreqFareAry.Rows.Count > 0)
            {
                DataRow[] rowFareAry = dtPricingreqFareAry.Select("FareBreakUp_Id=" + FareBreakUp_Id);
                FareAry_id = rowFareAry[0]["FareAry_id"].ToString();
            }
            DataTable dtPricingreqFare = dsIntFlights.Tables["Fare"];
            if (dtPricingreqFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtPricingreqFare.Select("FareAry_id=" + FareAry_id);
                PsgrType = rowFare[0]["PsgrType"].ToString();
                BaseFare = rowFare[0]["BaseFare"].ToString();
                FareTax = rowFare[0]["Tax"].ToString();
                FareId = rowFare[0]["Fare_Id"].ToString();
            }

            if (dtPricingreqFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtPricingreqFare.Select("FareAry_id=" + FareAry_id);
                foreach (DataRow row in rowFare)
                {
                    if (row.Table.Rows.Count == 0)
                    {
                        str = "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax></Fare>";
                    }
                    else
                    {
                        str = str + "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax></Fare>";//<TaxDataAry>" + str + "</TaxDataAry>
                    }
                }
            }

            FlightBAL objFlightsBal = new FlightBAL();
            string xmlpricingrequestforInt = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype>";
            xmlpricingrequestforInt = xmlpricingrequestforInt + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>" + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";//<Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax></Fare>
            xmlpricingrequestforInt = xmlpricingrequestforInt + "<onward><FlightSegments>";

            DataTable dtpricingreqOnward = dsIntFlights.Tables["Onward"];
            if (dtpricingreqOnward.Rows.Count > 0)
            {
                DataRow[] rowOnward = dtpricingreqOnward.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                onwardId = rowOnward[0]["onward_id"].ToString();
            }
            DataTable dtpricingreqFlightSegments = dsIntFlights.Tables["FlightSegments"];
            if (dtpricingreqFlightSegments.Rows.Count > 0)
            {
                DataRow[] rowFlightSegments = dtpricingreqFlightSegments.Select("onward_id=" + onwardId);
                FlightSegmentsID = rowFlightSegments[0]["FlightSegments_Id"].ToString();
            }
            DataTable dtpricingreqFlightSegment = dsIntFlights.Tables["FlightSegment"];
            DataTable dtpricingreqBookingClass = dsIntFlights.Tables["BookingClass"];
            DataTable dtpricingreqBookingClassFare = dsIntFlights.Tables["BookingClassFare"];
            DataTable dtpricingreqPsgrBreakUp = dsIntFlights.Tables["PsgrBreakUp"];
            DataTable dtpricingreqPsgrAry = dsIntFlights.Tables["PsgrAry"];
            DataTable dtpricingreqPsgr = dsIntFlights.Tables["Psgr"];
            DataTable dtpricingreqTaxDataAry = dsIntFlights.Tables["TaxDataAry"];
            DataTable dtpricingreqTaxData = dsIntFlights.Tables["TaxData"];

            if (dtpricingreqFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFlightSegment = dtpricingreqFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                for (int i = 0; i < rowFlightSegment.Length; i++)
                {

                    AirEquipType = rowFlightSegment[i]["AirEquipType"].ToString();
                    ArrivalAirportCode = rowFlightSegment[i]["ArrivalAirportCode"].ToString();
                    ArrivalAirportName = rowFlightSegment[i]["ArrivalAirportName"].ToString();
                    ArrivalDateTime = rowFlightSegment[i]["ArrivalDateTime"].ToString();
                    DepartureAirportCode = rowFlightSegment[i]["DepartureAirportCode"].ToString();
                    DepartureAirportName = rowFlightSegment[i]["DepartureAirportName"].ToString();
                    DepartureDateTime = rowFlightSegment[i]["DepartureDateTime"].ToString();
                    FlightNumber = rowFlightSegment[i]["FlightNumber"].ToString();
                    MarketingAirlineCode = rowFlightSegment[i]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCode = rowFlightSegment[i]["OperatingAirlineCode"].ToString();
                    OperatingAirlineName = rowFlightSegment[i]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumber = rowFlightSegment[i]["OperatingAirlineFlightNumber"].ToString();
                    NumStops = rowFlightSegment[i]["NumStops"].ToString();
                    LinkSellAgrmnt = rowFlightSegment[i]["LinkSellAgrmnt"].ToString();
                    Conx = rowFlightSegment[i]["Conx"].ToString();
                    AirpChg = rowFlightSegment[i]["AirpChg"].ToString();
                    InsideAvailOption = rowFlightSegment[i]["InsideAvailOption"].ToString();
                    GenTrafRestriction = rowFlightSegment[i]["GenTrafRestriction"].ToString();
                    DaysOperates = rowFlightSegment[i]["DaysOperates"].ToString();
                    JrnyTm = rowFlightSegment[i]["JrnyTm"].ToString();
                    EndDt = rowFlightSegment[i]["EndDt"].ToString();
                    StartTerminal = rowFlightSegment[i]["StartTerminal"].ToString();
                    EndTerminal = rowFlightSegment[i]["EndTerminal"].ToString();
                    FltTm = rowFlightSegment[i]["FltTm"].ToString();
                    LSAInd = rowFlightSegment[i]["LSAInd"].ToString();
                    Mile = rowFlightSegment[i]["Mile"].ToString();

                    if (dtpricingreqBookingClass.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClass = dtpricingreqBookingClass.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
                        Availability = rowBookingClass[0]["Availability"].ToString();
                        BIC = rowBookingClass[0]["BIC"].ToString();
                    }

                    if (dtpricingreqBookingClassFare.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFare = dtpricingreqBookingClassFare.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
                        bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                        classType = rowBookingClassFare[0]["classType"].ToString();
                        farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                        Rule = rowBookingClassFare[0]["Rule"].ToString();
                        if (dtpricingreqBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                        {
                            bookingclassFareId = rowBookingClassFare[0]["bookingclassFare_Id"].ToString();
                        }

                    }
                    if (dtpricingreqBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {
                        if (dtpricingreqPsgrBreakUp.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrBreakUp = dtpricingreqPsgrBreakUp.Select("bookingclassFare_Id=" + bookingclassFareId);
                            psgrBreakUp_Id = rowPsgrBreakUp[0]["psgrBreakUp_Id"].ToString();

                        }

                        if (dtpricingreqPsgrAry.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrAry = dtpricingreqPsgrAry.Select("psgrBreakUp_Id=" + psgrBreakUp_Id);
                            psgrAy_id = rowPsgrAry[0]["psgrAry_Id"].ToString();

                        }

                        if (dtpricingreqPsgr.Rows.Count > 0)
                        {
                            DataRow[] rowPsgr = dtpricingreqPsgr.Select("psgrAry_Id=" + psgrAy_id);
                            FarePsgrType = rowPsgr[0]["psgrType"].ToString();
                            FareBaseFare = rowPsgr[0]["BaseFare"].ToString();
                            FareTax1 = rowPsgr[0]["Tax"].ToString();
                            BagInfo = rowPsgr[0]["BagInfo"].ToString();

                        }

                        if (dtpricingreqPsgr.Rows.Count > 0)
                        {
                            DataRow[] rowPsgr = dtpricingreqPsgr.Select("psgrAry_Id=" + psgrAy_id);
                            foreach (DataRow rows in rowPsgr)
                            {
                                if (rows.Table.Rows.Count == 0)
                                {
                                    taxdatapsgr = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
                                }
                                else
                                {
                                    taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
                                }
                            }
                        }
                    }

                    if (dtpricingreqTaxDataAry.Rows.Count > 0)
                    {
                        DataRow[] rowTaxDataAry = dtpricingreqTaxDataAry.Select("Fare_id=" + FareId);
                        taxDataAry_id = rowTaxDataAry[0]["TaxdataAry_Id"].ToString();
                    }

                    if (dtpricingreqTaxData.Rows.Count > 0)
                    {
                        DataRow[] rowTaxData = dtpricingreqTaxData.Select("TaxdataAry_Id=" + taxDataAry_id);
                        for (int j = 0; j < rowTaxData.Length; j++)
                        {
                            if (rowTaxData.Length == 0)
                            {
                                taxData = "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                            }
                            else
                            {
                                taxData = taxData + "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                            }
                        }

                    }

                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                    if (dtpricingreqBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {
                        xmlpricingrequestforInt = xmlpricingrequestforInt + "<PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup>";
                    }
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "</BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr>

                }
            }

            xmlpricingrequestforInt = xmlpricingrequestforInt + "</FlightSegments></onward><Return><FlightSegments>";

            DataTable dtpricingreqReturn = dsIntFlights.Tables["Return"];
            if (dtpricingreqReturn.Rows.Count > 0)
            {
                DataRow[] rowReturn = dtpricingreqReturn.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                returnId = rowReturn[0]["return_id"].ToString();
            }
            DataTable dtpricingreqFlightSegmentsRet = dsIntFlights.Tables["FlightSegments"];
            if (dtpricingreqFlightSegmentsRet.Rows.Count > 0)
            {
                DataRow[] rowFlightSegmentsRet = dtpricingreqFlightSegmentsRet.Select("return_id=" + returnId);
                FlightSegmentsIDRet = rowFlightSegmentsRet[0]["FlightSegments_Id"].ToString();
            }
            DataTable dtpricingreqFlightSegmentRet = dsIntFlights.Tables["FlightSegment"];
            DataTable dtpricingreqBookingClassRet = dsIntFlights.Tables["BookingClass"];
            DataTable dtpricingreqBookingClassFareRet = dsIntFlights.Tables["BookingClassFare"];
            DataTable dtpricingreqPsgrBreakUpRet = dsIntFlights.Tables["PsgrBreakUp"];
            DataTable dtpricingreqPsgrAryRet = dsIntFlights.Tables["PsgrAry"];
            DataTable dtpricingreqPsgrRet = dsIntFlights.Tables["Psgr"];
            DataTable dtpricingreqTaxDataAryRet = dsIntFlights.Tables["TaxDataAry"];
            DataTable dtpricingreqTaxDataRet = dsIntFlights.Tables["TaxData"];

            if (dtpricingreqFlightSegmentRet.Rows.Count > 0)
            {
                DataRow[] rowFlightSegmentRet = dtpricingreqFlightSegmentRet.Select("FlightSegments_Id=" + FlightSegmentsIDRet);
                for (int i = 0; i < rowFlightSegmentRet.Length; i++)
                {

                    AirEquipTypeRet = rowFlightSegmentRet[i]["AirEquipType"].ToString();
                    ArrivalAirportCodeRet = rowFlightSegmentRet[i]["ArrivalAirportCode"].ToString();
                    ArrivalAirportNameRet = rowFlightSegmentRet[i]["ArrivalAirportName"].ToString();
                    ArrivalDateTimeRet = rowFlightSegmentRet[i]["ArrivalDateTime"].ToString();
                    DepartureAirportCodeRet = rowFlightSegmentRet[i]["DepartureAirportCode"].ToString();
                    DepartureAirportNameRet = rowFlightSegmentRet[i]["DepartureAirportName"].ToString();
                    DepartureDateTimeRet = rowFlightSegmentRet[i]["DepartureDateTime"].ToString();
                    FlightNumberRet = rowFlightSegmentRet[i]["FlightNumber"].ToString();
                    MarketingAirlineCodeRet = rowFlightSegmentRet[i]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCodeRet = rowFlightSegmentRet[i]["OperatingAirlineCode"].ToString();
                    OperatingAirlineNameRet = rowFlightSegmentRet[i]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumberRet = rowFlightSegmentRet[i]["OperatingAirlineFlightNumber"].ToString();
                    NumStopsRet = rowFlightSegmentRet[i]["NumStops"].ToString();
                    LinkSellAgrmntRet = rowFlightSegmentRet[i]["LinkSellAgrmnt"].ToString();
                    ConxRet = rowFlightSegmentRet[i]["Conx"].ToString();
                    AirpChgRet = rowFlightSegmentRet[i]["AirpChg"].ToString();
                    InsideAvailOptionRet = rowFlightSegmentRet[i]["InsideAvailOption"].ToString();
                    GenTrafRestrictionRet = rowFlightSegmentRet[i]["GenTrafRestriction"].ToString();
                    DaysOperatesRet = rowFlightSegmentRet[i]["DaysOperates"].ToString();
                    JrnyTmRet = rowFlightSegmentRet[i]["JrnyTm"].ToString();
                    EndDtRet = rowFlightSegmentRet[i]["EndDt"].ToString();
                    StartTerminalRet = rowFlightSegmentRet[i]["StartTerminal"].ToString();
                    EndTerminalRet = rowFlightSegmentRet[i]["EndTerminal"].ToString();
                    FltTmRet = rowFlightSegmentRet[i]["FltTm"].ToString();
                    LSAIndRet = rowFlightSegmentRet[i]["LSAInd"].ToString();
                    MileRet = rowFlightSegmentRet[i]["Mile"].ToString();

                    if (dtpricingreqBookingClassRet.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassRet = dtpricingreqBookingClassRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
                        AvailabilityRet = rowBookingClassRet[0]["Availability"].ToString();
                        BICRet = rowBookingClassRet[0]["BIC"].ToString();
                    }

                    if (dtpricingreqBookingClassFareRet.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFareRet = dtpricingreqBookingClassFareRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
                        bookingclassRet = rowBookingClassFareRet[0]["bookingclass"].ToString();
                        classTypeRet = rowBookingClassFareRet[0]["classType"].ToString();
                        farebasiscodeRet = rowBookingClassFareRet[0]["farebasiscode"].ToString();
                        RuleRet = rowBookingClassFareRet[0]["Rule"].ToString();
                        if (dtpricingreqBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                        {
                            bookingclassFareIdRet = rowBookingClassFareRet[0]["bookingclassFare_Id"].ToString();
                        }
                    }
                    if (dtpricingreqBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                    {
                        if (dtpricingreqPsgrBreakUpRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrBreakUpRet = dtpricingreqPsgrBreakUpRet.Select("bookingclassFare_Id=" + bookingclassFareIdRet);
                            psgrBreakUp_IdRet = rowPsgrBreakUpRet[0]["psgrBreakUp_Id"].ToString();

                        }

                        if (dtpricingreqPsgrAryRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrAryRet = dtpricingreqPsgrAryRet.Select("psgrBreakUp_Id=" + psgrBreakUp_IdRet);
                            psgrAy_idRet = rowPsgrAryRet[0]["psgrAry_Id"].ToString();

                        }

                        if (dtpricingreqPsgrRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrRet = dtpricingreqPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
                            FarePsgrTypeRet = rowPsgrRet[0]["psgrType"].ToString();
                            FareBaseFareRet = rowPsgrRet[0]["BaseFare"].ToString();
                            FareTax1Ret = rowPsgrRet[0]["Tax"].ToString();
                            BagInfoRet = rowPsgrRet[0]["BagInfo"].ToString();

                        }

                        if (dtpricingreqPsgrRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgr = dtpricingreqPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
                            foreach (DataRow rows in rowPsgr)
                            {
                                if (rows.Table.Rows.Count == 0)
                                {
                                    taxdatapsgrRet = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
                                }
                                else
                                {
                                    taxdatapsgrRet = taxdatapsgrRet + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo>" + rows["BagInfo"].ToString() + "</BagInfo></Psgr>";
                                }
                            }
                        }
                    }
                    //if (dtTaxDataAryRet.Rows.Count > 0)
                    //{
                    //    DataRow[] rowTaxDataAryRet = dtTaxDataAryRet.Select("Fare_id=" + FareIdRet);
                    //    taxDataAry_id = rowTaxDataAryRet[0]["TaxdataAry_Id"].ToString();
                    //}

                    //if (dtTaxDataRet.Rows.Count > 0)
                    //{
                    //    DataRow[] rowTaxDataRet = dtTaxDataRet.Select("TaxdataAry_Id=" + taxDataAry_idRet);
                    //    for (int j = 0; j < rowTaxDataRet.Length; j++)
                    //    {
                    //        if (rowTaxDataRet.Length == 0)
                    //        {
                    //            taxDataRet = "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
                    //        }
                    //        else
                    //        {
                    //            taxDataRet = taxDataRet + "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
                    //        }
                    //    }

                    //}

                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                    if (dtpricingreqBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                    {
                        xmlpricingrequestforInt = xmlpricingrequestforInt + "<PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup>";

                    }
                    xmlpricingrequestforInt = xmlpricingrequestforInt + "</BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

                }
            }
            xmlpricingrequestforInt = xmlpricingrequestforInt + "</FlightSegments></Return><id>" + id + "</id><key>" + key + "</key>";
            xmlpricingrequestforInt = xmlpricingrequestforInt + "</OriginDestinationOption></PriceRequest>";
            //                              <FlightSegment><AirEquipType>744</AirEquipType><ArrivalAirportCode>LHR</ArrivalAirportCode><ArrivalAirportName>LONDON&lt;BR&gt; (HEATHROW)</ArrivalAirportName><ArrivalDateTime>2010-02-24T06:55:00</ArrivalDateTime><DepartureAirportCode>BOM</DepartureAirportCode><DepartureAirportName>MUMBAI&lt;BR&gt;(CHHATRAPATI SHIVAJI INTERNATIONAL)</DepartureAirportName><DepartureDateTime>2010-02-24T02:45:00</DepartureDateTime><FlightNumber>138</FlightNumber><MarketingAirlineCode>BA</MarketingAirlineCode><OperatingAirlineCode>BA</OperatingAirlineCode><OperatingAirlineName>British Airways </OperatingAirlineName><OperatingAirlineFlightNumber>138</OperatingAirlineFlightNumber><NumStops>0</NumStops>" +
            //       "<LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>N</BIC></BookingClass><BookingClassFare><bookingclass>N</bookingclass><classType>Economy</classType><farebasiscode>NLRCAS|RP|V-BA|BOM-JFK</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>32000</BaseFare><Tax>21675</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment><FlightSegment>" +
            // "<AirEquipType>777</AirEquipType><ArrivalAirportCode>JFK</ArrivalAirportCode><ArrivalAirportName>NEW YORK&lt;BR&gt;(JOHN F KENNEDY INTL)</ArrivalAirportName><ArrivalDateTime>2010-02-24T13:55:00</ArrivalDateTime><DepartureAirportCode>LHR</DepartureAirportCode><DepartureAirportName>LONDON&lt;BR&gt; (HEATHROW)</DepartureAirportName><DepartureDateTime>2010-02-24T11:00:00</DepartureDateTime><FlightNumber>175</FlightNumber><MarketingAirlineCode>BA</MarketingAirlineCode><OperatingAirlineCode>BA</OperatingAirlineCode><OperatingAirlineName>British Airways </OperatingAirlineName><OperatingAirlineFlightNumber>175</OperatingAirlineFlightNumber><NumStops>0</NumStops>" +
            //     "<LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>N</BIC></BookingClass><BookingClassFare><bookingclass>N</bookingclass><classType>Economy</classType><farebasiscode>NLRCAS|RP|V-BA|BOM-JFK</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>32000</BaseFare><Tax>21675</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></onward>" +
            // "<Return><FlightSegments><FlightSegment><AirEquipType>777</AirEquipType><ArrivalAirportCode>LHR</ArrivalAirportCode><ArrivalAirportName>LONDON&lt;BR&gt; (HEATHROW)</ArrivalAirportName><ArrivalDateTime>2010-02-26T07:50:00</ArrivalDateTime><DepartureAirportCode>JFK</DepartureAirportCode><DepartureAirportName>NEW YORK&lt;BR&gt;(JOHN F KENNEDY INTL)</DepartureAirportName><DepartureDateTime>2010-02-25T19:40:00</DepartureDateTime><FlightNumber>176</FlightNumber>
            //<MarketingAirlineCode>BA</MarketingAirlineCode><OperatingAirlineCode>BA</OperatingAirlineCode>" +
            //    " <OperatingAirlineName>British Airways </OperatingAirlineName><OperatingAirlineFlightNumber>176</OperatingAirlineFlightNumber>
            //<NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>N</BIC></BookingClass><BookingClassFare><bookingclass>N</bookingclass><classType>Economy</classType><farebasiscode>NLRCAS|RP|V-BA|JFK-BOM</farebasiscode>" +
            // "<Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>32000</BaseFare><Tax>21675</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment><FlightSegment><AirEquipType>744</AirEquipType><ArrivalAirportCode>BOM</ArrivalAirportCode><ArrivalAirportName>MUMBAI&lt;BR&gt;(CHHATRAPATI SHIVAJI INTERNATIONAL)</ArrivalAirportName><ArrivalDateTime>2010-02-27T00:45:00</ArrivalDateTime><DepartureAirportCode>LHR</DepartureAirportCode><DepartureAirportName>LONDON&lt;BR&gt;(HEATHROW)</DepartureAirportName><DepartureDateTime>2010-02-26T10:30:00</DepartureDateTime><FlightNumber>139</FlightNumber><MarketingAirlineCode>BA</MarketingAirlineCode><OperatingAirlineCode>BA</OperatingAirlineCode>" +
            //    " <OperatingAirlineName>British Airways </OperatingAirlineName><OperatingAirlineFlightNumber>139</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>N</BIC></BookingClass><BookingClassFare><bookingclass>N</bookingclass><classType>Economy</classType><farebasiscode>NLRCAS|RP|V-BA|JFK-BOM</farebasiscode><Rule></Rule>" +
            //" <PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>32000</BaseFare><Tax>21675</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></Return><id>arzoo35</id><key>pG4C0YQykzzTREhDdDdZxah4nJ/Bta4FgUl36m3L9/Vn4uu9m7LCssMPJ4Xz20E7cCU/hS9xGEdUAkpDcwlKw=</key></OriginDestinationOption></PriceRequest>";

            DataSet dsPricingResponse = objFlightsBal.GetDatasetFromAPI(xmlpricingrequestforInt, "http://live.arzoo.com:9302/Pricing");

            if (!dsPricingResponse.Tables[0].Columns.Contains("error"))
            {
                DataTable dtpricingresFareDetails = dsPricingResponse.Tables["FareDetails"];
                if (dtpricingresFareDetails.Rows.Count > 0)
                {
                    DataRow[] rowFareDetails = dtpricingresFareDetails.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                    ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                    Tax = rowFareDetails[0]["Tax"].ToString();
                    STax = rowFareDetails[0]["STax"].ToString();
                    TCharge = rowFareDetails[0]["TCharge"].ToString();
                    SCharge = rowFareDetails[0]["SCharge"].ToString();
                    TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                    TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                    TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                    TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                    ocTax = rowFareDetails[0]["ocTax"].ToString();
                    FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
                }
            }

            #endregion

            string ref1 = Common.GetFlightsReferenceNo("LJIF");
            string xmlRequest = "<Bookingrequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno></creditcardno><PartnerreferenceID>" + ref1 + "</PartnerreferenceID>";
            xmlRequest = xmlRequest + "<personName>";

            // Dynamic generation of names of adults, infants , Child
            Table tbladults = (Table)this.UpdatePanel2.FindControl("tblAdultsInt");
            for (int i = 1; i <= Convert.ToInt32(Session["adultCntInt"]); i++)
            {

                TextBox txtFn = (TextBox)tbladults.FindControl("txtFnInt" + i);
                TextBox txtLn = (TextBox)tbladults.FindControl("txtLnInt" + i);
                DropDownList ddlTitle = (DropDownList)tbladults.FindControl("ddlTitleInt" + i);

                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><psgrtype>adt</psgrtype></CustomerInfo>";
            }

            Table tblChild = (Table)this.UpdatePanel2.FindControl("tblChildInt");
            for (int i = 1; i <= Convert.ToInt32(Session["childCntInt"]); i++)
            {
                TextBox txtFn = (TextBox)tblChild.FindControl("txtCFnInt" + i);

                TextBox txtLn = (TextBox)tblChild.FindControl("txtCLnInt" + i);

                DropDownList ddlTitle = (DropDownList)tblChild.FindControl("ddlCTitleInt" + i);

                TextBox txtBirthDate = (TextBox)tblChild.FindControl("txtCBirthDateInt" + i);

                string age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();

                //if (Convert.ToInt32(age) > 5)
                //{
                //    Literal lit = new Literal();
                //    lit.Text = "age is null";
                //    this.Page.Controls.Add(lit);
                //    break;
                //}

                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>chd</psgrtype></CustomerInfo>";
            }

            Table tblInfants = (Table)this.UpdatePanel2.FindControl("tblInfantsInt");
            for (int i = 1; i <= Convert.ToInt32(Session["infantCntInt"]); i++)
            {
                TextBox txtFn = (TextBox)tblInfants.FindControl("txtIFnInt" + i);

                TextBox txtLn = (TextBox)tblInfants.FindControl("txtILnInt" + i);

                DropDownList ddlTitle = (DropDownList)tblInfants.FindControl("ddlITitleInt" + i);

                TextBox txtBirthDate = (TextBox)tblInfants.FindControl("txtIBirthDateInt" + i);
                string age = string.Empty;
                if (txtBirthDate != null)
                    age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                else
                    age = "0";
                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>inf</psgrtype></CustomerInfo>";
            }

            DataTable dtOriginDestinationOption = dsIntFlights.Tables["OriginDestinationOption"];
            if (dtOriginDestinationOption.Rows.Count > 0)
            {
                DataRow[] rowOriginDestinationOption = dtOriginDestinationOption.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                id = rowOriginDestinationOption[0]["id"].ToString();
                key = rowOriginDestinationOption[0]["key"].ToString();

            }

            //Get Details From roundtrip response
            DataTable dtFareDetails = dsIntFlights.Tables["FareDetails"];
            if (dtFareDetails.Rows.Count > 0)
            {
                DataRow[] rowFareDetails = dtFareDetails.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                Tax = rowFareDetails[0]["Tax"].ToString();
                STax = rowFareDetails[0]["STax"].ToString();
                TCharge = rowFareDetails[0]["TCharge"].ToString();
                SCharge = rowFareDetails[0]["SCharge"].ToString();
                TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                ocTax = rowFareDetails[0]["ocTax"].ToString();
                FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
            }
            DataTable dtFareBreakUp = dsIntFlights.Tables["FareBreakUp"];
            if (dtFareBreakUp.Rows.Count > 0)
            {
                DataRow[] rowFareBreakUp = dtFareBreakUp.Select("FareDetails_Id=" + FareDetails_id);
                FareBreakUp_Id = rowFareBreakUp[0]["FareBreakUp_Id"].ToString();

            }
            DataTable dtFareAry = dsIntFlights.Tables["FareAry"];
            if (dtFareAry.Rows.Count > 0)
            {
                DataRow[] rowFareAry = dtFareAry.Select("FareBreakUp_Id=" + FareBreakUp_Id);
                FareAry_id = rowFareAry[0]["FareAry_id"].ToString();
            }
            DataTable dtFare = dsIntFlights.Tables["Fare"];
            if (dtFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtFare.Select("FareAry_id=" + FareAry_id);
                PsgrType = rowFare[0]["PsgrType"].ToString();
                BaseFare = rowFare[0]["BaseFare"].ToString();
                FareTax = rowFare[0]["Tax"].ToString();
                FareId = rowFare[0]["Fare_Id"].ToString();
            }

            xmlRequest = xmlRequest + "</personName><telePhone><phoneNumber>" + txtMobileNumInt.Text + "</phoneNumber></telePhone><email><emailAddress>" + txtEmailIDInt.Text + "</emailAddress></email>";
            xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>";//<Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax>
            xmlRequest = xmlRequest + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";

            DataTable dtOnward = dsIntFlights.Tables["Onward"];
            if (dtOnward.Rows.Count > 0)
            {
                DataRow[] rowOnward = dtOnward.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                onwardId = rowOnward[0]["onward_id"].ToString();
            }
            DataTable dtFlightSegments = dsIntFlights.Tables["FlightSegments"];
            if (dtFlightSegments.Rows.Count > 0)
            {
                DataRow[] rowFlightSegments = dtFlightSegments.Select("onward_id=" + onwardId);
                FlightSegmentsID = rowFlightSegments[0]["FlightSegments_Id"].ToString();
            }
            DataTable dtFlightSegment = dsIntFlights.Tables["FlightSegment"];
            DataTable dtBookingClass = dsIntFlights.Tables["BookingClass"];
            DataTable dtBookingClassFare = dsIntFlights.Tables["BookingClassFare"];
            DataTable dtPsgrBreakUp = dsIntFlights.Tables["PsgrBreakUp"];
            DataTable dtPsgrAry = dsIntFlights.Tables["PsgrAry"];
            DataTable dtPsgr = dsIntFlights.Tables["Psgr"];
            DataTable dtTaxDataAry = dsIntFlights.Tables["TaxDataAry"];
            DataTable dtTaxData = dsIntFlights.Tables["TaxData"];

            if (dtFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFlightSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                for (int i = 0; i < rowFlightSegment.Length; i++)
                {

                    AirEquipType = rowFlightSegment[i]["AirEquipType"].ToString();
                    ArrivalAirportCode = rowFlightSegment[i]["ArrivalAirportCode"].ToString();
                    ArrivalAirportName = rowFlightSegment[i]["ArrivalAirportName"].ToString();
                    ArrivalDateTime = rowFlightSegment[i]["ArrivalDateTime"].ToString();
                    DepartureAirportCode = rowFlightSegment[i]["DepartureAirportCode"].ToString();
                    DepartureAirportName = rowFlightSegment[i]["DepartureAirportName"].ToString();
                    DepartureDateTime = rowFlightSegment[i]["DepartureDateTime"].ToString();
                    FlightNumber = rowFlightSegment[i]["FlightNumber"].ToString();
                    MarketingAirlineCode = rowFlightSegment[i]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCode = rowFlightSegment[i]["OperatingAirlineCode"].ToString();
                    OperatingAirlineName = rowFlightSegment[i]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumber = rowFlightSegment[i]["OperatingAirlineFlightNumber"].ToString();
                    NumStops = rowFlightSegment[i]["NumStops"].ToString();
                    LinkSellAgrmnt = rowFlightSegment[i]["LinkSellAgrmnt"].ToString();
                    Conx = rowFlightSegment[i]["Conx"].ToString();
                    AirpChg = rowFlightSegment[i]["AirpChg"].ToString();
                    InsideAvailOption = rowFlightSegment[i]["InsideAvailOption"].ToString();
                    GenTrafRestriction = rowFlightSegment[i]["GenTrafRestriction"].ToString();
                    DaysOperates = rowFlightSegment[i]["DaysOperates"].ToString();
                    JrnyTm = rowFlightSegment[i]["JrnyTm"].ToString();
                    EndDt = rowFlightSegment[i]["EndDt"].ToString();
                    StartTerminal = rowFlightSegment[i]["StartTerminal"].ToString();
                    EndTerminal = rowFlightSegment[i]["EndTerminal"].ToString();
                    FltTm = rowFlightSegment[i]["FltTm"].ToString();
                    LSAInd = rowFlightSegment[i]["LSAInd"].ToString();
                    Mile = rowFlightSegment[i]["Mile"].ToString();

                    if (dtBookingClass.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClass = dtBookingClass.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
                        Availability = rowBookingClass[0]["Availability"].ToString();
                        BIC = rowBookingClass[0]["BIC"].ToString();
                    }

                    if (dtBookingClassFare.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFare = dtBookingClassFare.Select("FlightSegment_Id=" + rowFlightSegment[i]["FlightSegment_Id"].ToString());
                        bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                        classType = rowBookingClassFare[0]["classType"].ToString();
                        farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                        Rule = rowBookingClassFare[0]["Rule"].ToString();
                        if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                        {
                            bookingclassFareId = rowBookingClassFare[0]["bookingclassFare_Id"].ToString();
                        }

                    }
                    if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {
                        if (dtPsgrBreakUp.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrBreakUp = dtPsgrBreakUp.Select("bookingclassFare_Id=" + bookingclassFareId);
                            psgrBreakUp_Id = rowPsgrBreakUp[0]["psgrBreakUp_Id"].ToString();

                        }

                        if (dtPsgrAry.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrAry = dtPsgrAry.Select("psgrBreakUp_Id=" + psgrBreakUp_Id);
                            psgrAy_id = rowPsgrAry[0]["psgrAry_Id"].ToString();

                        }

                        if (dtPsgr.Rows.Count > 0)
                        {
                            DataRow[] rowPsgr = dtPsgr.Select("psgrAry_Id=" + psgrAy_id);
                            FarePsgrType = rowPsgr[0]["psgrType"].ToString();
                            FareBaseFare = rowPsgr[0]["BaseFare"].ToString();
                            FareTax1 = rowPsgr[0]["Tax"].ToString();
                            BagInfo = rowPsgr[0]["BagInfo"].ToString();

                        }
                    }
                    if (dtTaxDataAry.Rows.Count > 0)
                    {
                        DataRow[] rowTaxDataAry = dtTaxDataAry.Select("Fare_id=" + FareId);
                        taxDataAry_id = rowTaxDataAry[0]["TaxdataAry_Id"].ToString();
                    }

                    if (dtTaxData.Rows.Count > 0)
                    {
                        DataRow[] rowTaxData = dtTaxData.Select("TaxdataAry_Id=" + taxDataAry_id);
                        for (int j = 0; j < rowTaxData.Length; j++)
                        {
                            if (rowTaxData.Length == 0)
                            {
                                taxData = "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                            }
                            else
                            {
                                taxData = taxData + "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                            }
                        }

                    }

                    xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                    xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                    xmlRequest = xmlRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                    if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {

                        xmlRequest = xmlRequest + "<PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup>";
                    }
                    xmlRequest = xmlRequest + "</BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr>

                }
            }

            xmlRequest = xmlRequest + "</FlightSegments></onward><Return><FlightSegments>";

            DataTable dtReturn = dsIntFlights.Tables["Return"];
            if (dtReturn.Rows.Count > 0)
            {
                DataRow[] rowReturn = dtReturn.Select("OriginDestinationOption_Id=" + lblOriginDestinationRoundTrip.Text);
                returnId = rowReturn[0]["return_id"].ToString();
            }
            DataTable dtFlightSegmentsRet = dsIntFlights.Tables["FlightSegments"];
            if (dtFlightSegmentsRet.Rows.Count > 0)
            {
                DataRow[] rowFlightSegmentsRet = dtFlightSegmentsRet.Select("return_id=" + returnId);
                FlightSegmentsIDRet = rowFlightSegmentsRet[0]["FlightSegments_Id"].ToString();
            }
            DataTable dtFlightSegmentRet = dsIntFlights.Tables["FlightSegment"];
            DataTable dtBookingClassRet = dsIntFlights.Tables["BookingClass"];
            DataTable dtBookingClassFareRet = dsIntFlights.Tables["BookingClassFare"];
            DataTable dtPsgrBreakUpRet = dsIntFlights.Tables["PsgrBreakUp"];
            DataTable dtPsgrAryRet = dsIntFlights.Tables["PsgrAry"];
            DataTable dtPsgrRet = dsIntFlights.Tables["Psgr"];
            DataTable dtTaxDataAryRet = dsIntFlights.Tables["TaxDataAry"];
            DataTable dtTaxDataRet = dsIntFlights.Tables["TaxData"];

            if (dtFlightSegmentRet.Rows.Count > 0)
            {
                DataRow[] rowFlightSegmentRet = dtFlightSegmentRet.Select("FlightSegments_Id=" + FlightSegmentsIDRet);
                for (int i = 0; i < rowFlightSegmentRet.Length; i++)
                {

                    AirEquipTypeRet = rowFlightSegmentRet[i]["AirEquipType"].ToString();
                    ArrivalAirportCodeRet = rowFlightSegmentRet[i]["ArrivalAirportCode"].ToString();
                    ArrivalAirportNameRet = rowFlightSegmentRet[i]["ArrivalAirportName"].ToString();
                    ArrivalDateTimeRet = rowFlightSegmentRet[i]["ArrivalDateTime"].ToString();
                    DepartureAirportCodeRet = rowFlightSegmentRet[i]["DepartureAirportCode"].ToString();
                    DepartureAirportNameRet = rowFlightSegmentRet[i]["DepartureAirportName"].ToString();
                    DepartureDateTimeRet = rowFlightSegmentRet[i]["DepartureDateTime"].ToString();
                    FlightNumberRet = rowFlightSegmentRet[i]["FlightNumber"].ToString();
                    MarketingAirlineCodeRet = rowFlightSegmentRet[i]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCodeRet = rowFlightSegmentRet[i]["OperatingAirlineCode"].ToString();
                    OperatingAirlineNameRet = rowFlightSegmentRet[i]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumberRet = rowFlightSegmentRet[i]["OperatingAirlineFlightNumber"].ToString();
                    NumStopsRet = rowFlightSegmentRet[i]["NumStops"].ToString();
                    LinkSellAgrmntRet = rowFlightSegmentRet[i]["LinkSellAgrmnt"].ToString();
                    ConxRet = rowFlightSegmentRet[i]["Conx"].ToString();
                    AirpChgRet = rowFlightSegmentRet[i]["AirpChg"].ToString();
                    InsideAvailOptionRet = rowFlightSegmentRet[i]["InsideAvailOption"].ToString();
                    GenTrafRestrictionRet = rowFlightSegmentRet[i]["GenTrafRestriction"].ToString();
                    DaysOperatesRet = rowFlightSegmentRet[i]["DaysOperates"].ToString();
                    JrnyTmRet = rowFlightSegmentRet[i]["JrnyTm"].ToString();
                    EndDtRet = rowFlightSegmentRet[i]["EndDt"].ToString();
                    StartTerminalRet = rowFlightSegmentRet[i]["StartTerminal"].ToString();
                    EndTerminalRet = rowFlightSegmentRet[i]["EndTerminal"].ToString();
                    FltTmRet = rowFlightSegmentRet[i]["FltTm"].ToString();
                    LSAIndRet = rowFlightSegmentRet[i]["LSAInd"].ToString();
                    MileRet = rowFlightSegmentRet[i]["Mile"].ToString();

                    if (dtBookingClassRet.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassRet = dtBookingClassRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
                        AvailabilityRet = rowBookingClassRet[0]["Availability"].ToString();
                        BICRet = rowBookingClassRet[0]["BIC"].ToString();
                    }

                    if (dtBookingClassFareRet.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFareRet = dtBookingClassFareRet.Select("FlightSegment_Id=" + rowFlightSegmentRet[i]["FlightSegment_Id"].ToString());
                        bookingclassRet = rowBookingClassFareRet[0]["bookingclass"].ToString();
                        classTypeRet = rowBookingClassFareRet[0]["classType"].ToString();
                        farebasiscodeRet = rowBookingClassFareRet[0]["farebasiscode"].ToString();
                        RuleRet = rowBookingClassFareRet[0]["Rule"].ToString();
                        if (dtBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                        {
                            bookingclassFareIdRet = rowBookingClassFareRet[0]["bookingclassFare_Id"].ToString();
                        }

                    }
                    if (dtBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                    {
                        if (dtPsgrBreakUpRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrBreakUpRet = dtPsgrBreakUpRet.Select("bookingclassFare_Id=" + bookingclassFareIdRet);
                            psgrBreakUp_IdRet = rowPsgrBreakUpRet[0]["psgrBreakUp_Id"].ToString();

                        }

                        if (dtPsgrAryRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrAryRet = dtPsgrAryRet.Select("psgrBreakUp_Id=" + psgrBreakUp_IdRet);
                            psgrAy_idRet = rowPsgrAryRet[0]["psgrAry_Id"].ToString();

                        }

                        if (dtPsgrRet.Rows.Count > 0)
                        {
                            DataRow[] rowPsgrRet = dtPsgrRet.Select("psgrAry_Id=" + psgrAy_idRet);
                            FarePsgrTypeRet = rowPsgrRet[0]["psgrType"].ToString();
                            FareBaseFareRet = rowPsgrRet[0]["BaseFare"].ToString();
                            FareTax1Ret = rowPsgrRet[0]["Tax"].ToString();
                            BagInfoRet = rowPsgrRet[0]["BagInfo"].ToString();

                        }
                    }
                    //if (dtTaxDataAryRet.Rows.Count > 0)
                    //{
                    //    DataRow[] rowTaxDataAryRet = dtTaxDataAryRet.Select("Fare_id=" + FareIdRet);
                    //    taxDataAry_id = rowTaxDataAryRet[0]["TaxdataAry_Id"].ToString();
                    //}

                    //if (dtTaxDataRet.Rows.Count > 0)
                    //{
                    //    DataRow[] rowTaxDataRet = dtTaxDataRet.Select("TaxdataAry_Id=" + taxDataAry_idRet);
                    //    for (int j = 0; j < rowTaxDataRet.Length; j++)
                    //    {
                    //        if (rowTaxDataRet.Length == 0)
                    //        {
                    //            taxDataRet = "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
                    //        }
                    //        else
                    //        {
                    //            taxDataRet = taxDataRet + "<TaxData><Country>" + rowTaxDataRet[j]["Country"].ToString() + "</Country><Amt>" + rowTaxDataRet[j]["Amt"].ToString() + "</Amt></TaxData>";
                    //        }
                    //    }

                    //}

                    xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipTypeRet + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCodeRet + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportNameRet + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTimeRet + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCodeRet + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportNameRet + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTimeRet + "</DepartureDateTime><FlightNumber>" + FlightNumberRet + "</FlightNumber>";
                    xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCodeRet + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCodeRet + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineNameRet + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumberRet + "</OperatingAirlineFlightNumber><NumStops>" + NumStopsRet + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmntRet + "</LinkSellAgrmnt><Conx>" + ConxRet + "</Conx><AirpChg>" + AirpChgRet + "</AirpChg><InsideAvailOption>" + InsideAvailOptionRet + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestrictionRet + "</GenTrafRestriction><DaysOperates>" + DaysOperatesRet + "</DaysOperates><JrnyTm>" + JrnyTmRet + "</JrnyTm><EndDt>" + EndDtRet + "</EndDt><StartTerminal>" + StartTerminalRet + "</StartTerminal><EndTerminal>" + EndTerminalRet + "</EndTerminal>";
                    xmlRequest = xmlRequest + "<FltTm>" + FltTmRet + "</FltTm><LSAInd>" + LSAIndRet + "</LSAInd><Mile>" + MileRet + "</Mile><BookingClass><Availability>" + AvailabilityRet + "</Availability><BIC>" + BICRet + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclassRet + "</bookingclass><classType>" + classTypeRet + "</classType><farebasiscode>" + farebasiscodeRet + "</farebasiscode><Rule>" + RuleRet.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                           if (dtBookingClassFareRet.Columns.Contains("bookingclassFare_Id"))
                           {
                               xmlRequest = xmlRequest + "<PsgrBreakup><PsgrAry>" + taxdatapsgrRet + "</PsgrAry></PsgrBreakup>";
                           }
                               xmlRequest = xmlRequest + "</BookingClassFare></FlightSegment>";//<Psgr><PsgrType>" + FarePsgrTypeRet + "</PsgrType><BaseFare>" + FareBaseFareRet + "</BaseFare><Tax>" + FareTax1Ret + "</Tax><BagInfo></BagInfo></Psgr>

                }
            }
            xmlRequest = xmlRequest + "</FlightSegments></Return><id>" + id + "</id><key>" + key + "</key>";
            xmlRequest = xmlRequest + "</OriginDestinationOption></Bookingrequest>";

            StringBuilder stt = new StringBuilder();

            stt.Append("xmlRequest");
            stt.Append("=");
            stt.Append(Server.UrlEncode(xmlRequest));

            byte[] requestData = Encoding.UTF8.GetBytes(stt.ToString());

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Booking");
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.Accept = "application/json";

            request.ContentLength = requestData.Length;

            using (Stream requestStream = request.GetRequestStream())
            {
                requestStream.Write(requestData, 0, requestData.Length);
            }
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                        result = reader.ReadToEnd();
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(result);
                    XmlNodeReader xmlReader = new XmlNodeReader(doc);

                    dsResponse.ReadXml(xmlReader);
                }
            }

        }
        catch (Exception ex)
        {

            // throw;
        }
        return dsResponse;
    }
    private DataSet GetIntFlightsAvailabilitySearch()
    {
        DataSet ds = new DataSet();
        try
        {
            Session["From"] = txtfromsearch.Text;
            Session["TO"] = txtleavingtosearch.Text;
            Session["datefrom"] = txtdatesearch.Text;
            Session["dateto"] = txtretundatesearch.Text;
            infantCntInt = Convert.ToInt32(ddlinfantsintsearch.SelectedValue);
            childCntInt = Convert.ToInt32(ddlchildintsearch.SelectedValue);
            adultCntInt = Convert.ToInt32(ddladultsintsearch.SelectedValue);

            Session["adultCntInt"] = adultCntInt.ToString();
            Session["infantCntInt"] = infantCntInt.ToString();
            Session["childCntInt"] = childCntInt.ToString();

            string result = null;
            string mode = (rradiooneway.Checked) ? "ONE" : "ROUND";
            string returnDate = (rradiooneway.Checked) ? txtdatesearch.Text : txtretundatesearch.Text;
            string from = txtfromsearch.Text.Substring(txtfromsearch.Text.IndexOf("(") + 1, 3);
            string to = txtleavingtosearch.Text.Substring(txtleavingtosearch.Text.IndexOf("(") + 1, 3);

            // string xmlRequest = "xmlRequest=<AvailRequest><Trip>ONE</Trip><Origin>BLR</Origin><Destination>JFK</Destination><DepartDate>2012-10-19</DepartDate><ReturnDate>2012-10-25</ReturnDate><AdultPax>1</AdultPax><ChildPax>0</ChildPax><InfantPax>0</InfantPax><Currency>INR</Currency><PreferredClass>E</PreferredClass><Eticket>true</Eticket><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><PreferredAirline></PreferredAirline></AvailRequest>";
            string xmlRequest = "xmlRequest=<AvailRequest><Trip>" + mode + "</Trip><Origin>" + from + "</Origin>";
            xmlRequest = xmlRequest + "<Destination>" + to + "</Destination><DepartDate>" + txtdatesearch.Text + "</DepartDate><ReturnDate>" + returnDate + "</ReturnDate>";
            xmlRequest = xmlRequest + "<AdultPax>" + ddladultsintsearch.SelectedValue + "</AdultPax><ChildPax>" + ddlchildintsearch.SelectedValue + "</ChildPax><InfantPax>" + ddlinfantsintsearch.SelectedValue + "</InfantPax><Currency>INR</Currency><PreferredClass>" + ddlIntCabinTypesearch.SelectedValue + "</PreferredClass>";
            xmlRequest = xmlRequest + "<Eticket>true</Eticket><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><PreferredAirline></PreferredAirline></AvailRequest>";

            byte[] requestData = Encoding.ASCII.GetBytes(xmlRequest);

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Avalability");

            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = requestData.Length;

            using (Stream requestStream = request.GetRequestStream())
            {
                requestStream.Write(requestData, 0, requestData.Length);
            }

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                        result = reader.ReadToEnd();
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(result);
                    XmlNodeReader xmlReader = new XmlNodeReader(doc);

                    ds.ReadXml(xmlReader);
                }
            }

        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message.ToString());
        }

        return ds;
    }
    private DataSet GetIntBookingRequest()
    {
        DataSet ds = new DataSet();
        dsIntFlights = (DataSet)Session["dsIntFlights"];
        #region Variables

        string str = string.Empty;
        string FlightSegmentsID = string.Empty;
        string DepartureAirportCode = string.Empty;
        string ArrivalDateTime = string.Empty;
        string DepartureAirportName = string.Empty;
        string DepartureDateTime = string.Empty;
        string FlightNumber = string.Empty;
        string MarketingAirlineCode = string.Empty;
        string OperatingAirlineCode = string.Empty;
        string OperatingAirlineName = string.Empty;
        string OperatingAirlineFlightNumber = string.Empty;
        string NumStops = string.Empty;
        string LinkSellAgrmnt = string.Empty;
        string Conx = string.Empty;
        string AirpChg = string.Empty;
        string InsideAvailOption = string.Empty;
        string GenTrafRestriction = string.Empty;
        string DaysOperates = string.Empty;
        string JrnyTm = string.Empty;
        string EndDt = string.Empty;
        string StartTerminal = string.Empty;
        string EndTerminal = string.Empty;
        string FltTm = string.Empty;
        string LSAInd = string.Empty;
        string Mile = string.Empty;
        string Availability = string.Empty;
        string BIC = string.Empty;
        string bookingclass = string.Empty;
        string classType = string.Empty;
        string farebasiscode = string.Empty;
        string Rule = string.Empty;
        string PsgrType = string.Empty;
        string BaseFare = string.Empty;
        string Tax = string.Empty;
        string BagInfo = string.Empty;
        string AirEquipType = string.Empty;
        string ArrivalAirportCode = string.Empty;
        string ArrivalAirportName = string.Empty;
        string return1 = string.Empty;
        string id = string.Empty;
        string key = string.Empty;
        string ActualBaseFare = string.Empty;
        string FareTax = string.Empty;
        string STax = string.Empty;
        string TCharge = string.Empty;
        string SCharge = string.Empty;
        string TDiscount = string.Empty;
        string TMarkup = string.Empty;
        string TPartnerCommission = string.Empty;
        string TSdiscount = string.Empty;
        string FarePsgrType = string.Empty;
        string FareBaseFare = string.Empty;
        string FareTax1 = string.Empty;
        string Country = string.Empty;
        string Amt = string.Empty;
        string ocTax = string.Empty;
        string onwardId = string.Empty;
        string OriginDestinationOption_Id = string.Empty;
        string FareDetails_id = string.Empty;
        string FareBreakUp_Id = string.Empty;
        string FareAry_id = string.Empty;
        string FareId = string.Empty;
        string bookingclassFareId = string.Empty;
        string psgrBreakUp_Id = string.Empty;
        string psgrAy_id = string.Empty;
        string country = string.Empty;
        string taxAmt = string.Empty;
        string taxData = string.Empty;
        string taxDataAry_id = string.Empty;

        string CFareId = string.Empty;
        string CPsgrType = string.Empty;
        string CBaseFare = string.Empty;
        string CFareTax = string.Empty;
        string IFareId = string.Empty;
        string IPsgrType = string.Empty;
        string IBaseFare = string.Empty;
        string IFareTax = string.Empty;

        string CFarePsgrType = string.Empty;
        string CFareBaseFare = string.Empty;
        string CFareTax1 = string.Empty;
        string CBagInfo = string.Empty;
        string IFarePsgrType = string.Empty;
        string IFareBaseFare = string.Empty;
        string IFareTax1 = string.Empty;
        string IBagInfo = string.Empty;
        string taxdatapsgr = string.Empty;

        #endregion
        try
        {
            string result = null;
            DataTable dtFlightSegment = dsIntFlights.Tables[12];
            if (dtFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegment_ID=" + Convert.ToInt32(lblIntFlightSegmentId.Text));
                FlightSegmentsID = rowFilghtSegment[0]["FlightSegments_Id"].ToString();

            }
            DataTable dtFlightSegments = dsIntFlights.Tables[11];
            if (dtFlightSegments.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegments = dtFlightSegments.Select("FlightSegments_ID=" + FlightSegmentsID);
                onwardId = rowFilghtSegments[0]["Onward_Id"].ToString();
            }
            DataTable dtOnward = dsIntFlights.Tables[10];
            if (dtOnward.Rows.Count > 0)
            {
                DataRow[] rowOnward = dtOnward.Select("Onward_Id=" + onwardId);
                OriginDestinationOption_Id = rowOnward[0]["OriginDestinationOption_Id"].ToString();
            }
            DataTable dtOriginDestinationOption = dsIntFlights.Tables[3];
            if (dtOriginDestinationOption.Rows.Count > 0)
            {
                DataRow[] rowOriginDestinationOption = dtOriginDestinationOption.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                return1 = rowOriginDestinationOption[0]["Return"].ToString();
                id = rowOriginDestinationOption[0]["id"].ToString();
                key = rowOriginDestinationOption[0]["key"].ToString();
            }
            DataTable dtFareDetails = dsIntFlights.Tables[4];
            if (dtFareDetails.Rows.Count > 0)
            {
                DataRow[] rowFareDetails = dtFareDetails.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                Tax = rowFareDetails[0]["Tax"].ToString();
                STax = rowFareDetails[0]["STax"].ToString();
                TCharge = rowFareDetails[0]["TCharge"].ToString();
                SCharge = rowFareDetails[0]["SCharge"].ToString();
                TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                ocTax = rowFareDetails[0]["ocTax"].ToString();
                FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
            }
            DataTable dtFareBreakUp = dsIntFlights.Tables[5];
            if (dtFareBreakUp.Rows.Count > 0)
            {
                DataRow[] rowFareBreakUp = dtFareBreakUp.Select("FareDetails_Id=" + FareDetails_id);
                FareBreakUp_Id = rowFareBreakUp[0]["FareBreakUp_Id"].ToString();

            }
            DataTable dtFareAry = dsIntFlights.Tables[6];
            if (dtFareAry.Rows.Count > 0)
            {
                DataRow[] rowFareAry = dtFareAry.Select("FareBreakUp_Id=" + FareBreakUp_Id);
                FareAry_id = rowFareAry[0]["FareAry_id"].ToString();
            }
            DataTable dtFare = dsIntFlights.Tables[7];
            if (dtFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtFare.Select("FareAry_id=" + FareAry_id);
                PsgrType = rowFare[0]["PsgrType"].ToString();
                BaseFare = rowFare[0]["BaseFare"].ToString();
                FareTax = rowFare[0]["Tax"].ToString();
                FareId = rowFare[0]["Fare_Id"].ToString();
                //child
                //CPsgrType = rowFare[1]["PsgrType"].ToString();
                //CBaseFare = rowFare[1]["BaseFare"].ToString();
                //CFareTax = rowFare[1]["Tax"].ToString();
                //CFareId = rowFare[1]["Fare_Id"].ToString();
                ////infant
                //IPsgrType = rowFare[2]["PsgrType"].ToString();
                //IBaseFare = rowFare[2]["BaseFare"].ToString();
                //IFareTax = rowFare[2]["Tax"].ToString();
                //IFareId = rowFare[2]["Fare_Id"].ToString();

            }

            DataTable dtBookingClass = dsIntFlights.Tables[13];
            if (dtBookingClass.Rows.Count > 0)
            {
                DataRow[] rowBookingClass = dtBookingClass.Select("FlightSegment_Id=" + lblIntFlightSegmentId.Text);
                Availability = rowBookingClass[0]["Availability"].ToString();
                BIC = rowBookingClass[0]["BIC"].ToString();
            }
            DataTable dtBookingClassFare = dsIntFlights.Tables[14];
            if (dtBookingClassFare.Rows.Count > 0)
            {
                DataRow[] rowBookingClassFare = dtBookingClassFare.Select("FlightSegment_Id=" + lblIntFlightSegmentId.Text);
                bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                classType = rowBookingClassFare[0]["classType"].ToString();
                farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                Rule = rowBookingClassFare[0]["Rule"].ToString();
                if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                {
                    bookingclassFareId = rowBookingClassFare[0]["bookingclassFare_Id"].ToString();
                }

            }
            if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
            {
                DataTable dtPsgrBreakUp = dsIntFlights.Tables[15];
                if (dtPsgrBreakUp.Rows.Count > 0)
                {
                    DataRow[] rowPsgrBreakUp = dtPsgrBreakUp.Select("bookingclassFare_Id=" + bookingclassFareId);
                    psgrBreakUp_Id = rowPsgrBreakUp[0]["psgrBreakUp_Id"].ToString();

                }
                DataTable dtPsgrAry = dsIntFlights.Tables[16];
                if (dtPsgrAry.Rows.Count > 0)
                {
                    DataRow[] rowPsgrAry = dtPsgrAry.Select("psgrBreakUp_Id=" + psgrBreakUp_Id);
                    psgrAy_id = rowPsgrAry[0]["psgrAry_Id"].ToString();

                }
                DataTable dtPsgr = dsIntFlights.Tables[17];
                if (dtPsgr.Rows.Count > 0)
                {
                    DataRow[] rowPsgr = dtPsgr.Select("psgrAry_Id=" + psgrAy_id);
                    FarePsgrType = rowPsgr[0]["psgrType"].ToString();
                    FareBaseFare = rowPsgr[0]["BaseFare"].ToString();
                    FareTax1 = rowPsgr[0]["Tax"].ToString();
                    BagInfo = rowPsgr[0]["BagInfo"].ToString();
                    //child
                    //CFarePsgrType = rowPsgr[1]["psgrType"].ToString();
                    //CFareBaseFare = rowPsgr[1]["BaseFare"].ToString();
                    //CFareTax1 = rowPsgr[1]["Tax"].ToString();
                    //CBagInfo = rowPsgr[1]["BagInfo"].ToString();
                    ////infant
                    //IFarePsgrType = rowPsgr[2]["psgrType"].ToString();
                    //IFareBaseFare = rowPsgr[2]["BaseFare"].ToString();
                    //IFareTax1 = rowPsgr[2]["Tax"].ToString();
                    //IBagInfo = rowPsgr[2]["BagInfo"].ToString();

                }

                if (dtPsgr.Rows.Count > 0)
                {
                    DataRow[] rowPsgr = dtPsgr.Select("psgrAry_Id=" + psgrAy_id);
                    foreach (DataRow rows in rowPsgr)
                    {
                        if (rows.Table.Rows.Count == 0)
                        {
                            taxdatapsgr = "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                        else
                        {
                            taxdatapsgr = taxdatapsgr + "<Psgr><PsgrType>" + rows["psgrType"].ToString() + "</PsgrType><BaseFare>" + rows["BaseFare"].ToString() + "</BaseFare><Tax>" + rows["Tax"].ToString() + "</Tax><BagInfo></BagInfo></Psgr>";
                        }
                    }
                }
            }
            //  <Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr>
            DataTable dtTaxDataAry = dsIntFlights.Tables[8];
            if (dtTaxDataAry.Rows.Count > 0)
            {
                DataRow[] rowTaxDataAry = dtTaxDataAry.Select("Fare_id=" + FareId);
                taxDataAry_id = rowTaxDataAry[0]["TaxdataAry_Id"].ToString();
            }
            DataTable dtTaxData = dsIntFlights.Tables[9];
            if (dtTaxData.Rows.Count > 0)
            {
                DataRow[] rowTaxData = dtTaxData.Select("TaxdataAry_Id=" + taxDataAry_id);
                for (int j = 0; j < rowTaxData.Length; j++)
                {
                    if (rowTaxData.Length == 0)
                    {
                        taxData = "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";

                    }
                    else
                    {
                        taxData = taxData + "<TaxData><Country>" + rowTaxData[j]["Country"].ToString() + "</Country><Amt>" + rowTaxData[j]["Amt"].ToString() + "</Amt></TaxData>";
                        //ravi
                        //  taxData = taxData + "<Fare><PsgrType>" + dtFare.Rows[j]["PsgrType"].ToString() + "</PsgrType><BaseFare>" + dtFare.Rows[j]["BaseFare"].ToString() + "</BaseFare><Tax>" + dtFare.Rows[j]["Tax"].ToString() + "</Tax><TaxDataAry><TaxData><Country>" + rowTaxData[0]["Country"].ToString() + "</Country><Amt>" + rowTaxData[0]["Amt"].ToString() + "</Amt></TaxData><TaxData><Country>" + rowTaxData[1]["Country"].ToString() + "</Country><Amt>" + rowTaxData[1]["Amt"].ToString() + "</Amt></TaxData><TaxData><Country>" + rowTaxData[2]["Country"].ToString() + "</Country><Amt>" + rowTaxData[2]["Amt"].ToString() + "</Amt></TaxData></TaxDataAry></Fare>";

                    }
                }

            }
            if (dtFare.Rows.Count > 0)
            {
                DataRow[] rowFare = dtFare.Select("FareAry_id=" + FareAry_id);
                foreach (DataRow row in rowFare)
                {
                    if (row.Table.Rows.Count == 0)
                    {
                        str = "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax><TaxDataAry>" + taxData + "</TaxDataAry></Fare>";
                    }
                    else
                    {
                        str = str + "<Fare><PsgrType>" + row["PsgrType"].ToString() + "</PsgrType><BaseFare>" + row["BaseFare"].ToString() + "</BaseFare><Tax>" + row["Tax"].ToString() + "</Tax><TaxDataAry>" + taxData + "</TaxDataAry></Fare>";
                    }
                }
            }

            FlightBAL objFlightsBal = new FlightBAL();

            #region Pricing
            //  string XmlPricingRequest = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";
            string XmlPricingRequest = "<PriceRequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>" + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails>";
            XmlPricingRequest = XmlPricingRequest + "<onward><FlightSegments>";

            if (dtFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                for (int j = 0; j < rowFilghtSegment.Length; j++)
                {
                    AirEquipType = rowFilghtSegment[j]["AirEquipType"].ToString();
                    ArrivalAirportCode = rowFilghtSegment[j]["ArrivalAirportCode"].ToString();
                    ArrivalAirportName = rowFilghtSegment[j]["ArrivalAirportName"].ToString();
                    ArrivalDateTime = rowFilghtSegment[j]["ArrivalDateTime"].ToString();
                    DepartureAirportCode = rowFilghtSegment[j]["DepartureAirportCode"].ToString();
                    DepartureAirportName = rowFilghtSegment[j]["DepartureAirportName"].ToString();
                    DepartureDateTime = rowFilghtSegment[j]["DepartureDateTime"].ToString();
                    FlightNumber = rowFilghtSegment[j]["FlightNumber"].ToString();
                    MarketingAirlineCode = rowFilghtSegment[j]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCode = rowFilghtSegment[j]["OperatingAirlineCode"].ToString();
                    OperatingAirlineName = rowFilghtSegment[j]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumber = rowFilghtSegment[j]["OperatingAirlineFlightNumber"].ToString();
                    NumStops = rowFilghtSegment[j]["NumStops"].ToString();
                    LinkSellAgrmnt = rowFilghtSegment[j]["LinkSellAgrmnt"].ToString();
                    Conx = rowFilghtSegment[j]["Conx"].ToString();
                    AirpChg = rowFilghtSegment[j]["AirpChg"].ToString();
                    InsideAvailOption = rowFilghtSegment[j]["InsideAvailOption"].ToString();
                    GenTrafRestriction = rowFilghtSegment[j]["GenTrafRestriction"].ToString();
                    DaysOperates = rowFilghtSegment[j]["DaysOperates"].ToString();
                    JrnyTm = rowFilghtSegment[j]["JrnyTm"].ToString();
                    EndDt = rowFilghtSegment[j]["EndDt"].ToString();
                    StartTerminal = rowFilghtSegment[j]["StartTerminal"].ToString();
                    EndTerminal = rowFilghtSegment[j]["EndTerminal"].ToString();
                    FltTm = rowFilghtSegment[j]["FltTm"].ToString();
                    LSAInd = rowFilghtSegment[j]["LSAInd"].ToString();
                    Mile = rowFilghtSegment[j]["Mile"].ToString();

                    DataTable dtBookingClass1 = dsIntFlights.Tables[13];
                    if (dtBookingClass1.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClass = dtBookingClass1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                        Availability = rowBookingClass[0]["Availability"].ToString();
                        BIC = rowBookingClass[0]["BIC"].ToString();
                    }

                    DataTable dtBookingClassFare1 = dsIntFlights.Tables[14];
                    if (dtBookingClassFare1.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFare = dtBookingClassFare1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                        bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                        classType = rowBookingClassFare[0]["classType"].ToString();
                        farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                        Rule = rowBookingClassFare[0]["Rule"].ToString();

                    }

                    XmlPricingRequest = XmlPricingRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                    XmlPricingRequest = XmlPricingRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                    // XmlPricingRequest = XmlPricingRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment>";
                    XmlPricingRequest = XmlPricingRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                    if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {
                        XmlPricingRequest = XmlPricingRequest + "<PsgrBreakup><PsgrAry>" + taxdatapsgr + "</PsgrAry></PsgrBreakup>";
                    }
                    XmlPricingRequest = XmlPricingRequest + "</BookingClassFare></FlightSegment>";
                }
            }
            XmlPricingRequest = XmlPricingRequest + "</FlightSegments></onward><Return>" + return1 + "</Return><id>" + id + "</id><key>" + key + "</key>";
            XmlPricingRequest = XmlPricingRequest + "</OriginDestinationOption></PriceRequest>";
            //  XmlPricingRequest = "<PriceRequest><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><OriginDestinationOption><FareDetails><ActualBaseFare>1200</ActualBaseFare><Tax>2434</Tax><STax>15</STax><TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>0</TDiscount><TMarkup>0</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>ADT</PsgrType><BaseFare>1200</BaseFare><Tax>2434</Tax></Fare></FareAry></FareBreakup><ocTax>0</ocTax></FareDetails><onward><FlightSegments><FlightSegment><AirEquipType>319</AirEquipType><ArrivalAirportCode>BOM</ArrivalAirportCode><ArrivalAirportName>MUMBAI</ArrivalAirportName><ArrivalDateTime>2012-11-22T08:20:00</ArrivalDateTime><DepartureAirportCode>BLR</DepartureAirportCode><DepartureAirportName>BANGALORE</DepartureAirportName><DepartureDateTime>2012-11-22T06:45:00</DepartureDateTime><FlightNumber>640</FlightNumber><MarketingAirlineCode>AI</MarketingAirlineCode><OperatingAirlineCode>AI</OperatingAirlineCode><OperatingAirlineName>Air India </OperatingAirlineName><OperatingAirlineFlightNumber>640</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm>95</JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>95</FltTm><LSAInd>NR</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>E</BIC></BookingClass><BookingClassFare><bookingclass>E</bookingclass><classType>Economy</classType><farebasiscode>2vRNmb/yC+cens5pMtaPkYnDM963BJmv</farebasiscode><Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>1200</BaseFare><Tax>2434</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></onward><Return></Return><id>arzoo13</id><key>zWbxBFyA059f68R2DgKcVEb0gG2ZuxB2ESt+/BTgCLzQweTiPhdGIWgoifR/a2Cj9x+aTfz36efDvXFXubDdI3wdmkWLxP8GZ+Lq5Tx3+M+2Q/P5Ci0UbF/rxHYOApxUDGWf4lPayrbQweTiPhdGIWgoifR/a2Cj6xVBmZQfx+ONy3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cCU/hS9xGE+mdK+SICvYvDvXFXubDdIyuoEEf9FbAN4z7uuUBbuJV0ouCOH4QaD+k2w/1qSPBE4z7uuUBbuJVNq/UVRvg/WtDB5OI+F0YhaCiJ9H9rYKNiGWZ6hnYEx2fi6uU8d/jPAJdXKqYIvc6k7AR2V9RC8mLW1E7VsZRB6xVBmZQfx+ONy3thiCpYikgRopJOZai5w71xV7mw3SOesti0ItOrM+qV6E/q3ryX4z7uuUBbuJVda06JiVzmQbdnNHyB7CF7LlNKor8yYnvQweTiPhdGIWgoifR/a2CjIMslYqDKLY23AlP4UvcRhGj3lQ/u1K004z7uuUBbuJXZbs/Nj1KYstDB5OI+F0YhaCiJ9H9rYKN0T/ucEjF5PZ1wvmyPYreXJCBv6x4bv/pu0YP7Nu5g2NDB5OI+F0YhaCiJ9H9rYKOhL5P5CPMmfY3Le2GIKliKHFNpSrtt65mFdYu72bssK5KdnOzPZf54twJT+FL3EYTpQH95xm5Uz1e19n1oIAdmy0wCTwW+1dqVswhkwvUGUDOPZa2xmRkUvCTUhkR0CW/QweTiPhdGIT52/cnXSmDtDgDBTfsCDU1n4urlPHf4z7ZD8/kKLRRsX+vEdg4CnFQMZZ/iU9rKttDB5OI+F0YhPnb9yddKYO0kSKl1oUnxcdDB5OI+F0YhaCiJ9H9rYKNPW37Oq/0IzMO9cVe5sN0jIVA6RFn+Em3QweTiPhdGIWgoifR/a2CjfXbFNbiqMm99r9ByVqdVqiM7V96J</key></OriginDestinationOption></PriceRequest>";
           DataSet dsPricingResponse = objFlightsBal.GetDatasetFromAPI(XmlPricingRequest, "http://live.arzoo.com:9302/Pricing");

                if (dsPricingResponse.Tables[0].Rows[0]["error"] == string.Empty)
                {
                    //  DataTable dtpricingflightsegment = dsPricingResponse.Tables

                    DataTable dtpricingFlightSegment = dsPricingResponse.Tables["FlightSegment"];
                    if (dtpricingFlightSegment.Rows.Count > 0)
                    {
                        DataRow[] rowFilghtSegment = dtpricingFlightSegment.Select("FlightSegment_ID=" + Convert.ToInt32(lblIntFlightSegmentId.Text));
                        FlightSegmentsID = rowFilghtSegment[0]["FlightSegments_Id"].ToString();

                    }
                    DataTable dtpricingFlightSegments = dsPricingResponse.Tables["FlightSegments"];
                    if (dtpricingFlightSegments.Rows.Count > 0)
                    {
                        DataRow[] rowFilghtSegments = dtpricingFlightSegments.Select("FlightSegments_ID=" + FlightSegmentsID);
                        onwardId = rowFilghtSegments[0]["Onward_Id"].ToString();
                    }
                    DataTable dtpricingOnward = dsPricingResponse.Tables["onward"];
                    if (dtpricingOnward.Rows.Count > 0)
                    {
                        DataRow[] rowOnward = dtpricingOnward.Select("Onward_Id=" + onwardId);
                        OriginDestinationOption_Id = rowOnward[0]["OriginDestinationOption_Id"].ToString();
                    }
                    DataTable dtpricingFareDetails = dsIntFlights.Tables["FareDetails"];
                    if (dtFareDetails.Rows.Count > 0)
                    {
                        DataRow[] rowFareDetails = dtFareDetails.Select("OriginDestinationOption_Id=" + OriginDestinationOption_Id);
                        ActualBaseFare = rowFareDetails[0]["ActualBaseFare"].ToString();
                        Tax = rowFareDetails[0]["Tax"].ToString();
                        STax = rowFareDetails[0]["STax"].ToString();
                        TCharge = rowFareDetails[0]["TCharge"].ToString();
                        SCharge = rowFareDetails[0]["SCharge"].ToString();
                        TDiscount = rowFareDetails[0]["TDiscount"].ToString();
                        TMarkup = rowFareDetails[0]["TMarkup"].ToString();
                        TPartnerCommission = rowFareDetails[0]["TPartnerCommission"].ToString();
                        TSdiscount = rowFareDetails[0]["TSdiscount"].ToString();
                        ocTax = rowFareDetails[0]["ocTax"].ToString();
                        FareDetails_id = rowFareDetails[0]["FareDetails_id"].ToString();
                    }
                }

            #endregion

            string ref1 = Common.GetFlightsReferenceNo("LJIF");

            string xmlRequest = "<Bookingrequest><noadults>" + ddlAdultsInt.SelectedValue + "</noadults><nochild>" + ddlChildsInt.SelectedValue + "</nochild><noinfant>" + ddlInfantsInt.SelectedValue + "</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno></creditcardno><PartnerreferenceID>" + ref1 + "</PartnerreferenceID>";
            xmlRequest = xmlRequest + "<personName>";

            // Dynamic generation of names of adults, infants , Child
            Table tbladults = (Table)this.UpdatePanel2.FindControl("tblAdultsInt");
            for (int i = 1; i <= Convert.ToInt32(Session["adultCntInt"]); i++)
            {

                TextBox txtFn = (TextBox)tbladults.FindControl("txtFnInt" + i);
                TextBox txtLn = (TextBox)tbladults.FindControl("txtLnInt" + i);
                DropDownList ddlTitle = (DropDownList)tbladults.FindControl("ddlTitleInt" + i);

                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><psgrtype>adt</psgrtype></CustomerInfo>";
            }

            Table tblChild = (Table)this.UpdatePanel2.FindControl("tblChildInt");
            for (int i = 1; i <= Convert.ToInt32(Session["childCntInt"]); i++)
            {
                TextBox txtFn = (TextBox)tblChild.FindControl("txtCFnInt" + i);

                TextBox txtLn = (TextBox)tblChild.FindControl("txtCLnInt" + i);

                DropDownList ddlTitle = (DropDownList)tblChild.FindControl("ddlCTitleInt" + i);

                TextBox txtBirthDate = (TextBox)tblChild.FindControl("txtCBirthDateInt" + i);

                string age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                //if (Convert.ToInt32(age) > 5)
                //{
                //    Literal lit = new Literal();
                //    lit.Text = txtFn.Text + " Age  between 3 - 5 yrs.";
                //    this.Controls.Add(lit);
                //    break;
                //}

                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>chd</psgrtype></CustomerInfo>";
            }

            Table tblInfants = (Table)this.UpdatePanel2.FindControl("tblInfantsInt");
            for (int i = 1; i <= Convert.ToInt32(Session["infantCntInt"]); i++)
            {
                TextBox txtFn = (TextBox)tblInfants.FindControl("txtIFnInt" + i);

                TextBox txtLn = (TextBox)tblInfants.FindControl("txtILnInt" + i);

                DropDownList ddlTitle = (DropDownList)tblInfants.FindControl("ddlITitleInt" + i);

                TextBox txtBirthDate = (TextBox)tblInfants.FindControl("txtIBirthDateInt" + i);
                string age = string.Empty;
                if (txtBirthDate != null)
                    age = (DateTime.Now.Year - Convert.ToDateTime(txtBirthDate.Text).Year).ToString();
                else
                    age = "0";
                //if (Convert.ToInt32(age) == 12)
                //{
                //    Literal lit = new Literal();
                //    lit.Text = txtFn.Text + " Age should be below 1 yr.";
                //    this.Controls.Add(lit);
                //    break;
                //}

                xmlRequest = xmlRequest + "<CustomerInfo><givenName>" + txtFn.Text + "</givenName><surName>" + txtLn.Text + "</surName><nameReference>" + ddlTitle.SelectedItem.Value + "</nameReference><dob>" + txtBirthDate.Text + "</dob><age>" + age + "</age><psgrtype>inf</psgrtype></CustomerInfo>";
            }

            xmlRequest = xmlRequest + "</personName><telePhone><phoneNumber>" + txtMobileNumInt.Text + "</phoneNumber></telePhone><email><emailAddress>" + txtEmailIDInt.Text + "</emailAddress></email>";
            //xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>" + PsgrType + "</PsgrType><BaseFare>" + BaseFare + "</BaseFare><Tax>" + FareTax + "</Tax><TaxDataAry>";
            //xmlRequest = xmlRequest + taxData + "</TaxDataAry></Fare></FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";
            xmlRequest = xmlRequest + "<OriginDestinationOption><FareDetails><ActualBaseFare>" + ActualBaseFare + "</ActualBaseFare><Tax>" + Tax + "</Tax><STax>" + STax + "</STax><TCharge>" + TCharge + "</TCharge><SCharge>" + SCharge + "</SCharge><TDiscount>" + TDiscount + "</TDiscount><TMarkup>" + TMarkup + "</TMarkup><TPartnerCommission>" + TPartnerCommission + "</TPartnerCommission><TSdiscount>" + TSdiscount + "</TSdiscount><FareBreakup><FareAry>";
            xmlRequest = xmlRequest + str + "</FareAry></FareBreakup><ocTax>" + ocTax + "</ocTax></FareDetails><onward><FlightSegments>";

            if (dtFlightSegment.Rows.Count > 0)
            {
                DataRow[] rowFilghtSegment = dtFlightSegment.Select("FlightSegments_Id=" + FlightSegmentsID);
                for (int j = 0; j < rowFilghtSegment.Length; j++)
                {
                    AirEquipType = rowFilghtSegment[j]["AirEquipType"].ToString();
                    ArrivalAirportCode = rowFilghtSegment[j]["ArrivalAirportCode"].ToString();
                    ArrivalAirportName = rowFilghtSegment[j]["ArrivalAirportName"].ToString();
                    ArrivalDateTime = rowFilghtSegment[j]["ArrivalDateTime"].ToString();
                    DepartureAirportCode = rowFilghtSegment[j]["DepartureAirportCode"].ToString();
                    DepartureAirportName = rowFilghtSegment[j]["DepartureAirportName"].ToString();
                    DepartureDateTime = rowFilghtSegment[j]["DepartureDateTime"].ToString();
                    FlightNumber = rowFilghtSegment[j]["FlightNumber"].ToString();
                    MarketingAirlineCode = rowFilghtSegment[j]["MarketingAirlineCode"].ToString();
                    OperatingAirlineCode = rowFilghtSegment[j]["OperatingAirlineCode"].ToString();
                    OperatingAirlineName = rowFilghtSegment[j]["OperatingAirlineName"].ToString();
                    OperatingAirlineFlightNumber = rowFilghtSegment[j]["OperatingAirlineFlightNumber"].ToString();
                    NumStops = rowFilghtSegment[j]["NumStops"].ToString();
                    LinkSellAgrmnt = rowFilghtSegment[j]["LinkSellAgrmnt"].ToString();
                    Conx = rowFilghtSegment[j]["Conx"].ToString();
                    AirpChg = rowFilghtSegment[j]["AirpChg"].ToString();
                    InsideAvailOption = rowFilghtSegment[j]["InsideAvailOption"].ToString();
                    GenTrafRestriction = rowFilghtSegment[j]["GenTrafRestriction"].ToString();
                    DaysOperates = rowFilghtSegment[j]["DaysOperates"].ToString();
                    JrnyTm = rowFilghtSegment[j]["JrnyTm"].ToString();
                    EndDt = rowFilghtSegment[j]["EndDt"].ToString();
                    StartTerminal = rowFilghtSegment[j]["StartTerminal"].ToString();
                    EndTerminal = rowFilghtSegment[j]["EndTerminal"].ToString();
                    FltTm = rowFilghtSegment[j]["FltTm"].ToString();
                    LSAInd = rowFilghtSegment[j]["LSAInd"].ToString();
                    Mile = rowFilghtSegment[j]["Mile"].ToString();

                    DataTable dtBookingClass1 = dsIntFlights.Tables[13];
                    if (dtBookingClass1.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClass = dtBookingClass1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                        Availability = rowBookingClass[0]["Availability"].ToString();
                        BIC = rowBookingClass[0]["BIC"].ToString();
                    }

                    DataTable dtBookingClassFare1 = dsIntFlights.Tables[14];
                    if (dtBookingClassFare1.Rows.Count > 0)
                    {
                        DataRow[] rowBookingClassFare = dtBookingClassFare1.Select("FlightSegment_Id=" + rowFilghtSegment[j]["FlightSegment_Id"].ToString());
                        bookingclass = rowBookingClassFare[0]["bookingclass"].ToString();
                        classType = rowBookingClassFare[0]["classType"].ToString();
                        farebasiscode = rowBookingClassFare[0]["farebasiscode"].ToString();
                        Rule = rowBookingClassFare[0]["Rule"].ToString();

                    }

                    xmlRequest = xmlRequest + "<FlightSegment><AirEquipType>" + AirEquipType + "</AirEquipType><ArrivalAirportCode>" + ArrivalAirportCode + "</ArrivalAirportCode><ArrivalAirportName>" + ArrivalAirportName + "</ArrivalAirportName><ArrivalDateTime>" + ArrivalDateTime + "</ArrivalDateTime><DepartureAirportCode>" + DepartureAirportCode + "</DepartureAirportCode><DepartureAirportName>" + DepartureAirportName + "</DepartureAirportName><DepartureDateTime>" + DepartureDateTime + "</DepartureDateTime><FlightNumber>" + FlightNumber + "</FlightNumber>";
                    xmlRequest = xmlRequest + "<MarketingAirlineCode>" + MarketingAirlineCode + "</MarketingAirlineCode><OperatingAirlineCode>" + OperatingAirlineCode + "</OperatingAirlineCode><OperatingAirlineName>" + OperatingAirlineName + "</OperatingAirlineName><OperatingAirlineFlightNumber>" + OperatingAirlineFlightNumber + "</OperatingAirlineFlightNumber><NumStops>" + NumStops + "</NumStops><LinkSellAgrmnt>" + LinkSellAgrmnt + "</LinkSellAgrmnt><Conx>" + Conx + "</Conx><AirpChg>" + AirpChg + "</AirpChg><InsideAvailOption>" + InsideAvailOption + "</InsideAvailOption><GenTrafRestriction>" + GenTrafRestriction + "</GenTrafRestriction><DaysOperates>" + DaysOperates + "</DaysOperates><JrnyTm>" + JrnyTm + "</JrnyTm><EndDt>" + EndDt + "</EndDt><StartTerminal>" + StartTerminal + "</StartTerminal><EndTerminal>" + EndTerminal + "</EndTerminal>";
                    xmlRequest = xmlRequest + "<FltTm>" + FltTm + "</FltTm><LSAInd>" + LSAInd + "</LSAInd><Mile>" + Mile + "</Mile><BookingClass><Availability>" + Availability + "</Availability><BIC>" + BIC + "</BIC></BookingClass><BookingClassFare><bookingclass>" + bookingclass + "</bookingclass><classType>" + classType + "</classType><farebasiscode>" + farebasiscode + "</farebasiscode><Rule>" + Rule.Replace("<", "&lt;").Replace(">", "&gt;") + "</Rule>";
                    if (dtBookingClassFare.Columns.Contains("bookingclassFare_Id"))
                    {
                        xmlRequest = xmlRequest + "<PsgrBreakup><PsgrAry><Psgr><PsgrType>" + FarePsgrType + "</PsgrType><BaseFare>" + FareBaseFare + "</BaseFare><Tax>" + FareTax1 + "</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup>";
                    }
                    xmlRequest = xmlRequest + "</BookingClassFare></FlightSegment>";
                }
            }
            xmlRequest = xmlRequest + "</FlightSegments></onward><Return>" + return1 + "</Return><id>" + id + "</id><key>" + key + "</key>";
            xmlRequest = xmlRequest + "</OriginDestinationOption></Bookingrequest>";

            #region Unwanted Code
            //xmlRequest = "<Bookingrequest><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>" + FlightsConstants.USERID + "</Clientid>";
            //xmlRequest = xmlRequest + "<Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno></creditcardno><PartnerreferenceID>" + ref1 + "</PartnerreferenceID><personName><CustomerInfo><givenName>Bindu</givenName> <surName>B</surName>";
            //xmlRequest = xmlRequest + "<nameReference>Mrs.</nameReference>";
            //xmlRequest = xmlRequest + "<psgrtype>adt</psgrtype>";
            //xmlRequest = xmlRequest + "</CustomerInfo>";
            //xmlRequest = xmlRequest + "</personName>";
            //xmlRequest = xmlRequest + "<telePhone>";
            //xmlRequest = xmlRequest + "<phoneNumber>9701213996</phoneNumber>";
            //xmlRequest = xmlRequest + "</telePhone>";
            //xmlRequest = xmlRequest + "<email>";
            //xmlRequest = xmlRequest + "<emailAddress>[email protected]</emailAddress>";
            //xmlRequest = xmlRequest + "</email>";
            //xmlRequest = xmlRequest + "<OriginDestinationOption>";
            //xmlRequest = xmlRequest + "<FareDetails>";
            //xmlRequest = xmlRequest + "<ActualBaseFare>21250</ActualBaseFare>";
            //xmlRequest = xmlRequest + "<Tax>19675</Tax>";
            //xmlRequest = xmlRequest + "<STax>264</STax>";
            //xmlRequest = xmlRequest + "<TCharge>0</TCharge>";
            //xmlRequest = xmlRequest + "<SCharge>0</SCharge>";
            //xmlRequest = xmlRequest + "<TDiscount>0</TDiscount>";
            //xmlRequest = xmlRequest + "<TMarkup>0</TMarkup>";
            //xmlRequest = xmlRequest + "<TPartnerCommission>0</TPartnerCommission>";
            //xmlRequest = xmlRequest + "<TSdiscount>0</TSdiscount>";
            //xmlRequest = xmlRequest + "<FareBreakup>";
            //xmlRequest = xmlRequest + "<FareAry>";
            //xmlRequest = xmlRequest + "<Fare>";
            //xmlRequest = xmlRequest + "<PsgrType>ADT</PsgrType>";
            //xmlRequest = xmlRequest + "<BaseFare>21250</BaseFare>";
            //xmlRequest = xmlRequest + "<Tax>19675</Tax>";
            //xmlRequest = xmlRequest + "<TaxDataAry>";
            //xmlRequest = xmlRequest + "<TaxData>";
            //xmlRequest = xmlRequest + "<Country>YQ</Country>";
            //xmlRequest = xmlRequest + "<Amt>0</Amt>";
            //xmlRequest = xmlRequest + "</TaxData>";
            //xmlRequest = xmlRequest + "<TaxData>";
            //xmlRequest = xmlRequest + "<Country>WO</Country>";
            //xmlRequest = xmlRequest + "<Amt>7108</Amt>";
            //xmlRequest = xmlRequest + "</TaxData>";
            //xmlRequest = xmlRequest + "<TaxData>";
            //xmlRequest = xmlRequest + "<Country>Other</Country>";
            //xmlRequest = xmlRequest + "<Amt>12567</Amt>";
            //xmlRequest = xmlRequest + "</TaxData>";
            //xmlRequest = xmlRequest + "</TaxDataAry>";
            //xmlRequest = xmlRequest + "</Fare>";
            //xmlRequest = xmlRequest + "</FareAry>";
            //xmlRequest = xmlRequest + "</FareBreakup>";
            //xmlRequest = xmlRequest + "<ocTax>0</ocTax>";
            //xmlRequest = xmlRequest + "</FareDetails>";
            //xmlRequest = xmlRequest + "<onward>";
            //xmlRequest = xmlRequest + "<FlightSegments>";
            //xmlRequest = xmlRequest + "<FlightSegment>";
            //xmlRequest = xmlRequest + "<AirEquipType>744</AirEquipType>";
            //xmlRequest = xmlRequest + "<ArrivalAirportCode>LHR</ArrivalAirportCode>";
            //xmlRequest = xmlRequest + "<ArrivalAirportName>London</ArrivalAirportName>";
            //xmlRequest = xmlRequest + "<ArrivalDateTime>2012-11-19T13:25:00</ArrivalDateTime>";
            //xmlRequest = xmlRequest + "<DepartureAirportCode>BLR</DepartureAirportCode>";
            //xmlRequest = xmlRequest + "<DepartureAirportName>BANGALORE</DepartureAirportName>";
            //xmlRequest = xmlRequest + "<DepartureDateTime>2012-11-19T07:50:00</DepartureDateTime>";
            //xmlRequest = xmlRequest + "<FlightNumber>6656</FlightNumber>";
            //xmlRequest = xmlRequest + "<MarketingAirlineCode>AA</MarketingAirlineCode>";
            //xmlRequest = xmlRequest + "<OperatingAirlineCode>BA</OperatingAirlineCode>";
            //xmlRequest = xmlRequest + "<OperatingAirlineName>American Airlines </OperatingAirlineName>";
            //xmlRequest = xmlRequest + "<OperatingAirlineFlightNumber>6656</OperatingAirlineFlightNumber>";
            //xmlRequest = xmlRequest + "<NumStops>0</NumStops>";
            //xmlRequest = xmlRequest + "<LinkSellAgrmnt />";
            //xmlRequest = xmlRequest + "<Conx>N</Conx>";
            //xmlRequest = xmlRequest + "<AirpChg>N</AirpChg>";
            //xmlRequest = xmlRequest + "<InsideAvailOption>C</InsideAvailOption>";
            //xmlRequest = xmlRequest + "<GenTrafRestriction>?</GenTrafRestriction>";
            //xmlRequest = xmlRequest + "<DaysOperates>NA</DaysOperates>";
            //xmlRequest = xmlRequest + "<JrnyTm>665</JrnyTm>";
            //xmlRequest = xmlRequest + "<EndDt />";
            //xmlRequest = xmlRequest + "<StartTerminal />";
            //xmlRequest = xmlRequest + "<EndTerminal />";
            //xmlRequest = xmlRequest + "<FltTm>665</FltTm>";
            //xmlRequest = xmlRequest + "<LSAInd>R</LSAInd>";
            //xmlRequest = xmlRequest + "<Mile>0</Mile>";
            //xmlRequest = xmlRequest + "<BookingClass>";
            //xmlRequest = xmlRequest + "<Availability>1</Availability>";
            //xmlRequest = xmlRequest + "<BIC>S</BIC>";
            //xmlRequest = xmlRequest + "</BookingClass>";
            //xmlRequest = xmlRequest + "<BookingClassFare>";
            //xmlRequest = xmlRequest + "<bookingclass>S</bookingclass>";
            //xmlRequest = xmlRequest + "<classType>Economy</classType>";
            //xmlRequest = xmlRequest + "<farebasiscode>ZeHo17My7PSA3CBU2WO9J34bX8FEuX61F9zkShsUkYU=</farebasiscode>";
            //xmlRequest = xmlRequest + "<Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule>";
            //xmlRequest = xmlRequest + "<PsgrBreakup>";
            //xmlRequest = xmlRequest + "<PsgrAry>";
            //xmlRequest = xmlRequest + "<Psgr>";
            //xmlRequest = xmlRequest + "<PsgrType>ADT</PsgrType>";
            //xmlRequest = xmlRequest + "<BaseFare>21250</BaseFare>";
            //xmlRequest = xmlRequest + "<Tax>19675</Tax>";
            //xmlRequest = xmlRequest + "<BagInfo />";
            //xmlRequest = xmlRequest + "</Psgr>";
            //xmlRequest = xmlRequest + "</PsgrAry>";
            //xmlRequest = xmlRequest + "</PsgrBreakup>";
            //xmlRequest = xmlRequest + "</BookingClassFare>";
            //xmlRequest = xmlRequest + "</FlightSegment>";
            //xmlRequest = xmlRequest + "<FlightSegment>";
            //xmlRequest = xmlRequest + "<AirEquipType>777</AirEquipType>";
            //xmlRequest = xmlRequest + "<ArrivalAirportCode>JFK</ArrivalAirportCode>";
            //xmlRequest = xmlRequest + "<ArrivalAirportName>NEW YORK</ArrivalAirportName>";
            //xmlRequest = xmlRequest + "<ArrivalDateTime>2012-11-19T18:10:00</ArrivalDateTime>";
            //xmlRequest = xmlRequest + "<DepartureAirportCode>LHR</DepartureAirportCode>";
            //xmlRequest = xmlRequest + "<DepartureAirportName>London</DepartureAirportName>";
            //xmlRequest = xmlRequest + "<DepartureDateTime>2012-11-19T15:15:00</DepartureDateTime>";
            //xmlRequest = xmlRequest + "<FlightNumber>6134</FlightNumber>";
            //xmlRequest = xmlRequest + "<MarketingAirlineCode>AA</MarketingAirlineCode>";
            //xmlRequest = xmlRequest + "<OperatingAirlineCode>BA</OperatingAirlineCode>";
            //xmlRequest = xmlRequest + "<OperatingAirlineName>American Airlines </OperatingAirlineName>";
            //xmlRequest = xmlRequest + "<OperatingAirlineFlightNumber>6134</OperatingAirlineFlightNumber>";
            //xmlRequest = xmlRequest + "<NumStops>0</NumStops>";
            //xmlRequest = xmlRequest + "<LinkSellAgrmnt />";
            //xmlRequest = xmlRequest + "<Conx>N</Conx>";
            //xmlRequest = xmlRequest + "<AirpChg>N</AirpChg>";
            //xmlRequest = xmlRequest + "<InsideAvailOption>C</InsideAvailOption>";
            //xmlRequest = xmlRequest + "<GenTrafRestriction>?</GenTrafRestriction>";
            //xmlRequest = xmlRequest + "<DaysOperates>NA</DaysOperates>";
            //xmlRequest = xmlRequest + "<JrnyTm>985</JrnyTm>";
            //xmlRequest = xmlRequest + "<EndDt />";
            //xmlRequest = xmlRequest + "<StartTerminal />";
            //xmlRequest = xmlRequest + "<EndTerminal />";
            //xmlRequest = xmlRequest + "<FltTm>985</FltTm>";
            //xmlRequest = xmlRequest + "<LSAInd>R</LSAInd>";
            //xmlRequest = xmlRequest + "<Mile>0</Mile>";
            //xmlRequest = xmlRequest + "<BookingClass>";
            //xmlRequest = xmlRequest + "<Availability>7</Availability>";
            //xmlRequest = xmlRequest + "<BIC>S</BIC>";
            //xmlRequest = xmlRequest + "</BookingClass>";
            //xmlRequest = xmlRequest + "<BookingClassFare>";
            //xmlRequest = xmlRequest + "<bookingclass>S</bookingclass>";
            //xmlRequest = xmlRequest + "<classType>Economy</classType>";
            //xmlRequest = xmlRequest + "<farebasiscode>ZeHo17My7PSA3CBU2WO9J34bX8FEuX61F9zkShsUkYU=</farebasiscode>";
            //xmlRequest = xmlRequest + "<Rule>Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.&lt;br&gt;In addition to the airline''s cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline''s date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|</Rule>";
            //xmlRequest = xmlRequest + "<PsgrBreakup>";
            //xmlRequest = xmlRequest + "<PsgrAry>";
            //xmlRequest = xmlRequest + "<Psgr>";
            //xmlRequest = xmlRequest + "<PsgrType>ADT</PsgrType>";
            //xmlRequest = xmlRequest + "<BaseFare>21250</BaseFare>";
            //xmlRequest = xmlRequest + "<Tax>19675</Tax>";
            //xmlRequest = xmlRequest + "<BagInfo />";
            //xmlRequest = xmlRequest + "</Psgr>";
            //xmlRequest = xmlRequest + "</PsgrAry>";
            //xmlRequest = xmlRequest + "</PsgrBreakup>";
            //xmlRequest = xmlRequest + "</BookingClassFare>";
            //xmlRequest = xmlRequest + "</FlightSegment>";
            //xmlRequest = xmlRequest + "</FlightSegments>";
            //xmlRequest = xmlRequest + "</onward>";
            //xmlRequest = xmlRequest + "<Return />";
            //xmlRequest = xmlRequest + "<id>arzoo13</id>";
            //xmlRequest = xmlRequest + "<key>";
            //xmlRequest = xmlRequest + "zWbxBFyA059f68R2DgKcVEb0gG2ZuxB2eOVHvZcIhsrrFUGZlB/H443Le2GIKliKcDol4S0eYt5n";
            //xmlRequest = xmlRequest + "4urlPHf4zwkxESOCSurS2zJT2fsu8E6Ny3thiCpYihRRnjyQGrh7hXWLu9m7LCssMPJ4Xz20E7cC";
            //xmlRequest = xmlRequest + "U/hS9xGE+mdK+SICvYvDvXFXubDdIyuoEEf9FbAN4z7uuUBbuJWfy8uNPG/9b2fi6uU8d/jPtkPz";
            //xmlRequest = xmlRequest + "+QotFGxf68R2DgKcVAxln+JT2sq20MHk4j4XRiE+dv3J10pg7QerGRHTwDoP0MHk4j4XRiFoKIn0";
            //xmlRequest = xmlRequest + "f2tgo/6/bBnC356utwJT+FL3EYQxhMrs9+Ll73qUfflxOSlgjct7YYgqWIooknPUNPq0fsMbz0mC";
            //xmlRequest = xmlRequest + "CnYdPxS/giio89vDvXFXubDdI5p3QtIQ6TM+X+vEdg4CnFSHVzKRaecmxRqaN5ZXELxy0MHk4j4X";
            //xmlRequest = xmlRequest + "RiFoKIn0f2tgo08iYOkW5WfDVAdtvjUETBAUbFQMZCvw/rcCU/hS9xGEV/KirOjbVWVf68R2DgKc";
            //xmlRequest = xmlRequest + "VIdXMpFp5ybFFnoP/rNoJySNy3thiCpYinP52+a6dCWv4z7uuUBbuJUr4zgoGssePSsZx2FQz4Qz";
            //xmlRequest = xmlRequest + "Mi4GIKZ/bQN5v2nhdWyUxWkXlLIRnKfWBOVnFhmDx7P+RkIizk8EmY3Le2GIKliKvHScqTjHzQGF";
            //xmlRequest = xmlRequest + "dYu72bssK9yA/LGYY4DttwJT+FL3EYR8llOd/AvvBcO9cVe5sN0jaHWZ74lyniM+CXHuBVUeI0eC";
            //xmlRequest = xmlRequest + "jTlyW+v3IvPKAXmAs/XjPu65QFu4lRIiMi13yfqv0MHk4j4XRiFoKIn0f2tgo3rxF/w/vseO0MHk";
            //xmlRequest = xmlRequest + "4j4XRiFoKIn0f2tgo08iYOkW5WfDtBFngPW6tS4UbFQMZCvw/rcCU/hS9xGEPmH+rCYA9GVn4url";
            //xmlRequest = xmlRequest + "PHf4z/KpTLVv6TwZmq/OLBKU+urDvXFXubDdI76GeeoT8f7/mZIC7bwXLBPEyJNwmQ0Hhl/rxHYO";
            //xmlRequest = xmlRequest + "ApxUwsS2F117BWpVx8rwsmCp/7cCU/hS9xGEO2M3JTnaOUPjPu65QFu4lcYxXFxB1Lxm2zJT2fsu";
            //xmlRequest = xmlRequest + "8E6Ny3thiCpYiskg7jRgjK6SgNO9QJL9N+kUA6rZxn6L2roVT2rwaaIHT9JeYXDjtB74LCthwRi6";
            //xmlRequest = xmlRequest + "QuM+7rlAW7iVci/YXLUgYhtn4urlPHf4z0sauaT5dh0YX+vEdg4CnFRm6meIMgjYjdDB5OI+F0Yh";
            //xmlRequest = xmlRequest + "aCiJ9H9rYKMzmFBNkf0Z9F/rxHYOApxU8q6B7/fP8qZn4urlPHf4z6xCf1SAy2vSGs5/DTSC7BXj";
            //xmlRequest = xmlRequest + "Pu65QFu4lXSi4I4fhBoPMaaYjNFAcsm3AlP4UvcRhPpnSvkiAr2Lw71xV7mw3SMrqBBH/RWwDeM+";
            //xmlRequest = xmlRequest + "7rlAW7iVdKLgjh+EGg9kUDg3MAXg5eM+7rlAW7iV3nbymUm4szIU66LMw4VmWYV1i7vZuywr4wJX";
            //xmlRequest = xmlRequest + "2WV2PV5f68R2DgKcVAxln+JT2sq20MHk4j4XRiEuvf9jqO9829DB5OI+F0YhE8ZmQzVYvJbgy4cv";
            //xmlRequest = xmlRequest + "1MfIol/rxHYOApxUuPBYmR6Sgw5f68R2DgKcVCB0cQSVLEagT+e92o4/qz5f68R2DgKcVMcBF2dl";
            //xmlRequest = xmlRequest + "btCnrziqklPvBLLl8OEMpKE9Rrqlvng58vzQsS7VmIqni8k6cEhUG/jNng==";
            //xmlRequest = xmlRequest + "</key>";
            //xmlRequest = xmlRequest + "</OriginDestinationOption>";
            //xmlRequest = xmlRequest + "</Bookingrequest>";

            #endregion

            StringBuilder stt = new StringBuilder();

            stt.Append("xmlRequest");
            stt.Append("=");
            stt.Append(Server.UrlEncode(xmlRequest));
            byte[] requestData = Encoding.UTF8.GetBytes(stt.ToString());

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Booking");

            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.Accept = "application/json";

            request.ContentLength = requestData.Length;

            using (Stream requestStream = request.GetRequestStream())
            {
                requestStream.Write(requestData, 0, requestData.Length);
            }
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                        result = reader.ReadToEnd();
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(result);
                    XmlNodeReader xmlReader = new XmlNodeReader(doc);

                    ds.ReadXml(xmlReader);
                }
            }

            //result = "<Bookingresponse><OriginDestinationOption><FareDetails><ActualBaseFare>85035</ActualBaseFare><Tax>4079</Tax><STax>1055</STax><TCharge>0</TCharge><SCharge>0</SCharge><TDiscount>0</TDiscount><TMarkup>150</TMarkup><TPartnerCommission>0</TPartnerCommission><TSdiscount>0</TSdiscount><FareBreakup><FareAry><Fare><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax></Fare></FareAry></FareBreakup></FareDetails><onward><FlightSegments><FlightSegment><AirEquipType>77W</AirEquipType><ArrivalAirportCode>LHR</ArrivalAirportCode><ArrivalAirportName>LONDON&lt;BR&gt; (HEATHROW)</ArrivalAirportName><ArrivalDateTime>2010-02-26T06:35:00</ArrivalDateTime><DepartureAirportCode>BOM</DepartureAirportCode><DepartureAirportName>MUMBAI&lt;BR&gt; (CHHATRAPATI SHIVAJI INTERNATIONAL)</DepartureAirportName><DepartureDateTime>2010-02-26T02:05:00</DepartureDateTime><FlightNumber>4131</FlightNumber><MarketingAirlineCode>BD</MarketingAirlineCode><OperatingAirlineCode>BD</OperatingAirlineCode><OperatingAirlineName>British Midland</OperatingAirlineName><OperatingAirlineFlightNumber>4131</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>9</Availability><BIC>Y</BIC></BookingClass><BookingClassFare><bookingclass>Y</bookingclass><classType>Economy</classType><farebasiscode>rb8QAsvpFIPpZo9gBUBg+6BMOP0MtJ7L</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment><FlightSegment><AirEquipType>346</AirEquipType><ArrivalAirportCode>JFK</ArrivalAirportCode><ArrivalAirportName>NEW YORK&lt;BR&gt; (JOHN F KENNEDY INTL)</ArrivalAirportName><ArrivalDateTime>2010-02-26T12:20:00</ArrivalDateTime><DepartureAirportCode>LHR</DepartureAirportCode><DepartureAirportName>LONDON&lt;BR&gt; (HEATHROW)</DepartureAirportName><DepartureDateTime>2010-02-26T09:20:00</DepartureDateTime><FlightNumber>8223</FlightNumber><MarketingAirlineCode>CO</MarketingAirlineCode><OperatingAirlineCode>CO</OperatingAirlineCode><OperatingAirlineName>Continental Airlines </OperatingAirlineName><OperatingAirlineFlightNumber>8223</OperatingAirlineFlightNumber><NumStops>0</NumStops><LinkSellAgrmnt></LinkSellAgrmnt><Conx>N</Conx><AirpChg>N</AirpChg><InsideAvailOption>C</InsideAvailOption><GenTrafRestriction>?</GenTrafRestriction><DaysOperates>NA</DaysOperates><JrnyTm></JrnyTm><EndDt></EndDt><StartTerminal></StartTerminal><EndTerminal></EndTerminal><FltTm>0</FltTm><LSAInd>R</LSAInd><Mile>0</Mile><BookingClass><Availability>4</Availability><BIC>L</BIC></BookingClass><BookingClassFare><bookingclass>L</bookingclass><classType>Economy</classType><farebasiscode>rb8QAsvpFIPpZo9gBUBg+6BMOP0MtJ7L</farebasiscode><Rule></Rule><PsgrBreakup><PsgrAry><Psgr><PsgrType>ADT</PsgrType><BaseFare>85035</BaseFare><Tax>4079</Tax><BagInfo></BagInfo></Psgr></PsgrAry></PsgrBreakup></BookingClassFare></FlightSegment></FlightSegments></onward><Return/><id>arzoo100</id><key>ayCbutV8CZjQweTiPhdGIT52/cnXSmDtWDF6uoVa0Yx+dIrODcZqUYV1i7vZuywrXxtmsFOjbi9n4urlPHf4zxGFVKSEVPuglBZfw/aOkGOFdYu72bssKyww8nhfPbQTtwJT+FL3EYT6Z0r5IgK9i8O9cVe5sN0jK6gQR/0VsA3jPu65QFu4leESvkw2tYVo0MHk4j4XRiFoKIn0f2tgo+sVQZmUH8fjjct7YYgqWIoUUZ48kBq4e/0pg3DmQVVVo2Q3a0AUQSXLUP1Wu6PBd4V1i7vZuywrSdRter3iPenjPu65QFu4lbsv+JV45WPGtyljvg7883Sh2gnY0OmCJCn868u75ToLhXWLu9m7LCuMmusGneSEdRuxNaSOsudhnGqNtXQ916PjPu65QFu4lU2r9RVG+D9a0MHk4j4XRiFoKIn0f2tgozK2rkfhSWEWx6xZaH0ssx82RPW27flqmu5f2a5HBe02z/lJy0jWbT0M1G6o3Y+hzWfi6uU8d/jPAJdXKqYIvc5G93zQPY0iVQD8L1fsyfdm6xVBmZQfx+ONy3thiCpYihlAiI3xsTJF4z7uuUBbuJUEGsOfbTr3UF/rxHYOApxUsDfYCka6IQumFoD34DG1PbcCU/hS9xGEMwKsr63khSb3Qspj6nxBZe9bfmEZ7GUgEriX6+12U2wkVz4JY1XabcCU/hS9xGEcUGtscRHmuLDvXFXubDdIz12g5QheQXO4z7uuUBbuJVmadCAqLb2y2fi6uU8d/jPS1i6Qoti3wtoJoL9ZE4l6rEu1ZiKp4vJfk8fwf1jcc9f68R2DgKcVK1lGTAnSPxSl9HJUgz+eC+FdYu72bssKzNAqSxshbWRYUz9VFYzmixqeExNPowVA78GaMTl9BYe0fUDu2DE3rHDvXFXubDdI3dYiTg2zkNgU+gGkoFGtlfAPC2FpjoIsV/rxHYOApxURZOpRI/EzoEVg7MnTiMjPoV1i7vZuywrp7AOSJb8tei2GAYztr4tGO6Udvv6goYtX+vEdg4CnFThuwJPu5BuYitpzzDzl21bJ/v5/y98kwILsR2pjhA21YV1i7vZuywrGJgEwhHzH+9n4urlPHf4zwMsIQITsGsy0MHk4j4XRiFoKIn0f2tgowznwUkbWS71w71xV7mw3SOi9DZLo5De59CaB/YiXgfO40U/DdrAcfnP5jcg4z9RPIZB8/lb/sd5w71xV7mw3SNZoQyFRfkMl+M+7rlAW7iVOm7uM/9yhhNn4urlPHf4z7kR+x0lYQ5LX+vEdg4CnFRKt+2PZYo+CjOuGPE4fK4oZ+Lq5Tx3+M9KeFGbag7+buM+7rlAW7iVdKLgjh+EGg8Mv3JUr8Yz2NNESEN0N1nFqHicn8G1rgW8dJypOMfNAYV1i7vZuywrLDDyeF89tBO3AlP4UvcRhPpnSvkiAr2L00RIQ3Q3WcWoeJyfwbWuBfSvd+pfPzkTw71xV7mw3SNdcG/zHitfN1rAgZFeAikBjct7YYgqWIpXyYBKr/eg5uM+7rlAW7iVygQsiztYTQ9f68R2DgKcVBCq+RQJHE/z</key></OriginDestinationOption><telePhone><phoneNumber>9879961339</phoneNumber></telePhone><email><emailAddress>[email protected]</emailAddress></email><noadults>1</noadults><nochild>0</nochild><noinfant>0</noinfant><Clientid>Given By Arzoo.com</Clientid><Clienttype>ArzooINTLWS1.0</Clienttype><creditcardno>1234567890123456</creditcardno><error></error><personName><CustomerInfo><givenName>Sagar</givenName><surName>Arora</surName><nameReference>Mr.</nameReference><psgrtype>adt</psgrtype></CustomerInfo></personName><status>SUCCESS</status><transid>A396009</transid></Bookingresponse>";

            //   XmlDocument doc = new XmlDocument();
            //   doc.LoadXml(result);
            //   XmlNodeReader xmlReader = new XmlNodeReader(doc);

            //   ds.ReadXml(xmlReader);

        }

        catch (Exception ex)
        {
            if (ex.Message.Contains("409"))
            {
                lblerror.Text = "Please contact administrator";
                lblerror.Visible = true;
            }
        }
        return ds;
    }
    protected void btnBookStatusInt_Click(object sender, EventArgs e)
    {
        string result = string.Empty;
        DataSet ds = new DataSet();
        transId = "A396009";
        String xmlRequest = "xmlRequest=<EticketRequest><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooFWS1.1</Clienttype><transid>" + transId + "</transid></EticketRequest>";

        byte[] requestData = Encoding.ASCII.GetBytes(xmlRequest);
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://live.arzoo.com:9302/Booking");

        request.Method = "POST";
        request.ContentType = "application/x-www-form-urlencoded";
        request.ContentLength = requestData.Length;

        using (Stream requestStream = request.GetRequestStream())
        {
            requestStream.Write(requestData, 0, requestData.Length);
        }

        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
        {
            using (Stream stream = response.GetResponseStream())
            {
                using (StreamReader reader = new StreamReader(stream, Encoding.ASCII))
                    result = reader.ReadToEnd();
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(result);
                XmlNodeReader xmlReader = new XmlNodeReader(doc);

                ds.ReadXml(xmlReader);
            }
        }
    }
示例#47
-1
    public static void clr_GetADobjects(SqlString ADpath, SqlString ADfilter, out SqlXml MemberList)
    {
        // Filter syntax: https://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx
        // AD attributes: https://msdn.microsoft.com/en-us/library/ms675089(v=vs.85).aspx

        MemberList = new SqlXml();

        //System.IO.StreamWriter file = Util.CreateLogFile();

        SearchResultCollection results = null;
        Int32 itemcount = 0;
        try
        {
            XmlDocument doc = new XmlDocument();
            XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
            XmlElement root = doc.DocumentElement;
            doc.InsertBefore(xmlDeclaration, root);
            XmlElement body = doc.CreateElement(string.Empty, "body", string.Empty);
            doc.AppendChild(body);

            ADcolsTable TblData = new ADcolsTable((string)ADfilter);
            DataTable tbl = TblData.CreateTable();
            DataRow row;

            // Create key/value collection - key is (user) distinguishedname, value is object GUID.
            Dictionary<string, Guid> UserDStoGUID = new Dictionary<string, Guid>();

            DirectoryEntry entry = new DirectoryEntry((string)ADpath);
            DirectorySearcher searcher = new DirectorySearcher(entry);
            searcher.Filter = (string)ADfilter;
            searcher.PageSize = 500;

            results = searcher.FindAll();
            foreach (SearchResult searchResult in results)
            {
                itemcount++;
                DirectoryEntry item = searchResult.GetDirectoryEntry();
                row = tbl.NewRow();

                UACflags Item_UAC_flags = null;
                Int64 UserPasswordExpiryTimeComputed = 0;
                PropertyValueCollection ADGroupType = null;

                for (int i = 0; i < TblData.collist.Length; i++)
                {
                    TableColDef coldef = TblData.collist[i];
                    switch(coldef.OPtype)
                    {
                        case "Adprop":
                            if (coldef.ADpropName == "useraccountcontrol" && Item_UAC_flags != null)
                            {
                                row[i] = Item_UAC_flags.ADobj_flags;
                                break;
                            }
                            PropertyValueCollection prop = Util.GetADproperty(item, coldef.ADpropName);
                            if (prop != null)
                                row[i] = prop.Value;
                            break;

                        case "UAC":
                            if (Item_UAC_flags == null)
                            {   // Get UAC flags only once per AD object.
                                Item_UAC_flags = new UACflags(Util.Get_userAccountControl(item, out UserPasswordExpiryTimeComputed));
                            }
                            row[i] = Item_UAC_flags.GetFlag(coldef.ADpropName);
                            break;

                        case "ObjClass":
                            row[i] = item.SchemaClassName;
                            break;

                        case "ObjGuid":
                            row[i] = item.Guid;
                            break;

                        case "filetime":
                            Int64 time = 0;
                            if (coldef.ADpropName == "msDS-UserPasswordExpiryTimeComputed")
                                time = UserPasswordExpiryTimeComputed;
                            else
                                time = Util.GetFileTime(searchResult, coldef.ADpropName);
                            if(time > 0 && time != 0x7fffffffffffffff && time != -1)
                            {
                                //row[i] = DateTime.FromFileTimeUtc(time);
                                row[i] = DateTime.FromFileTime(time);       // Convert UTC to local time.
                            }
                            break;

                        case "SID":
                            row[i] = Util.GetSID(item, coldef.ADpropName);
                            break;

                        case "GrpCat":
                            if (ADGroupType == null)
                                ADGroupType = Util.GetADproperty(item, "grouptype");
                            row[i] = Util.GetGroupCategory(ADGroupType);
                            break;

                        case "GrpScope":
                            if (ADGroupType == null)
                                ADGroupType = Util.GetADproperty(item, "grouptype");
                            row[i] = Util.GetGroupScope(ADGroupType);
                            break;
                    }
                }
                tbl.Rows.Add(row);

                if (TblData.IsUser)
                {
                    // Set UserMustChangePasswordAtNextLogon column value (for user objects).
                    bool IsUsrChgPwd = false;
                    if (row.IsNull("PasswordLastSet")
                        && !row.IsNull("PasswordNeverExpires")
                        && !row.IsNull("PasswordNotRequired")
                        && !(bool)row["PasswordNeverExpires"]
                        && !(bool)row["PasswordNotRequired"])
                    {
                        IsUsrChgPwd = true;
                    }
                    row["UserMustChangePasswordAtNextLogon"] = IsUsrChgPwd;

                    // Collect user distinguishedname into dictionary, value is object GUID.
                    // This is needed later to set ManagerGUID column.
                    UserDStoGUID.Add((string)row["distinguishedname"], (Guid)row["ObjectGUID"]);
                }

                // Save group members into the Xml document.
                if (TblData.IsGroup && item.Properties.Contains("member"))
                {
                    PropertyValueCollection coll = Util.GetADproperty(item, "member");
                    string parent = (string)row["distinguishedname"];
                    Util.SaveGroupMembersToXml(doc, body, parent, coll);
                }
            }   // endof: foreach (SearchResult searchResult in results)
            // All rows have been added to the dataset.

            // set ManagerGUID column for user objects.
            if (TblData.IsUser)
            {
                foreach (DataRow rowUsr in tbl.Rows)
                {
                    object manager = rowUsr["Manager"]; // distinguishedname of Manager.
                    if (manager == DBNull.Value)
                        continue;
                    Guid ManagerGUID;
                    if (UserDStoGUID.TryGetValue((string)manager, out ManagerGUID))
                        rowUsr["ManagerGUID"] = ManagerGUID;
                }
            }

            // Return dataset to SQL server.
            ReturnDatasetToSqlServer(tbl);

            using (XmlNodeReader xnr = new XmlNodeReader(doc))
            {
                MemberList = new SqlXml(xnr);
            }
        }
        catch (System.Runtime.InteropServices.COMException)
        {
            SqlContext.Pipe.Send("COMException in clr_GetADobjects. ItemCounter = " + itemcount.ToString());
            throw;
        }
        catch (InvalidOperationException)
        {
            SqlContext.Pipe.Send("InvalidOperationException in clr_GetADobjects. ItemCounter = " + itemcount.ToString());
            throw;
        }
        catch (NotSupportedException)
        {
            SqlContext.Pipe.Send("NotSupportedException in clr_GetADobjects. ItemCounter = " + itemcount.ToString());
            throw;
        }
        catch (Exception)
        {
            SqlContext.Pipe.Send("Exception in clr_GetADobjects. ItemCounter = " + itemcount.ToString());
            throw;
        }
        finally
        {
            if (null != results)
            {
                results.Dispose();  // To prevent memory leaks, always call
                results = null;     // SearchResultCollection.Dispose() manually.
            }
        }
        //file.Close();
    }