コード例 #1
0
        /// <summary>
        /// Enlaza los datos datgridviews con su respectivo Datasources
        /// </summary>
        public void BindFlights(object sender, DoWorkEventArgs e)
        {
            var userInput = (InterJetAvailabilityUserInput)this.Session["UserInput"];

            if (userInput != null)
            {
                if (this.FlightManager.IsPointToPoint(userInput.DepartureStation, userInput.ArrivalStation))
                {
                    InterJetFlightsAvailability interJetAvailability =
                        InterJetServiceManager.GetAvailability(userInput);
                    if (interJetAvailability != null)
                    {
                        if (interJetAvailability.HasDepartureFlights)
                        {
                            this.DepartureInformationLabel.Text           = userInput.DepartureFlightInformation;
                            this.DepartureIntineraryInformationLabel.Text =
                                userInput.DepartureFlightIntineraryInformation;
                            e.Result = interJetAvailability.GetDepartureFlights();
                        }
                        else
                        {
                            e.Result = "NO SE ENCONTRARON VUELOS DISPONIBLES, POR FAVOR INTENTE EN OTRAS FECHAS.";
                            //throw new Exception("NO SE ENCONTRARON VUELOS DISPONIBLES, POR FAVOR INTENTE EN OTRAS FECHAS.");
                        }
                    }
                }
                else
                {
                    e.Result =
                        "LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n";
                    // throw new DestinationNotFoundException("LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n");
                }
            }
        }
        public decimal GetAvailableCretid()
        {
            decimal credit = 0;

            credit = InterJetServiceManager.SeeNumber();
            return(credit);
        }
コード例 #3
0
        /// <summary>
        /// Enlaza los datos datgridviews con su respectivo Datasources
        /// </summary>
        public List <InterJetFlight> BindFlights()
        {
            var userInput = (InterJetAvailabilityUserInput)Session["UserInput"];

            if (userInput != null)
            {
                if (FlightManager.IsPointToPoint(userInput.DepartureStation, userInput.ArrivalStation))
                {
                    InterJetFlightsAvailability interJetAvailability =
                        InterJetServiceManager.GetAvailability(userInput);
                    if (interJetAvailability != null)
                    {
                        if (interJetAvailability.HasDepartureFlights)
                        {
                            this.DepartureInformationLabel.Text           = userInput.DepartureFlightInformation;
                            this.DepartureIntineraryInformationLabel.Text =
                                userInput.DepartureFlightIntineraryInformation;
                            return(interJetAvailability.GetDepartureFlights());
                        }
                        else
                        {
                            return(new List <InterJetFlight>());
                        }
                    }
                }
                else
                {
                    //e.Result =
                    //    "LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n";
                    // throw new DestinationNotFoundException("LA RUTA INGRESADA NO CORRESPONDE A UN VUELO PUNTO A PUNTO; SOLICITE DISPONIBILIDAD VÍA LAS OPCIONES:\n\n");
                }
            }
            return(new List <InterJetFlight>());
        }
コード例 #4
0
        private void test()
        {
            var userInput       = (InterJetAvailabilityUserInput)this.Session["UserInput"];
            var selectedFlights = (InterJetSelectedFlights)this.Session["SelectedFlights"];

            InterJetServiceManager.GetItineraryPrice(userInput, selectedFlights);
        }
コード例 #5
0
        /// <summary>
        /// Handles the DoWork event of the PricingWorker control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param>
        void PricingWorkerDoWork(object sender, DoWorkEventArgs e)
        {
            var interJetServiceManager = new InterJetServiceManager();

            e.Result = interJetServiceManager.GetItineraryPriceTest(UserInput, SelectedFligths);
            //TODO: Cambiar despues de pruebas.
            //e.Result = interJetServiceManager.GetItineraryPrice(UserInput, SelectedFligths);
        }
コード例 #6
0
        public List <Entities.IFlight> Call()
        {
            var serviceManager = new InterJetServiceManager();

            var flights = serviceManager.GetAvailability(Request).Cast <IFlight>().ToList();

            return(flights);
        }
コード例 #7
0
        private List <AssignSeatsResponse> AssingSeat()
        {
            List <AssignSeatsResponse> responseList = new List <AssignSeatsResponse>();
            AssignSeatsResponse        response     = null;
            var ticket = (InterJetSelectedFlights)this.Session["SelectedFlights"];

            passenger = null;
            List <string> id  = new List <string>();
            string        pax = string.Empty;
            int           b   = 0;

            for (int a = 0; a < frmAssignSeats.listInterjetSeatsReturn.Count; a++)
            {
                passenger = new List <string>();
                bool insert = true;
                foreach (string passId in id)
                {
                    if (frmAssignSeats.listInterjetSeatsReturn[a].Id == passId)
                    {
                        insert = false;
                        break;
                    }
                    else
                    {
                        insert = true;
                    }
                }

                if (insert)
                {
                    foreach (interjetSeats pass in frmAssignSeats.listInterjetSeatsReturn)
                    {
                        if (frmAssignSeats.listInterjetSeatsReturn[a].Id == pass.Id)
                        {
                            int z = Convert.ToInt32(pass.Id) - 1;
                            pax = Convert.ToString(z) + "|" + pass.Seat + "|" + pass.Segment;
                            passenger.Add(pax);
                            id.Add(pass.Id);
                        }
                    }
                }
                if (passenger.Count > 0)
                {
                    response = InterJetServiceManager.AssingSeat(ticket.GetFlights(), passenger);
                    responseList.Add(response);
                }
            }
            frmAssignSeats.listInterjetSeatsReturn.Clear();
            return(responseList);
        }
コード例 #8
0
        /// <summary>
        /// Handler del evento de seleccion de un vuelo.s
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnSelectedDepartureFlight(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (this.SelectionIsValid(e))
                {
                    this.UncheckCheckBoxColumns(this.DepartureFligthsDataGridView);
                    var dataGridViewCheckBoxCell =
                        this.DepartureFligthsDataGridView[
                            InterJetAvailabilityOfFlightsHandler.CHECKBOX_COLUMN, e.RowIndex] as
                        DataGridViewCheckBoxCell;
                    if (dataGridViewCheckBoxCell != null)
                    {
                        dataGridViewCheckBoxCell.Value = true;
                    }

                    this.FareTextBox.Rtf            = InterJetServiceManager.GetFareRule(this.GetInterJetSelection());
                    this.FareRuleTitleLabel.Visible = true;
                    this.FareTextBox.SelectionFont  = new System.Drawing.Font("Microsoft Sans Serif", 8.25F,
                                                                              System.Drawing.FontStyle.Strikeout,
                                                                              System.Drawing.GraphicsUnit.Point,
                                                                              ((byte)(0)));

                    if (this.Session["SelectedFlights"] != null)
                    {
                        // si existe bajar los vuelos previamente seleccionados
                        var selectedFlights = (InterJetSelectedFlights)this.Session["SelectedFlights"];
                        this.SegmentSelledCount.Text = (selectedFlights.GetFlights().Count + 1).ToString(CultureInfo.InvariantCulture);
                    }
                    else
                    {
                        this.SegmentSelledCount.Text = "1";
                    }
                }
            }
            catch (Exception exception)
            {
                if (exception is TimeoutException)
                {
                    this.RecoverFromError();
                }
            }
        }
コード例 #9
0
 private void Plane()
 {
     errorPlane    = false;
     currentTicket = null;
     ticket        = null;
     current       = null;
     currentTicket = (MyCTS.Entities.InterJetTicket) this.Session["CurrentTicket"];
     //this.InterJetServiceManager.MakeReservation(currentTicket);
     ticket = (InterJetSelectedFlights)this.Session["SelectedFlights"];
     //current = this.InterJetServiceManager.GetBooking(currentTicket.RecordLocator);
     response = null;
     response = InterJetServiceManager.GetAvailabilitySeat(ticket.GetFlights());
     if (response != null)
     {
         CostumerAccountInterJet.notSeatAssing = false;
     }
     else
     {
         CostumerAccountInterJet.notSeatAssing = true;
     }
 }