private void ucChargeOfServiceAssign_Load(object sender, EventArgs e) { _presenter.View = this; _presenter.Repository = new ChargeOfServiceLowFareAssignRepository(); _presenter.LoadData(); this.mothCombo.Properties.Items.AddRange(new[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }); this.mothCombo.SelectedItem = DateTime.Today.ToString("MM"); for (int year = DateTime.Now.Year; year < DateTime.Now.Year + 10; year++) { this.yearComboBox.Properties.Items.Add(year.ToString(CultureInfo.InvariantCulture)); } yearComboBox.SelectedItem = DateTime.Now.Year.ToString(CultureInfo.InvariantCulture); creditCardCombo.SelectedIndex = 0; this.amountTextBox.Text = "0.00"; creditCardTextBox.Focus(); MyCTS.Entities.InterJetProfileCreditCard credentials = InterJetPaymentFormHandler.cardSelect; if (credentials != null) { DialogResult dialogResult = MessageBox.Show("¿Deseas ingresar la misma forma de pago del boleto para el cargo por servicio?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { if (credentials.Type == MyCTS.Entities.InterJetProfileCrediCardType.AmericanExpress) { creditCardCombo.SelectedIndex = 0; } if (credentials.Type == MyCTS.Entities.InterJetProfileCrediCardType.UniversalTravelPlan) { creditCardCombo.SelectedIndex = 2; } if (credentials.Type == MyCTS.Entities.InterJetProfileCrediCardType.Visa) { creditCardCombo.SelectedIndex = 1; } if (credentials.Type == MyCTS.Entities.InterJetProfileCrediCardType.MasterCard) { creditCardCombo.SelectedIndex = 6; } creditCardChargeRadioButton.Checked = true; creditCardTextBox.Text = credentials.CreditCardNumber; txtNombreTitular.Text = credentials.titular; txtCodigoSeguridad.Text = new string( Components.Common.toDecrypt(credentials.CVV).Where(char.IsDigit).ToArray()); int month = credentials.ExpirationDate.Month; int year = credentials.ExpirationDate.Year; if ((year < DateTime.Now.Year) || (year <= DateTime.Now.Year && month < DateTime.Now.Month)) { MessageBox.Show("La tarjeta ingresada ha caducado, favor de revisar la vigencia.", "MyCTS", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } yearComboBox.SelectedIndex = getIndex(year); mothCombo.SelectedIndex = month - 1; } } }
/// <summary> /// Adds the specified card. /// </summary> /// <param name="card">The card.</param> public void Add(InterJetProfileCreditCard card) { this.Add(new List <InterJetProfileCreditCard> { card }); }