Beispiel #1
0
        /// <summary>
        /// Sets the contact.
        /// </summary>
        private void SetContact()
        {
            InterJetContact theContact = (InterJetContact)this.Session["Contact"];

            if (theContact != null)
            {
                ComboBox titleComboBox = this.GetComboBoxByName("contactTitleComboBox");
                titleComboBox.SelectedValue = theContact.Title;

                SmartTextBox nameTextBox = this.GetSmartTextBoxByName("contactNameTextBox");
                nameTextBox.Text = theContact.Name;

                SmartTextBox lastNameTextBox = this.GetSmartTextBoxByName("contactLastNameTextBox");
                lastNameTextBox.Text = theContact.LastName;

                SmartTextBox addres1TextBox = this.GetSmartTextBoxByName("contactAddress1TextBox");
                addres1TextBox.Text = theContact.Address1;

                SmartTextBox addres2TextBox = this.GetSmartTextBoxByName("contactAddress2TextBox");
                addres2TextBox.Text = theContact.Address2;

                SmartTextBox addres3TextBox = this.GetSmartTextBoxByName("contactAddress3TextBox");
                addres3TextBox.Text = theContact.Address3;

                SmartTextBox cityTextBox = this.GetSmartTextBoxByName("contactCityTextBox");
                cityTextBox.Text = theContact.City;

                ComboBox stateComboBox = this.GetComboBoxByName("contactStateComboBox");
                stateComboBox.SelectedValue = theContact.State;

                SmartTextBox postalCodeTextBox = this.GetSmartTextBoxByName("contactPostalCodeTextBox");
                postalCodeTextBox.Text = theContact.PostalCode;

                ComboBox countryTextComboBox = this.GetComboBoxByName("contactCountryComboBox");
                countryTextComboBox.SelectedValue = theContact.Country;


                SmartTextBox primaryTelephone = this.GetSmartTextBoxByName("contactPrimaryTelephoneTextBox");
                primaryTelephone.Text = theContact.PrimaryTelephone;

                SmartTextBox alternTelephone = this.GetSmartTextBoxByName("contactAlternTelephoneTextbox");
                alternTelephone.Text = theContact.AlternTelephone;

                SmartTextBox cellPhoneTextBox = this.GetSmartTextBoxByName("contactCellPhoneTextBox");
                cellPhoneTextBox.Text = theContact.CellPhone;

                SmartTextBox faxTextBox = this.GetSmartTextBoxByName("contactFaxTextbox");
                faxTextBox.Text = theContact.Fax;

                SmartTextBox emailTextBox = this.GetSmartTextBoxByName("contactEmailTextBox");
                emailTextBox.Text = theContact.Email;

                SmartTextBox confirmationEmail = this.GetSmartTextBoxByName("contactEmailConfirmationTextBox");
                confirmationEmail.Text = theContact.Email;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Fills the contact entity.
        /// </summary>
        private void FillContactEntity()
        {
            var theContact = new InterJetContact();

            VolarisSession.Contacto = new ContactVolaris();

            ComboBox titleComboBox = this.GetComboBoxByName("contactTitleComboBox");

            this.ValidateComboBox(titleComboBox, "TITULO");
            theContact.Title = titleComboBox.SelectedValue.ToString();
            VolarisSession.Contacto.Title = theContact.Title;

            SmartTextBox nameTextBox = this.GetSmartTextBoxByName("contactNameTextBox");

            this.ValidateTextBox(nameTextBox, "NOMBRE");
            theContact.Name = nameTextBox.Text;
            VolarisSession.Contacto.FirstName = theContact.Name;

            SmartTextBox lastNameTextBox = this.GetSmartTextBoxByName("contactLastNameTextBox");

            this.ValidateTextBox(lastNameTextBox, "APELLIDO");
            theContact.LastName = lastNameTextBox.Text;
            VolarisSession.Contacto.LastName = theContact.LastName;

            SmartTextBox addres1TextBox = this.GetSmartTextBoxByName("contactAddress1TextBox");

            this.ValidateTextBox(addres1TextBox, "DIRECCION");
            theContact.Address1             = addres1TextBox.Text;
            VolarisSession.Contacto.Address = theContact.Address1;

            SmartTextBox addres2TextBox = this.GetSmartTextBoxByName("contactAddress2TextBox");

            theContact.Address2             = addres2TextBox.Text;
            VolarisSession.Contacto.Address = VolarisSession.Contacto.Address + " " + theContact.Address2;

            SmartTextBox addres3TextBox = this.GetSmartTextBoxByName("contactAddress3TextBox");

            theContact.Address3             = addres3TextBox.Text;
            VolarisSession.Contacto.Address = VolarisSession.Contacto.Address + " " + theContact.Address3;

            SmartTextBox cityTextBox = this.GetSmartTextBoxByName("contactCityTextBox");

            this.ValidateTextBox(cityTextBox, "CUIDAD");
            theContact.City = cityTextBox.Text;
            VolarisSession.Contacto.City = theContact.City;

            ComboBox stateComboBox = this.GetComboBoxByName("contactStateComboBox");

            this.ValidateComboBox(stateComboBox, "ESTADO");
            theContact.State = stateComboBox.SelectedItem != null ? ((ListItem)stateComboBox.SelectedItem).Value : "";
            VolarisSession.Contacto.ProvinceState = theContact.State;

            SmartTextBox postalCodeTextBox = this.GetSmartTextBoxByName("contactPostalCodeTextBox");

            this.ValidateTextBox(postalCodeTextBox, "CODIGO POSTAL");
            theContact.PostalCode = postalCodeTextBox.Text;
            VolarisSession.Contacto.PostalCode = theContact.PostalCode;

            ComboBox countryTextComboBox = this.GetComboBoxByName("contactCountryComboBox");

            this.ValidateComboBox(countryTextComboBox, "PAIS");
            theContact.Country = countryTextComboBox.SelectedItem != null ? ((ListItem)countryTextComboBox.SelectedItem).Value : "";
            VolarisSession.Contacto.CountryCode = theContact.Country;

            SmartTextBox primaryTelephone = this.GetSmartTextBoxByName("contactPrimaryTelephoneTextBox");

            this.ValidateTextBox(primaryTelephone, "TELEFONO");
            theContact.PrimaryTelephone       = primaryTelephone.Text;
            VolarisSession.Contacto.HomePhone = theContact.PrimaryTelephone;

            SmartTextBox alternTelephone = this.GetSmartTextBoxByName("contactAlternTelephoneTextbox");

            theContact.AlternTelephone = alternTelephone.Text;

            SmartTextBox cellPhoneTextBox = this.GetSmartTextBoxByName("contactCellPhoneTextBox");

            theContact.CellPhone = cellPhoneTextBox.Text;

            SmartTextBox faxTextBox = this.GetSmartTextBoxByName("contactFaxTextbox");

            theContact.Fax = faxTextBox.Text;

            SmartTextBox emailTextBox = this.GetSmartTextBoxByName("contactEmailTextBox");

            this.ValidateTextBox(emailTextBox, "EMAIL");
            this.ValidateEmailAddress(emailTextBox.Text, emailTextBox);
            theContact.Email = emailTextBox.Text.ToLower();
            VolarisSession.Contacto.Email = theContact.Email;

            SmartTextBox confirmationEmail = this.GetSmartTextBoxByName("contactEmailConfirmationTextBox");

            this.ValidateTextBox(confirmationEmail, "CONFIRMACION DE EMAIL");
            if (!theContact.Email.ToLower().Equals(confirmationEmail.Text.ToLower()))
            {
                confirmationEmail.Focus();
                ErrorProvider.SetError(confirmationEmail, "LA CONFIRMACION DEL EMAIL NO CONCUERDA CON EL EMAIL PROPORCIONADO.");
                throw new Exception("LA CONFIRMACION DEL EMAIL NO CONCUERDA CON EL EMAIL PROPORCIONADO.");
            }

            this.Session["Contact"] = theContact;
        }