コード例 #1
0
        public int LoadItinerary()
        {
            try
            {
                Travelbytes.WebService.Itinerary.Decoder Decoder = null;
                int Retry = 0;

                Decoder = new Travelbytes.WebService.Itinerary.Decoder();
                Decoder.Reload = false;
                Decoder.Print = false;
                Decoder.TempLocation = Server.MapPath("Temp");
                Decoder.Style = Server.MapPath("styles/");
                Decoder.Config = Server.MapPath("");
                Decoder.Templates = Server.MapPath("Templates/");
                Decoder.AddressDSN = GetAddressDataSourceMySQL();
                Decoder.PassedCountry = m_GDS;
                Credentials Cred = GetUser("Galileo");
                Decoder.User = Cred.User;
                Decoder.PSW = Cred.PSW;
                Decoder.HAP = Cred.HAP;
                Decoder.URL = Cred.URL;
                Decoder.ItineraryURL = Cred.ItineraryURL;
                Decoder.Offset = GetOffSet();

                Tranx Tran = new Tranx();
                Tran.ItineraryRetrieve(m_RLOC, m_Surname, "");

                string str = Decoder.GetItinerary(m_RLOC);

                Session["SMSSummary"] = Decoder.SMSSummary;

                if ((base.HasEticket = Decoder.HasTickets) == true)
                {
                    Session["Etickets"] = Decoder.TicketNumbers;
                }

                if (str.Length == 0)
                {
                    if (Decoder.LastErrorNumber != 0)
                    {
                        //Response.Redirect("Error.aspx?E=" + Decoder.LastErrorNumber);
                        m_error_number = Decoder.LastErrorNumber;
                        return 1;
                    }
                    else if (str.IndexOf("Invalid reference") != -1)
                        //Response.Redirect("Error.aspx?E=7");
                        return 2;
                    else
                        //Response.Redirect("Error.aspx?E=0&M=" + Server.UrlEncode(Decoder.LastError));
                        m_error = Server.UrlEncode(Decoder.LastError);
                    return 3;
                }

                // check the surname matches the one provided
                if (Decoder.Surname.ToUpper().IndexOf(m_Surname.ToUpper()) == -1)
                {

                    if (Session["RetryCount"] == null)
                        Retry = 0;
                    else
                        Retry = ((int)Session["RetryCount"]) + 1;

                    if (Retry >= GetRetryCount())
                    {
                        Session["RetryCount"] = GetRetryCount();
                        m_RLOC = "";
                        //Response.Redirect("error.aspx?E=5");
                        //Response.End();
                        return 4;
                    }
                    Session["RetryCount"] = Retry;
                    // failed to match
                    //Response.Redirect("Error.aspx?E=2");
                    //Response.End();
                    return 5;

                }

                Session["RetryCount"] = 0;
                GetReference = m_RLOC;
                GetName = Decoder.Pax;
                Session["RLOC"] = m_RLOC;
                Session["Name"] = Decoder.PaxName;
                Session["Decoder"] = Decoder;
                return 0;
            }
            catch { }

            return 0;
        }
コード例 #2
0
        void ProcessEtickets()
        {
            Travelbytes.WebService.Itinerary.Decoder Decoder = new Travelbytes.WebService.Itinerary.Decoder();
            Decoder.Reload = false;
            Decoder.Config = Server.MapPath("");
            Decoder.Templates = Server.MapPath("Templates/");
            Decoder.AddressDSN = GetAddressDataSourceMySQL();
            Credentials Cred = GetUser("Galileo");
            Decoder.User = Cred.User;
            Decoder.PSW = Cred.PSW;
            Decoder.HAP = Cred.HAP;
            Decoder.URL = Cred.URL;
            Decoder.RLOC = m_RLOC;
            Decoder.Offset = GetOffSet();
            String GetTick = "";
            if (Request.QueryString["ET"] != null)
            {
                GetTick = Request.QueryString["ET"].ToString();
            }

            Decoder.ItineraryURL = Cred.ItineraryURL;
            int i = 0;
            string Location = Server.MapPath("temp");
            if (!Location.EndsWith(@"\")) Location += @"\";

            if (m_Etickets.Count > 1)
            {
                ArrayList MyTickets = Decoder.FormatMultipleEticketRecovery(m_Etickets, Location, Session.SessionID, m_Surname);

                if (MyTickets == null || MyTickets.Count == 0)
                {
                    //DropDownList1.Visible = false;  //Need to Work
                    //Submit1.Visible = false;
                    //etLabel.Visible = false;
                    //outError.InnerHtml = msg;
                    return;
                }
                else if (MyTickets.Count == 1)
                {
                    // go direct
                    Travelbytes.WebService.Itinerary.LocalEticketRetrieval str =
                        (Travelbytes.WebService.Itinerary.LocalEticketRetrieval)MyTickets[0];
                    Travelbytes.WebService.Itinerary.LocalEticketRetrieval mytkt = (Travelbytes.WebService.Itinerary.LocalEticketRetrieval)MyTickets[0];
                    Tranx Trans1 = new Tranx();
                    Trans1.EticketRetrieve(this.m_RLOC, m_Surname, mytkt.Eticket.AirV + " " + mytkt.Eticket.FirstTkNum);

                    Response.Redirect("temp/" + str.FileName, true);
                }

                int TKTCount = 0;
                foreach (Travelbytes.WebService.Itinerary.LocalEticketRetrieval str in MyTickets)
                {
                    if (GetTick.Length > 10)
                    {
                        if (str.FileName.IndexOf(GetTick) != -1)
                        {
                            Response.Redirect("temp/" + str.FileName, true);
                        }
                    }
                    {
                    }
                    TKTCount++;
                    if (str.Eticket != null && str.Status.Length == 0)
                    {
                        //ListItem item = new ListItem(str.Eticket.AirV + " " + str.Eticket.FirstTkNum, "temp/" + str.FileName);
                        //DropDownList1.Items.Add(item);
                    }
                    else
                    {
                        //ListItem item = new ListItem(string.Format("Ticket {0}", TKTCount), "temp/" + str.FileName);
                        //DropDownList1.Items.Add(item);
                    }
                }
            }
            else
            {

                // for a single eticket
                foreach (Travelbytes.ClassMap.ETicketNum T in m_Etickets)
                {

                    string Name = Session.SessionID + i.ToString() + ".xml";
                    if (Decoder.GetTicket(T.AirV + T.FirstTkNum, Name, Server.MapPath("temp")))
                    {
                        this.m_TicketNumber = T.AirV + T.FirstTkNum;
                        m_URLS.Add("temp/" + Name);
                    }
                }

                //Decoder.EndSession();

                if (m_URLS.Count == 1)
                {
                    Tranx Trans1 = new Tranx();
                    Trans1.EticketRetrieve(this.m_RLOC, m_Surname, m_TicketNumber);
                    Response.Redirect(m_URLS[0].ToString(), true);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// ItineraryView
        /// </summary>
        /// <returns></returns>
        public ActionResult ItineraryView()
        {
            ViewBag.TabDisplay = 1;
            ViewBag.theGoClick = 1;
            Session["theGoClick"] = 1;
            string TemplatesPath = Server.MapPath(@"\Content\Templates\").Replace("\\", "/");
            string CSSPath = Server.MapPath(@"\Content\static\css\").Replace("\\", "/");
            string TempPath = Server.MapPath(@"\Temp\").Replace("\\", "/");

            string strCompany = "";
            if (Request.QueryString["R"] != null)
            {
                Session["RLOC"] = Request.QueryString["R"];
            }
            if (Request.QueryString["S"] != null)
            {
                Session["Surname"] = Request.QueryString["S"];
            }
            if (Request.QueryString["G"] != null)
            {
                Session["GDS"] = Request.QueryString["G"];
            }

            //Decoder-----------------------

            int Retry = 0;
            if (Session["RetryCount"] != null)
            {
                Retry = ((int)Session["RetryCount"]);

                if (Retry >= GetRetryCount())
                {
                    Session["RetryCount"] = GetRetryCount();
                    return RedirectToAction("Message", "MessageDisplay", new { E = 5 });
                    //Response.Redirect("error.aspx?E=5");
                    //Response.End();
                }
            }
            //Decoder--------------------------

            bPrint = false;
            if (Request.QueryString["L"] != null)
            {
                bPrint = true;
            }
            ViewBag.bPrint = bPrint;

            //Decoder-----------------------------------------------------------------------------------------------------
            string str = "";
            Travelbytes.WebService.Itinerary.Decoder Decoder = null;

            if (Request.QueryString["L"] != null)
            {
                if (Request.QueryString["L"] == "R" && Session["Decoder"] != null)
                {
                    Decoder = (Travelbytes.WebService.Itinerary.Decoder)Session["Decoder"];
                    Decoder.Reload = true;
                    Decoder.TempLocation = TempPath;//Server.MapPath("Temp");
                    Decoder.Config = Server.MapPath("");
                    Decoder.PassedCountry = m_GDS;
                    Decoder.Offset = GetOffSet();
                    Decoder.Style = CSSPath; //Server.MapPath("styles/");

                    str = Decoder.GetItinerary(m_RLOC);
                    ViewBag.pax = Decoder.Pax;
                    //Pax.InnerHtml = Decoder.Pax;
                    //RLOC.InnerText = Decoder.RLOC;
                    //Agent.InnerText = Decoder.Agent.Replace("(", "");
                    //ClientAddress.InnerHtml = Decoder.ClientAddress;
                    //AgencyAddress.InnerHtml = Decoder.AgencyAddress;
                    ViewBag.RLOC = Decoder.RLOC;
                    ViewBag.Agent = Decoder.Agent.Replace("(", "");
                    ViewBag.Agent = ViewBag.Agent.Replace(")", "");
                    ViewBag.ClientAddress = Decoder.ClientAddress;
                    ViewBag.AgencyAddress = Decoder.AgencyAddress;

                    //---------------------------------------------------------------------------------------------------------------------------------------//

                    if (Decoder.m_bkg != null)
                    {
                        foreach (Travelbytes.Common.REMARKITEM itm in Decoder.m_bkg.Remarks)
                        {
                            if (itm.m_REMARKITEM.Trim().ToLower().IndexOf("company") > 0)
                            {
                                string Remarks2 = itm.m_REMARKITEM.Trim();
                                string[] GetCompany = Remarks2.Split(':');
                                if (GetCompany.Length > 0)
                                {
                                    if (GetCompany[0].Trim().ToLower().IndexOf("company") > 0)
                                    {
                                        if (GetCompany[0].Trim().ToLower() == "qi 8 company" || GetCompany[0].Trim().ToLower() == "qi 9 company")
                                        {
                                            strCompany = GetCompany[1].Trim();
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    string strUpdatedHTMLString = "";
                    if (strCompany == CreditSuissesgCompany)
                    {
                        strUpdatedHTMLString = GetUpdatedHTMLString(Decoder.m_Response, str);
                        strUpdatedHTMLString = GetComplianceDataAttached(strUpdatedHTMLString);
                        strUpdatedHTMLString = ReplaceLinks(strUpdatedHTMLString);
                    }
                    else
                    {
                        strUpdatedHTMLString = str;
                        strUpdatedHTMLString = ReplaceLinks(strUpdatedHTMLString);
                    }

                    if (!string.IsNullOrEmpty(strUpdatedHTMLString))
                    {
                        //results.InnerHtml = strUpdatedHTMLString;
                        ViewBag.results = strUpdatedHTMLString;
                    }
                    else
                    {
                        //results.InnerHtml = str;
                        ViewBag.results = strUpdatedHTMLString;
                    }
                    //---------------------------------------------------------------------------------------------------------------------------------------//

                    return View();
                }
                if (Request.QueryString["L"] == "P" && Session["Decoder"] != null)
                {
                    try
                    {
                        bPrint = true;
                        ViewBag.bPrint = bPrint;
                        // requested print Itin
                        if (Session["Decoder"] == null)
                        {
                            //results.InnerHtml = "Failed to retrieve booking. No previous Itinerary retrieved";
                            ViewBag.results = "Failed to retrieve booking. No previous Itinerary retrieved";
                            return View();
                        }

                        Decoder = (Travelbytes.WebService.Itinerary.Decoder)Session["Decoder"];
                        Decoder.Reload = true;
                        Decoder.Print = bPrint;
                        Decoder.Config = Server.MapPath("");
                        Decoder.PassedCountry = m_GDS;
                        Decoder.TempLocation = TempPath; //Server.MapPath("Temp");
                        Decoder.Offset = GetOffSet();
                        Decoder.Style = CSSPath;//Server.MapPath("styles/");

                        str = Decoder.GetItinerary(m_RLOC);
                        ViewBag.pax = Decoder.Pax;
                        //Pax.InnerHtml = Decoder.Pax;
                        //RLOC.InnerText = Decoder.RLOC;
                        //Agent.InnerText = Decoder.Agent.Replace("(", "");
                        //ClientAddress.InnerHtml = Decoder.ClientAddress;
                        //AgencyAddress.InnerHtml = Decoder.AgencyAddress;
                        ViewBag.RLOC = Decoder.RLOC;
                        ViewBag.Agent = Decoder.Agent.Replace("(", "");
                        ViewBag.Agent = ViewBag.Agent.Replace(")", "");
                        ViewBag.ClientAddress = Decoder.ClientAddress;
                        ViewBag.AgencyAddress = Decoder.AgencyAddress;
                        //Pax.InnerHtml = Decoder.Pax;
                        //RLOC.InnerText = Decoder.RLOC;
                        //Agent.InnerText = Decoder.Agent;
                        //ClientAddress.InnerHtml = Decoder.ClientAddress;
                        //AgencyAddress.InnerHtml = Decoder.AgencyAddress;
                        //results.InnerHtml = Decoder.Itinerary;
                        //results.InnerHtml = str;
                        //---------------------------------------------------------------------------------------------------------------------------------------//
                        if (Decoder.m_bkg != null)
                        {
                            foreach (Travelbytes.Common.REMARKITEM itm in Decoder.m_bkg.Remarks)
                            {
                                if (itm.m_REMARKITEM.Trim().ToLower().IndexOf("company") > 0)
                                {
                                    string Remarks2 = itm.m_REMARKITEM.Trim();
                                    string[] GetCompany = Remarks2.Split(':');
                                    if (GetCompany.Length > 0)
                                    {
                                        if (GetCompany[0].Trim().ToLower().IndexOf("company") > 0)
                                        {
                                            if (GetCompany[0].Trim().ToLower() == "qi 8 company" || GetCompany[0].Trim().ToLower() == "qi 9 company")
                                            {
                                                strCompany = GetCompany[1].Trim();
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        string strUpdatedHTMLSession = "";
                        if (strCompany == CreditSuissesgCompany)
                        {
                            strUpdatedHTMLSession = GetUpdatedHTMLString(Decoder.m_Response, str);
                            strUpdatedHTMLSession = GetComplianceDataAttached(strUpdatedHTMLSession);
                            strUpdatedHTMLSession = ReplaceLinks(strUpdatedHTMLSession);
                        }
                        else
                        {
                            strUpdatedHTMLSession = str;
                            strUpdatedHTMLSession = ReplaceLinks(strUpdatedHTMLSession);
                        }

                        if (!string.IsNullOrEmpty(strUpdatedHTMLSession))
                        {
                            // results.InnerHtml = strUpdatedHTMLSession;
                            ViewBag.results = strUpdatedHTMLSession;
                        }
                        else
                        {
                            //results.InnerHtml = str;
                            ViewBag.results = str;
                        }
                        //---------------------------------------------------------------------------------------------------------------------------------------//

                        //PrintLayer.Visible = true;
                    }
                    catch (Exception p)
                    {
                        //results.InnerHtml = "Failed to retrieve booking. Error is<br>" + p.ToString() +
                        //    "<br>" + p.StackTrace;
                        ViewBag.results = "Failed to retrieve booking. Error is<br>" + p.ToString() +
                           "<br>" + p.StackTrace;
                    }
                    return View();
                }

            }
            //Decoder-----------------------------------------------------------------------------------------------------

            LoadSessionVars();
            GetQueryVars();

            //--First Find from new Itinerary-------------------------

            ItineraryDataBAL objItineraryDataBAL = new ItineraryDataBAL();
            List<XmlBookingModel> lstQiLiveItineraryData = objItineraryDataBAL.SearchItineraryDataBySurnameAndRLOC(m_Surname, m_RLOC);
            if (lstQiLiveItineraryData != null && lstQiLiveItineraryData.Count > 0)
            {
                Session["QiLiveItineraryData"] = lstQiLiveItineraryData;
                return RedirectToAction("QiLiveItineraryView", "QiLiveItinerary", new { R = m_RLOC, S = m_Surname });
            }
            //else
            //{
            //    Session["QiLiveItineraryData"] = null;
            //    return RedirectToAction("QiLiveItineraryView", "QiLiveItinerary", new { R = m_RLOC, S = m_Surname });
            //}

            //--If Not Found in new Itinerary then search in old system-------------------------

            Session["QiLiveItineraryData"] = null;
            if (CheckForStorage())
            {
                if (!AllowLiveRetrieve)
                {
                    // decrypt and load redirect out
                    if (m_FileName.Length == 0)
                        return RedirectToAction("Message", "MessageDisplay", new { E = 14 }); //Response.Redirect("Error.aspx?E=14");

                    int rValue = GetTransaction(m_FileName);
                    if (rValue == 0)
                    {
                        // only get here if there was an error
                        return RedirectToAction("Message", "MessageDisplay", new { E = 14 });
                    }
                    else if (rValue == 1)
                    {
                        if (bPrint == true)
                        {
                            return RedirectToAction("Itin", "Itinerary", new { R = "ITIN", FN = m_FormName, L = "P" }); //Response.Redirect("Itin.aspx?R=ITIN&FN=" + m_FormName, true);
                        }
                        else
                        {
                            return RedirectToAction("Itin", "Itinerary", new { R = "ITIN", FN = m_FormName }); //Response.Redirect("Itin.aspx?R=ITIN&FN=" + m_FormName, true);
                        }

                    }
                    else if (rValue == 2)
                    {
                        if (bPrint == true)
                        {
                            return RedirectToAction("Itin", "Itinerary", new { R = "ITIN", L = "P" }); //Response.Redirect("Itin.aspx?R=ITIN", true);
                        }
                        else
                        {
                            return RedirectToAction("Itin", "Itinerary", new { R = "ITIN" }); //Response.Redirect("Itin.aspx?R=ITIN", true);

                        }
                    }
                    else if (rValue == 3)
                    {

                    }
                }
            }
            else
            {
                string Country = "";
                if (Session["Country"] != null)
                    Country = Session["Country"].ToString();

                string CountryList = GetLiveCountryList();

                if ((Session["Country"] == null || GetLiveCountryList().IndexOf(Country) == -1))
                {
                    // Goto error
                    return RedirectToAction("Message", "MessageDisplay", new { E = 14 });
                }
            }
            //Decoder-----------------------------------------------------------------------------------------------------------------------------

            if (m_RLOC == null || m_RLOC.Length == 0)
            {
                return RedirectToAction("Message", "MessageDisplay", new { E = 1 });
                //Response.Redirect("Error.aspx?E=1");
                //return view;
            }

            if (Session["Decoder"] != null)
            {
                Decoder = (Travelbytes.WebService.Itinerary.Decoder)Session["Decoder"];
                Decoder.Reload = true;
                Decoder.TempLocation = TempPath; //Server.MapPath("Temp");
                Decoder.Config = Server.MapPath("");
                Decoder.PassedCountry = m_GDS;
                Decoder.Offset = GetOffSet();
                Decoder.Style = CSSPath; //Server.MapPath("styles/");

                str = Decoder.GetItinerary(m_RLOC);
                str = str.Replace("Download to calendar", "");
                ViewBag.RLOC = Decoder.RLOC;
                ViewBag.Agent = Decoder.Agent.Replace("(", "");
                ViewBag.Agent = ViewBag.Agent.Replace(")", "");
                ViewBag.ClientAddress = Decoder.ClientAddress;
                ViewBag.AgencyAddress = Decoder.AgencyAddress;
                //Pax.InnerHtml = Decoder.Pax;
                //RLOC.InnerText = Decoder.RLOC;
                //Agent.InnerText = Decoder.Agent.Replace("(", "");
                //Agent.InnerText = Agent.InnerText.Replace(")", "");
                //ClientAddress.InnerHtml = Decoder.ClientAddress;
                //AgencyAddress.InnerHtml = Decoder.AgencyAddress;

                //---------------------------------------------------------------------------------------------------------------------------------------//
                if (Decoder.m_bkg != null)
                {
                    foreach (Travelbytes.Common.REMARKITEM itm in Decoder.m_bkg.Remarks)
                    {
                        if (itm.m_REMARKITEM.Trim().ToLower().IndexOf("company") > 0)
                        {
                            string Remarks2 = itm.m_REMARKITEM.Trim();
                            string[] GetCompany = Remarks2.Split(':');
                            if (GetCompany.Length > 0)
                            {
                                if (GetCompany[0].Trim().ToLower().IndexOf("company") > 0)
                                {
                                    if (GetCompany[0].Trim().ToLower() == "qi 8 company" || GetCompany[0].Trim().ToLower() == "qi 9 company")
                                    {
                                        strCompany = GetCompany[1].Trim();
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                string strUpdatedHTMLFromSession = "";
                if (strCompany == CreditSuissesgCompany)
                {
                    strUpdatedHTMLFromSession = GetUpdatedHTMLString(Decoder.m_Response, str);
                    strUpdatedHTMLFromSession = GetComplianceDataAttached(strUpdatedHTMLFromSession);
                    strUpdatedHTMLFromSession = ReplaceLinks(strUpdatedHTMLFromSession);
                }
                else
                {
                    strUpdatedHTMLFromSession = str;
                    strUpdatedHTMLFromSession = ReplaceLinks(strUpdatedHTMLFromSession);
                }

                if (!string.IsNullOrEmpty(strUpdatedHTMLFromSession))
                {
                    //results.InnerHtml = strUpdatedHTMLFromSession;
                    ViewBag.results = strUpdatedHTMLFromSession;
                }
                else
                {
                    //results.InnerHtml = str;
                    ViewBag.results = str;
                }
                //---------------------------------------------------------------------------------------------------------------------------------------//

                //results.InnerHtml = Decoder.Itinerary;
                //results.InnerHtml = str;
                return View();
            }

            logger.Debug("Live Retrievel Start - Debug Point 1");
            Decoder = new Travelbytes.WebService.Itinerary.Decoder();

            Decoder.Reload = false;
            Decoder.Print = bPrint;
            Decoder.TempLocation = TempPath; //Server.MapPath("Temp");
            Decoder.Config = Server.MapPath("");
            Decoder.Templates = TemplatesPath;
            Decoder.AddressDSN = GetAddressDataSourceMySQL();
            Decoder.PassedCountry = m_GDS;
            Decoder.Style = CSSPath; //Server.MapPath("styles/");

            Credentials Cred = GetUser("Galileo");
            Decoder.User = Cred.User;
            Decoder.PSW = Cred.PSW;
            Decoder.HAP = Cred.HAP;
            Decoder.URL = Cred.URL;
            Decoder.ItineraryURL = Cred.ItineraryURL;
            Decoder.Offset = GetOffSet();

            Tranx Tran = new Tranx();
            Tran.ItineraryRetrieve(m_RLOC, m_Surname, "");

            logger.Debug("Debug Point 2");

            //Decoder.RLOC = m_RLOC;
            str = "";
            str = Decoder.GetItinerary(m_RLOC);

            logger.Debug("Debug Point 3");

            if (str.Length == 0)
            {
                logger.Debug("Debug Point 4 : " + Decoder.LastError);
                if (Decoder.LastErrorNumber != 0)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 34 });
                    //Response.Redirect("Error.aspx?E=" + Decoder.LastErrorNumber);
                }
                else if (str.IndexOf("Invalid reference") != -1)
                    return RedirectToAction("Message", "MessageDisplay", new { E = 7 });
                //Response.Redirect("Error.aspx?E=7");
                else
                {
                    if (Decoder.LastError.Length == 0)
                        return RedirectToAction("Message", "MessageDisplay", new { E = 14 });
                    //Response.Redirect("Error.aspx?E=14");
                    else
                        return RedirectToAction("Message", "MessageDisplay", new { E = 35 });
                    //return RedirectToAction("Message", "MessageDisplay", new { E = 22 });
                    //Response.Redirect("Error.aspx?E=0&M=" + Server.UrlEncode(Decoder.LastError));
                }
            }

            logger.Debug("Debug Point 5");

            str = str.Replace("Download to calendar", "");
            Session["SMSSummary"] = Decoder.SMSSummary;
            if ((base.HasEticket = Decoder.HasTickets) == true)
            {
                Session["Etickets"] = Decoder.TicketNumbers;
            }

            // check the surname matches the one provided
            if (m_Surname.Length == 0 || Decoder.Surname.ToUpper().IndexOf(m_Surname.ToUpper()) == -1)
            {

                if (Session["RetryCount"] == null)
                    Retry = 0;
                else
                    Retry = ((int)Session["RetryCount"]) + 1;

                if (Retry >= GetRetryCount())
                {
                    Session["RetryCount"] = GetRetryCount();
                    m_RLOC = "";
                    return RedirectToAction("Message", "MessageDisplay", new { E = 5 });
                    //Response.Redirect("error.aspx?E=5");
                    //Response.End();
                }
                Session["RetryCount"] = Retry;
                // failed to match
                return RedirectToAction("Message", "MessageDisplay", new { E = 2 });
                //Response.Redirect("Error.aspx?E=2");
                //Response.End();
            }

            Session["RetryCount"] = 0;
            GetReference = m_RLOC;
            GetName = Decoder.Pax;

            Session["RLOC"] = m_RLOC;
            Session["Name"] = Decoder.PaxName;

            ViewBag.RLOC = Decoder.RLOC;
            ViewBag.Agent = Decoder.Agent;
            ViewBag.ClientAddress = Decoder.ClientAddress;
            ViewBag.AgencyAddress = Decoder.AgencyAddress;
            //ClientAddress.InnerHtml = Decoder.ClientAddress;
            //AgencyAddress.InnerHtml = Decoder.AgencyAddress;
            //Pax.InnerHtml = Decoder.Pax;
            //RLOC.InnerText = Decoder.RLOC;
            //Agent.InnerText = Decoder.Agent;

            //---------------------------------------------------------------------------------------------------------------------------------------//

            if (Decoder.m_bkg != null)
            {
                foreach (Travelbytes.Common.REMARKITEM itm in Decoder.m_bkg.Remarks)
                {
                    if (itm.m_REMARKITEM.ToLower().IndexOf("company") > 0)
                    {
                        string Remarks2 = itm.m_REMARKITEM;
                        string[] GetCompany = Remarks2.Split(':');
                        if (GetCompany.Length > 0)
                        {
                            if (GetCompany[0].ToLower().IndexOf("company") > 0)
                            {
                                if (GetCompany[0].Trim().ToLower() == "qi 8 company" || GetCompany[0].Trim().ToLower() == "qi 9 company")
                                {
                                    strCompany = GetCompany[1].Trim();
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            string strUpdatedHTML = "";
            if (strCompany == CreditSuissesgCompany)
            {
                strUpdatedHTML = GetUpdatedHTMLString(Decoder.m_Response, str);
                strUpdatedHTML = GetComplianceDataAttached(strUpdatedHTML);
                strUpdatedHTML = ReplaceLinks(strUpdatedHTML);
            }
            else
            {
                strUpdatedHTML = str;
                strUpdatedHTML = ReplaceLinks(strUpdatedHTML);
            }
            //---------------------------------------------------------------------------------------------------------------------------------------//

            if (!string.IsNullOrEmpty(strUpdatedHTML))
            {
                //results.InnerHtml = strUpdatedHTML;
                ViewBag.results = strUpdatedHTML;
            }
            else
            {
                //results.InnerHtml = str;
                ViewBag.results = str;
            }

            //results.InnerHtml = str;
            Session["Decoder"] = Decoder;

            //Decoder-----------------------------------------------------------------------------------------------------------------------------

            return View();
        }
コード例 #4
0
        public int LoadItinerary()
        {
            try
            {
                Travelbytes.WebService.Itinerary.Decoder Decoder = null;
                int Retry = 0;

                Decoder               = new Travelbytes.WebService.Itinerary.Decoder();
                Decoder.Reload        = false;
                Decoder.Print         = false;
                Decoder.TempLocation  = Server.MapPath("Temp");
                Decoder.Style         = Server.MapPath("styles/");
                Decoder.Config        = Server.MapPath("");
                Decoder.Templates     = Server.MapPath("Templates/");
                Decoder.AddressDSN    = GetAddressDataSourceMySQL();
                Decoder.PassedCountry = m_GDS;
                Credentials Cred = GetUser("Galileo");
                Decoder.User         = Cred.User;
                Decoder.PSW          = Cred.PSW;
                Decoder.HAP          = Cred.HAP;
                Decoder.URL          = Cred.URL;
                Decoder.ItineraryURL = Cred.ItineraryURL;
                Decoder.Offset       = GetOffSet();

                Tranx Tran = new Tranx();
                Tran.ItineraryRetrieve(m_RLOC, m_Surname, "");

                string str = Decoder.GetItinerary(m_RLOC);

                Session["SMSSummary"] = Decoder.SMSSummary;

                if ((base.HasEticket = Decoder.HasTickets) == true)
                {
                    Session["Etickets"] = Decoder.TicketNumbers;
                }

                if (str.Length == 0)
                {
                    if (Decoder.LastErrorNumber != 0)
                    {
                        //Response.Redirect("Error.aspx?E=" + Decoder.LastErrorNumber);
                        m_error_number = Decoder.LastErrorNumber;
                        return(1);
                    }
                    else if (str.IndexOf("Invalid reference") != -1)
                    {
                        //Response.Redirect("Error.aspx?E=7");
                        return(2);
                    }
                    else
                    {
                        //Response.Redirect("Error.aspx?E=0&M=" + Server.UrlEncode(Decoder.LastError));
                        m_error = Server.UrlEncode(Decoder.LastError);
                    }
                    return(3);
                }

                // check the surname matches the one provided
                if (Decoder.Surname.ToUpper().IndexOf(m_Surname.ToUpper()) == -1)
                {
                    if (Session["RetryCount"] == null)
                    {
                        Retry = 0;
                    }
                    else
                    {
                        Retry = ((int)Session["RetryCount"]) + 1;
                    }

                    if (Retry >= GetRetryCount())
                    {
                        Session["RetryCount"] = GetRetryCount();
                        m_RLOC = "";
                        //Response.Redirect("error.aspx?E=5");
                        //Response.End();
                        return(4);
                    }
                    Session["RetryCount"] = Retry;
                    // failed to match
                    //Response.Redirect("Error.aspx?E=2");
                    //Response.End();
                    return(5);
                }

                Session["RetryCount"] = 0;
                GetReference          = m_RLOC;
                GetName            = Decoder.Pax;
                Session["RLOC"]    = m_RLOC;
                Session["Name"]    = Decoder.PaxName;
                Session["Decoder"] = Decoder;
                return(0);
            }
            catch { }

            return(0);
        }
コード例 #5
0
        void ProcessEtickets()
        {
            Travelbytes.WebService.Itinerary.Decoder Decoder = new Travelbytes.WebService.Itinerary.Decoder();
            Decoder.Reload     = false;
            Decoder.Config     = Server.MapPath("");
            Decoder.Templates  = Server.MapPath("Templates/");
            Decoder.AddressDSN = GetAddressDataSourceMySQL();
            Credentials Cred = GetUser("Galileo");

            Decoder.User   = Cred.User;
            Decoder.PSW    = Cred.PSW;
            Decoder.HAP    = Cred.HAP;
            Decoder.URL    = Cred.URL;
            Decoder.RLOC   = m_RLOC;
            Decoder.Offset = GetOffSet();
            String GetTick = "";

            if (Request.QueryString["ET"] != null)
            {
                GetTick = Request.QueryString["ET"].ToString();
            }

            Decoder.ItineraryURL = Cred.ItineraryURL;
            int    i        = 0;
            string Location = Server.MapPath("temp");

            if (!Location.EndsWith(@"\"))
            {
                Location += @"\";
            }

            if (m_Etickets.Count > 1)
            {
                ArrayList MyTickets = Decoder.FormatMultipleEticketRecovery(m_Etickets, Location, Session.SessionID, m_Surname);

                if (MyTickets == null || MyTickets.Count == 0)
                {
                    //DropDownList1.Visible = false;  //Need to Work
                    //Submit1.Visible = false;
                    //etLabel.Visible = false;
                    //outError.InnerHtml = msg;
                    return;
                }
                else if (MyTickets.Count == 1)
                {
                    // go direct
                    Travelbytes.WebService.Itinerary.LocalEticketRetrieval str =
                        (Travelbytes.WebService.Itinerary.LocalEticketRetrieval)MyTickets[0];
                    Travelbytes.WebService.Itinerary.LocalEticketRetrieval mytkt = (Travelbytes.WebService.Itinerary.LocalEticketRetrieval)MyTickets[0];
                    Tranx Trans1 = new Tranx();
                    Trans1.EticketRetrieve(this.m_RLOC, m_Surname, mytkt.Eticket.AirV + " " + mytkt.Eticket.FirstTkNum);

                    Response.Redirect("temp/" + str.FileName, true);
                }

                int TKTCount = 0;
                foreach (Travelbytes.WebService.Itinerary.LocalEticketRetrieval str in MyTickets)
                {
                    if (GetTick.Length > 10)
                    {
                        if (str.FileName.IndexOf(GetTick) != -1)
                        {
                            Response.Redirect("temp/" + str.FileName, true);
                        }
                    }
                    {
                    }
                    TKTCount++;
                    if (str.Eticket != null && str.Status.Length == 0)
                    {
                        //ListItem item = new ListItem(str.Eticket.AirV + " " + str.Eticket.FirstTkNum, "temp/" + str.FileName);
                        //DropDownList1.Items.Add(item);
                    }
                    else
                    {
                        //ListItem item = new ListItem(string.Format("Ticket {0}", TKTCount), "temp/" + str.FileName);
                        //DropDownList1.Items.Add(item);
                    }
                }
            }
            else
            {
                // for a single eticket
                foreach (Travelbytes.ClassMap.ETicketNum T in m_Etickets)
                {
                    string Name = Session.SessionID + i.ToString() + ".xml";
                    if (Decoder.GetTicket(T.AirV + T.FirstTkNum, Name, Server.MapPath("temp")))
                    {
                        this.m_TicketNumber = T.AirV + T.FirstTkNum;
                        m_URLS.Add("temp/" + Name);
                    }
                }

                //Decoder.EndSession();

                if (m_URLS.Count == 1)
                {
                    Tranx Trans1 = new Tranx();
                    Trans1.EticketRetrieve(this.m_RLOC, m_Surname, m_TicketNumber);
                    Response.Redirect(m_URLS[0].ToString(), true);
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// InvoiceView
        /// </summary>
        /// <returns></returns>
        public ActionResult InvoiceView()
        {
            ViewBag.TabDisplay    = 1;
            ViewBag.theGoClick    = 2;
            Session["theGoClick"] = 2;
            try
            {
                m_User = GetUser("Diablo").User;
                m_PSW  = GetUser("Diablo").PSW;

                XmlDocument doc = new XmlDocument();

                string Path = Server.MapPath("");

                if (!Path.EndsWith("\\"))
                {
                    Path += "\\";
                }

                doc.Load(Path + "Nlog.config");

                LogManager.Configuration = new XmlLoggingConfiguration(doc.DocumentElement, null);
                logger = LogManager.GetLogger("Travelbytes.TravelPlans");
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine("Logger initialisation failed\r\n" + e.Message);
            }


            // Put user code to initialize the page here
            LoadSessionVars();
            GetQueryVars();
            Event1 = new AutoResetEvent(false);
            Event2 = new AutoResetEvent(false);
            Event3 = new AutoResetEvent(false);
            Event4 = new AutoResetEvent(false);

            ViewBag.Adobe = false;
            //Adobe.Visible = false;

            if (m_DirectLink)
            {
                DisplayFile();
            }

            if (Request.QueryString["F"] != null)
            {
                m_FileName = Convert.ToString(Request.QueryString["F"]);
            }

            if (m_RLOC.Length == 6 &&
                m_FileName.Length > 0 &&
                m_Location.Length > 0 &&
                (m_Type == "V" || m_Type == "I")
                )
            {
                // build location string
                string Store     = "";
                string Extention = "";
                if (m_Type == "V")
                {
                    Store     = GetInvoiceStore();
                    Extention = ".pdf";
                }
                else if (m_Type == "I")
                {
                    Store     = GetItineraryStore();
                    Extention = ".doc";
                }
                if (m_Location == "NA")
                {
                    m_Location = "";
                }

                string Location = Store;

                if (!Location.EndsWith("\\"))
                {
                    Location += "\\";
                }

                if (m_Location.StartsWith(@"\\"))
                {
                    Location = m_Location;
                }
                else
                {
                    Location += m_Location;
                }

                if (!Location.EndsWith("\\"))
                {
                    Location += "\\";
                }

                Location += m_RLOC[0] +
                            "\\" + m_RLOC[1] +
                            "\\" + m_RLOC[2] +
                            "\\" + m_RLOC[3] +
                            "\\" + m_RLOC[4] +
                            "\\" + m_FileName;


                bool result = DisplayFilePDF(m_RLOC, Location, 0, Extention);
                if (result == false)
                {
                    return(RedirectToAction("Message", "MessageDisplay", new { E = 28 }));
                }


                if (m_URL.Length > 0)
                {
                    Tranx Tran = new Tranx();
                    Tran.InvoiceRetrieve(m_RLOC, m_Surname, m_FileName);
                    String output = m_URL;
                    Response.AppendHeader("Content-Disposition", "inline; filename=" + m_URL);
                    return(File(output, "application/pdf"));
                    //Response.Redirect(m_URL, true);
                }

                return(View());  //Need to work
            }

            if (m_InvoiceNumber.Length > 0)
            {
                int rValue = PullInvoice();
                if (rValue == 0)
                {
                    return(RedirectToAction("Message", "MessageDisplay", new { E = 13 }));
                }
                else if (rValue == 1)
                {
                    return(RedirectToAction("InvoiceView", "Invoice", new { T = "V", R = gRLOC, M = gLocation, F = gInfoName }));
                }
                else if (rValue == 25)
                {
                    return(RedirectToAction("Message", "MessageDisplay", new { E = 25 }));
                }
                else if (rValue == 26)
                {
                    return(RedirectToAction("Message", "MessageDisplay", new { E = 26 }));
                }
                else if (rValue == 27)
                {
                    return(RedirectToAction("Message", "MessageDisplay", new { E = 27 }));
                }
            }


            if ((m_RLOC == null || m_RLOC.Length == 0) || (m_Surname == null || m_Surname.Length == 0))
            {
                logger.Debug("Enter : debug point 5");
                return(RedirectToAction("Message", "MessageDisplay", new { E = 1 }));
                //return RedirectToAction("Index", "User", new { E = 1 });
                //Response.Redirect("Default.aspx?E=1");
            }


            bool bReturnValue = DoGo();

            if (bReturnValue == false)
            {
                return(RedirectToAction("Message", "MessageDisplay", new { E = 33 }));
            }
            logger.Debug("m_RLOC : " + m_RLOC);
            return(View());
        }
コード例 #7
0
        /// <summary>
        /// InvoiceView
        /// </summary>
        /// <returns></returns>
        public ActionResult InvoiceView()
        {
            ViewBag.TabDisplay = 1;
            ViewBag.theGoClick = 2;
            Session["theGoClick"] = 2;
            try
            {
                m_User = GetUser("Diablo").User;
                m_PSW = GetUser("Diablo").PSW;

                XmlDocument doc = new XmlDocument();

                string Path = Server.MapPath("");

                if (!Path.EndsWith("\\"))
                    Path += "\\";

                doc.Load(Path + "Nlog.config");

                LogManager.Configuration = new XmlLoggingConfiguration(doc.DocumentElement, null);
                logger = LogManager.GetLogger("Travelbytes.TravelPlans");
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine("Logger initialisation failed\r\n" + e.Message);
            }

            // Put user code to initialize the page here
            LoadSessionVars();
            GetQueryVars();
            Event1 = new AutoResetEvent(false);
            Event2 = new AutoResetEvent(false);
            Event3 = new AutoResetEvent(false);
            Event4 = new AutoResetEvent(false);

            ViewBag.Adobe = false;
            //Adobe.Visible = false;

            if (m_DirectLink)
                DisplayFile();

            if (Request.QueryString["F"] != null)
            {
                m_FileName = Convert.ToString(Request.QueryString["F"]);
            }

            if (m_RLOC.Length == 6 &&
                 m_FileName.Length > 0 &&
                 m_Location.Length > 0 &&
                 (m_Type == "V" || m_Type == "I")
                 )
            {

                // build location string
                string Store = "";
                string Extention = "";
                if (m_Type == "V")
                {
                    Store = GetInvoiceStore();
                    Extention = ".pdf";
                }
                else if (m_Type == "I")
                {
                    Store = GetItineraryStore();
                    Extention = ".doc";
                }
                if (m_Location == "NA")
                    m_Location = "";

                string Location = Store;

                if (!Location.EndsWith("\\"))
                    Location += "\\";

                if (m_Location.StartsWith(@"\\"))
                    Location = m_Location;
                else
                    Location += m_Location;

                if (!Location.EndsWith("\\"))
                    Location += "\\";

                Location += m_RLOC[0] +
                    "\\" + m_RLOC[1] +
                    "\\" + m_RLOC[2] +
                    "\\" + m_RLOC[3] +
                    "\\" + m_RLOC[4] +
                    "\\" + m_FileName;

                bool result = DisplayFilePDF(m_RLOC, Location, 0, Extention);
                if (result == false)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 28 });
                }

                if (m_URL.Length > 0)
                {
                    Tranx Tran = new Tranx();
                    Tran.InvoiceRetrieve(m_RLOC, m_Surname, m_FileName);
                    String output = m_URL;
                    Response.AppendHeader("Content-Disposition", "inline; filename=" + m_URL);
                    return File(output, "application/pdf");
                    //Response.Redirect(m_URL, true);
                }

                return View();  //Need to work
            }

            if (m_InvoiceNumber.Length > 0)
            {
                int rValue = PullInvoice();
                if (rValue == 0)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 13 });
                }
                else if (rValue == 1)
                {
                    return RedirectToAction("InvoiceView", "Invoice", new { T = "V", R = gRLOC, M = gLocation, F = gInfoName });
                }
                else if (rValue == 25)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 25 });
                }
                else if (rValue == 26)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 26 });
                }
                else if (rValue == 27)
                {
                    return RedirectToAction("Message", "MessageDisplay", new { E = 27 });
                }
            }

            if ((m_RLOC == null || m_RLOC.Length == 0) || (m_Surname == null || m_Surname.Length == 0))
            {
                logger.Debug("Enter : debug point 5");
                return RedirectToAction("Message", "MessageDisplay", new { E = 1 });
                //return RedirectToAction("Index", "User", new { E = 1 });
                //Response.Redirect("Default.aspx?E=1");
            }

            bool bReturnValue = DoGo();
            if (bReturnValue == false)
            {
                return RedirectToAction("Message", "MessageDisplay", new { E = 33 });
            }
            logger.Debug("m_RLOC : " + m_RLOC);
            return View();
        }