public override void Pay(InterJetTicket ticket) { //if (CostumerAccountInterJet.notSeatAssing) //this.InterJetServiceManager.MakeReservation(ticket); this.InterJetServiceManager.ElectronicPursePayment(ticket, this.CreditCardsFields); ticket.PaymentForm = string.Format("CCGA{0}", this.CreditCardsFields.CreditCardNumber); }
/// <summary> /// Resizes the panels. /// </summary> /// <param name="ticket">The ticket.</param> private void ResizePanels(InterJetTicket ticket) { this.PassangerGroupBox.AutoSize = true; this.SegmentsGroupBox.AutoSize = true; this.FareGroupBox.AutoSize = true; this.PassangerGroupBox.PerformLayout(); this.SegmentsGroupBox.PerformLayout(); this.FareGroupBox.PerformLayout(); int y_Displacement = this.PassangerGroupBox.Size.Height; this.SegmentsGroupBox.Location = new System.Drawing.Point(this.PassangerGroupBox.Location.X, this.PassangerGroupBox.Location.Y + y_Displacement); int yDisplacement = this.SegmentsGroupBox.Size.Height; this.FareGroupBox.Location = new System.Drawing.Point(this.PassangerGroupBox.Location.X, this.SegmentsGroupBox.Location.Y + yDisplacement); int y_ButtonDisplacement = this.FareGroupBox.Size.Height; this.AcceptButton.Location = new Point(this.AcceptButton.Location.X, this.FareGroupBox.Location.Y + y_ButtonDisplacement); this.PassangerGroupBox.PerformLayout(); this.SegmentsGroupBox.PerformLayout(); this.FareGroupBox.PerformLayout(); }
/// <summary> /// Sets the taxes. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="flight">The flight.</param> /// <param name="paxType">Type of the pax.</param> private void SetTaxes(InterJetTicket ticket, InterJetFlight flight, InterJetPassangerType paxType) { if (paxType == InterJetPassangerType.Adult) { var adultTaxDetail = this.GetControlByName("adultTaxDetailControl") as ucInterJetTaxFlightDetail; adultTaxDetail.PassangerType = InterJetPassangerType.Adult; adultTaxDetail.PassangerCount = ticket.Passangers.TotalAdults; adultTaxDetail.SetInformation(ticket, flight); } if (paxType == InterJetPassangerType.Child) { var childTaxDetail = this.GetControlByName("childTaxDetailControl") as ucInterJetTaxFlightDetail; childTaxDetail.PassangerType = InterJetPassangerType.Child; childTaxDetail.PassangerCount = ticket.Passangers.TotalChildren; childTaxDetail.SetInformation(ticket, flight); } if (paxType == InterJetPassangerType.Senior) { var seniorTaxDetail = this.GetControlByName("seniorTaxDetailControl") as ucInterJetTaxFlightDetail; seniorTaxDetail.PassangerType = InterJetPassangerType.Senior; seniorTaxDetail.PassangerCount = ticket.Passangers.TotalSenior; seniorTaxDetail.SetInformation(ticket, flight); } if (paxType == InterJetPassangerType.Infant) { //var infantTaxDetail = this.GetControlByName("infantTaxDetailControl") as ucInterJetTaxFlightDetail; //infantTaxDetail.PassangerType = InterJetPassangerType.Infant; //infantTaxDetail.PassangerCount = ticket.Passangers.GetInfants().Count; //infantTaxDetail.SetInformation(ticket, flight); } }
/// <summary> /// Sets the passanger tax visibility. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="flight">The flight.</param> private void SetPassangerTaxVisibility(InterJetTicket ticket, InterJetFlight flight) { this.ShowAdultTaxDetail(false); this.ShowChildTaxDetail(false); this.ShowSeniorTaxDetail(false); this.ShowInfantTaxDetail(false, 1); if (ticket.Passangers.HasAdults) { this.ShowAdultTaxDetail(true); this.SetTaxes(ticket, flight, InterJetPassangerType.Adult); } if (ticket.Passangers.HasSeniorAdult) { this.ShowSeniorTaxDetail(true); this.SetTaxes(ticket, flight, InterJetPassangerType.Senior); } if (ticket.Passangers.HasChildren) { this.ShowChildTaxDetail(true); this.SetTaxes(ticket, flight, InterJetPassangerType.Child); } if (ticket.Passangers.HasInfants) { this.ShowInfantTaxDetail(true, flight.Segments.GetAll().Count); //this.SetTaxes(ticket, flight, InterJetPassangerType.Infant); } }
/// <summary> /// Sets the information. /// </summary> /// <param name="ticket">The ticket.</param> private void SetInformation(InterJetTicket ticket) { SetRecord(ticket.RecordLocator); this.SetPassangers(ticket.Passangers); this.SetFlights(ticket.Flights); this.SetFare(ticket.Flights); }
/// <summary> /// Initializes the specified ticket. /// </summary> /// <param name="ticket">The ticket.</param> public void Initialize(InterJetTicket ticket) { if (this.MainPanel != null) { this.ControlFactory.CreateDynamicReservationResumeControls(MainPanel, ticket); this.ResizePanels(ticket); this.EmissionTime.Text = string.Format("Fecha:{0}", DateTime.Now.ToString("dd/MM/yyyy hh:mm")); } }
/// <summary> /// TODO: Al crear el Passanger Number Record Verificar que pasa si esta null. /// </summary> private void SetPassangerNumberRecord() { InterJetTicket currentTicket = this.GetTicket(); if (currentTicket != null) { currentTicket.PassangerNumberRecord.DK = this.txtDK.Text; currentTicket.PassangerNumberRecord.Passangers = currentTicket.Passangers; currentTicket.PassangerNumberRecord.Segments = currentTicket.Flights; this.Session["CurrentTicket"] = currentTicket; } }
/// <summary> /// Inserts the specified string connection. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="agent">The agent.</param> /// <param name="stringConnection">The string connection.</param> /// <returns></returns> private bool Insert(InterJetTicket ticket, string agent, decimal Amount, string stringConnection) { Database dataBase = DatabaseFactory.CreateDatabase(stringConnection); DbCommand dbComand = dataBase.GetStoredProcCommand("InsertInterJetLog"); dataBase.AddInParameter(dbComand, "Agent", DbType.String, agent); dataBase.AddInParameter(dbComand, "ReservationCode", DbType.String, ticket.RecordLocator); dataBase.AddInParameter(dbComand, "Approved", DbType.Boolean, ticket.IsAprooved); dataBase.AddInParameter(dbComand, "Invoiced", DbType.Boolean, ticket.IsFactured); dataBase.AddInParameter(dbComand, "Amount", DbType.Decimal, Amount); int result = dataBase.ExecuteNonQuery(dbComand); return(result > 0); }
/// <summary> /// Inserts the specified ticket. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="agent">The agent.</param> /// <returns></returns> public bool Insert(InterJetTicket ticket, string agent, decimal Amount) { try { return(this.Insert(ticket, agent, Amount, CommonENT.MYCTSDB_CONNECTION)); } catch (Exception ex) { try { return(this.Insert(ticket, agent, Amount, CommonENT.MYCTSDBBACKUP_CONNECTION)); }catch { return(false); } } }
/// <summary> /// Generates the ticket. /// </summary> /// <returns></returns> private InterJetTicket GenerateTicket() { var ticket = new InterJetTicket(); //ticket.Flights = new InterJetFlights(); ticket.Flights.AddFlights(((InterJetSelectedFlights)this.Session["SelectedFlights"]).GetFlights()); ticket.Passangers = (InterJetPassangers)this.Session["Passangers"]; ticket.Contact = (InterJetContact)this.Session["Contact"]; ticket.Agent.Email = Login.Mail; ticket.Agent.Firm = Login.Firm; ticket.Agent.Pcc = Login.PCC; ticket.Agent.FullName = Login.NombreCompleto; ticket.Agent.ID = Login.Agent; ticket.Agent.Queue = Login.Queue; foreach (InterJetFlight flight in ticket.Flights.GetAllFlights()) { flight.Ticket = ticket; } return(ticket); }
/// <summary> /// Inserts the specified ticket. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="agent">The agent.</param> /// <returns></returns> public bool Insert(InterJetTicket ticket, string agent, decimal Amount) { return(DataAcces.Insert(ticket, agent, Amount)); }
/// <summary> /// Sets the information. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="flight">The flight.</param> public void SetInformation(InterJetTicket ticket, InterJetFlight flight) { this.Handler.SetInformation(ticket, flight); }
/// <summary> /// Sets the information. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="flight">The flight.</param> public void SetInformation(InterJetTicket ticket, InterJetFlight flight) { this.SetDestinationsAndTime(flight); this.SetPassangerTaxVisibility(ticket, flight); }
/// <summary> /// Sets the information. /// </summary> /// <param name="ticket">The ticket.</param> /// <param name="flight">The flight.</param> public void SetInformation(InterJetTicket ticket, InterJetFlight flight) { this.TotalPrice = flight.TotalPayed; string impuestos = string.Empty; if (CurrentUserControl.PassangerType == InterJetPassangerType.Adult) { SetAdultIcon(); decimal basePrice = flight.PriceDetail.Adult.BasePrice; decimal ivaTotal = flight.PriceDetail.Adult.IVA; decimal tuaTotal = flight.PriceDetail.Adult.TUA; decimal extraTaxes = flight.PriceDetail.Adult.TotalExtraTaxes; // TODO: total de impuestos en caso de sea internacionale decimal discount = flight.PriceDetail.Adult.Discount; decimal totalPrice = flight.PriceDetail.Adult.Total; this.TotalPrice = totalPrice; if (ListTaxesInterjet.roud && InterJetPreviousPrincingHandler.Conexion) { cont = ListTaxesInterjet.BasePriceList.Count / 2; ListTaxesInterjet.mit = cont / 2; decimal a = ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.TaxesList[ListTaxesInterjet.turningTaxes] - ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning]; this.TotalPrice = a; this.SetFare(ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning], ListTaxesInterjet.IVA[ListTaxesInterjet.turning], ListTaxesInterjet.TUA[ListTaxesInterjet.turning], ListTaxesInterjet.Extras[ListTaxesInterjet.turning], a, ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning], 0, 0, flight.IsInternational); if (ListTaxesInterjet.turning < ListTaxesInterjet.BasePriceList.Count) { ListTaxesInterjet.turning = ListTaxesInterjet.turning + 1; } if (ListTaxesInterjet.turning > ListTaxesInterjet.mit - 1 && ListTaxesInterjet.Fligth == 1) { ListTaxesInterjet.turning = 0; } if (ListTaxesInterjet.turning > cont - 1 && ListTaxesInterjet.Fligth == 2) { ListTaxesInterjet.turning = ListTaxesInterjet.mit; } impuestos = impuestos + ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.IVA[ListTaxesInterjet.turning] + ListTaxesInterjet.TUA[ListTaxesInterjet.turning] + ListTaxesInterjet.Extras[ListTaxesInterjet.turning]; } else { //Quitar impuestos = basePrice.ToString("#.00") + " " + ivaTotal.ToString("#.00") + " " + tuaTotal.ToString("#.00") + " " + discount.ToString("#.00") + " " + extraTaxes.ToString("#.00"); this.SetFare(basePrice, ivaTotal, tuaTotal, extraTaxes, totalPrice, discount, 0, 0, flight.IsInternational); } } if (CurrentUserControl.PassangerType == InterJetPassangerType.Child) { SetChildIcon(); decimal basePrice = flight.PriceDetail.Child.BasePrice; decimal ivaTotal = flight.PriceDetail.Child.IVA; decimal tuaTotal = flight.PriceDetail.Child.TUA; decimal extraTaxes = flight.PriceDetail.Child.TotalExtraTaxes; // TODO: total de impuestos en caso de sea internacionale decimal discount = flight.PriceDetail.Child.Discount; decimal totalPrice = flight.PriceDetail.Child.Total; this.TotalPrice = totalPrice; if (ListTaxesInterjet.roud && InterJetPreviousPrincingHandler.Conexion) { cont = ListTaxesInterjet.BasePriceList.Count / 2; ListTaxesInterjet.mit = cont / 2; decimal a = ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.TaxesList[ListTaxesInterjet.turningTaxes] - ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning]; this.TotalPrice = a; this.SetFare(ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning], ListTaxesInterjet.IVA[ListTaxesInterjet.turning], ListTaxesInterjet.TUA[ListTaxesInterjet.turning], ListTaxesInterjet.Extras[ListTaxesInterjet.turning], a, ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning], 0, 0, flight.IsInternational); //ListTaxesInterjet.turningTaxes++; if (ListTaxesInterjet.turning < ListTaxesInterjet.BasePriceList.Count) { ListTaxesInterjet.turning = ListTaxesInterjet.turning + 1; } if (ListTaxesInterjet.turning > ListTaxesInterjet.mit - 1 && ListTaxesInterjet.Fligth == 1) { ListTaxesInterjet.turning = 0; } if (ListTaxesInterjet.turning > cont - 1 && ListTaxesInterjet.Fligth == 2) { ListTaxesInterjet.turning = ListTaxesInterjet.mit; } impuestos = impuestos + ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.IVA[ListTaxesInterjet.turning] + ListTaxesInterjet.TUA[ListTaxesInterjet.turning] + ListTaxesInterjet.Extras[ListTaxesInterjet.turning]; } else { impuestos = impuestos + " " + basePrice.ToString("#.00") + " " + ivaTotal.ToString("#.00") + " " + tuaTotal.ToString("#.00") + " " + discount.ToString("#.00") + " " + extraTaxes.ToString("#.00"); this.SetFare(basePrice, ivaTotal, tuaTotal, extraTaxes, totalPrice, discount, 0, 0, flight.IsInternational); } } if (CurrentUserControl.PassangerType == InterJetPassangerType.Senior) { SetAdultIcon(); decimal basePrice = flight.PriceDetail.Senior.BasePrice; decimal ivaTotal = flight.PriceDetail.Senior.IVA; decimal tuaTotal = flight.PriceDetail.Senior.TUA; decimal extraTaxes = flight.PriceDetail.Senior.TotalExtraTaxes; // TODO: total de impuestos en caso de sea internacionale decimal discount = flight.PriceDetail.Senior.Discount; decimal totalPrice = flight.PriceDetail.Senior.Total; this.TotalPrice = totalPrice; if (ListTaxesInterjet.roud && InterJetPreviousPrincingHandler.Conexion) { cont = ListTaxesInterjet.BasePriceList.Count / 2; ListTaxesInterjet.mit = cont / 2; decimal a = ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.TaxesList[ListTaxesInterjet.turningTaxes] - ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning]; this.TotalPrice = a; this.SetFare(ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning], ListTaxesInterjet.IVA[ListTaxesInterjet.turning], ListTaxesInterjet.TUA[ListTaxesInterjet.turning], ListTaxesInterjet.Extras[ListTaxesInterjet.turning], a, ListTaxesInterjet.DiscountList[ListTaxesInterjet.turning], 0, 0, flight.IsInternational); if (ListTaxesInterjet.turning < ListTaxesInterjet.BasePriceList.Count) { ListTaxesInterjet.turning = ListTaxesInterjet.turning + 1; } if (ListTaxesInterjet.turning > ListTaxesInterjet.mit - 1 && ListTaxesInterjet.Fligth == 1) { ListTaxesInterjet.turning = 0; } if (ListTaxesInterjet.turning > cont - 1 && ListTaxesInterjet.Fligth == 2) { ListTaxesInterjet.turning = ListTaxesInterjet.mit; } impuestos = impuestos + ListTaxesInterjet.BasePriceList[ListTaxesInterjet.turning] + ListTaxesInterjet.IVA[ListTaxesInterjet.turning] + ListTaxesInterjet.TUA[ListTaxesInterjet.turning] + ListTaxesInterjet.Extras[ListTaxesInterjet.turning]; } else { impuestos = impuestos + " " + basePrice.ToString("#.00") + " " + ivaTotal.ToString("#.00") + " " + tuaTotal.ToString("#.00") + " " + discount.ToString("#.00") + " " + extraTaxes.ToString("#.00"); this.SetFare(basePrice, ivaTotal, tuaTotal, extraTaxes, totalPrice, discount, 0, 0, flight.IsInternational); } } //if (CurrentUserControl.PassangerType == InterJetPassangerType.Infant) //{ // this.SetFare(PriceTotalResponseInterjet.totalPriceInfant, 0, 0, 0, PriceTotalResponseInterjet.totalPriceInfant, 0, 0, 0, flight.IsInternational); //} //Quitar ImpuestosBajoCosto.ImpuestosMostrados = impuestos + " "; ImpuestosBajoCostoBL.UpdateImpuestosBajoCosto(ImpuestosBajoCosto.Id, ImpuestosBajoCosto.ImpuestosObtenidos, string.Empty, ImpuestosBajoCosto.ImpuestosMostrados, string.Empty, string.Empty); }
/// <summary> /// Pays the specified ticket. /// </summary> /// <param name="ticket">The ticket.</param> public abstract void Pay(InterJetTicket ticket);