Beispiel #1
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                ErrorLiteral.Text = "";
                ServiceAccess serviceLoader = ServiceAccess.GetInstance();
                RegistrationService.LoginInfo           loginInfo           = (RegistrationService.LoginInfo)Session["loginInfo"];
                RegistrationService.RegistrationService registrationService = serviceLoader.GetRegistration();

                RegistrationService.RegistrationInfo registration = new RegistrationService.RegistrationInfo();

                // Get user's personal modified information.
                RegistrationService.StateInfo state = new RegistrationService.StateInfo();
                state.StateId = Convert.ToInt32(StateDropDownList.SelectedValue);
                state.Name    = StateDropDownList.SelectedItem.Text;

                RegistrationService.CountryInfo country = new RegistrationService.CountryInfo();
                country.CountryId = Convert.ToInt32(CountryDropDownList.SelectedValue);
                country.Name      = CountryDropDownList.SelectedItem.Text;


                RegistrationService.AddressInfo address = new RegistrationService.AddressInfo();
                address.Address1 = Address1TextBox.Text;
                address.Address2 = Address2TextBox.Text;
                address.City     = CityTextBox.Text;
                address.State    = state;
                address.Zip      = ZipTextBox.Text;
                address.Country  = country;
                address.Phone    = PhoneTextBox.Text;
                address.Fax      = FaxTextBox.Text;
                address.Mobile   = MobileTextBox.Text;

                registration.UserId      = loginInfo.UserId;
                registration.UserName    = loginInfo.UserName;
                registration.FirstName   = FirstNameTextBox.Text;
                registration.MiddleName  = MiddleNameTextBox.Text;
                registration.LastName    = LastNameTextBox.Text;
                registration.CompanyName = CompanyNameTextBox.Text;
                registration.Address     = address;
                registration.Email       = EmailTextBox.Text;
                registration.Role        = loginInfo.Role;
                registration.Status      = loginInfo.Status;
                registrationService.Update(registration, loginInfo.UserId);
            }
            catch (Exception ex)
            {
                ErrorLiteral.Text = "Error in Update";
            }
            if (ErrorLiteral.Text == "")
            {
                MessagesLabel.Text = "Profile Updated Successfully";
            }
        }
    }
    private void CaptureValuesIntoSession()
    {
        // Get user's personal information.
        RegistrationService.StateInfo state = new RegistrationService.StateInfo();
        state.StateId = Convert.ToInt32(StateDropDownList.SelectedValue);
        state.Name    = StateDropDownList.SelectedItem.Text;

        RegistrationService.CountryInfo country = new RegistrationService.CountryInfo();
        country.CountryId = Convert.ToInt32(CountryDropDownList.SelectedValue);
        country.Name      = CountryDropDownList.SelectedItem.Text;

        RegistrationService.AddressInfo address = new RegistrationService.AddressInfo();
        address.Address1 = Address1TextBox.Text;
        address.Address2 = Address2TextBox.Text;
        address.City     = CityTextBox.Text;
        address.State    = state;
        address.Zip      = ZipTextBox.Text;
        address.Country  = country;
        address.Phone    = PhoneTextBox.Text;
        address.Fax      = FaxTextBox.Text;
        address.Mobile   = MobileTextBox.Text;

        RegistrationService.RegistrationInfo registration = new RegistrationService.RegistrationInfo();
        registration.UserName = UserNameTextBox.Text;
        registration.Email    = EmailTextBox.Text;
        registration.Password = PasswordTextBox.Text;
        if ((SecQuestionHiddenField.Value != "") && (SecretQuestionDropDownList.SelectedValue == "13"))
        {
            SecretQuestionDropDownList.SelectedItem.Text = SecQuestionHiddenField.Value;
        }
        registration.PasswordQuestion = SecretQuestionDropDownList.SelectedItem.Text;
        registration.PasswordAnswer   = SecretAnswerTextBox.Text;


        registration.FirstName   = FirstNameTextBox.Text;
        registration.MiddleName  = MiddleNameTextBox.Text;
        registration.LastName    = LastNameTextBox.Text;
        registration.CompanyName = CompanyNameTextBox.Text;
        registration.Address     = address;
        registration.Status      = Irmac.MailingCycle.BLLServiceLoader.Registration.RegistrationStatus.Active;
        registration.Role        = Irmac.MailingCycle.BLLServiceLoader.Registration.UserRole.Agent;

        if (Session["registrationInfo"] != null)
        {
            RegistrationService.RegistrationInfo registrationSession = (RegistrationService.RegistrationInfo)Session["registrationInfo"];
            if (registrationSession.CreditCard != null)
            {
                registration.CreditCard = registrationSession.CreditCard;
            }
        }

        Session["registrationInfo"] = registration;
    }
    private void CaptureValuesIntoSession()
    {
        RegistrationService.RegistrationInfo registration = (RegistrationService.RegistrationInfo)Session["registrationInfo"];

        RegistrationService.CreditCardInfo creditCard = new RegistrationService.CreditCardInfo();

        RegistrationService.StateInfo billingState = new RegistrationService.StateInfo();
        billingState.StateId = Convert.ToInt32(((DropDownList)CreditCardDetails1.FindControl("BillingStateDropDownList")).SelectedValue);
        billingState.Name    = ((DropDownList)CreditCardDetails1.FindControl("BillingStateDropDownList")).SelectedItem.Text;

        RegistrationService.CountryInfo billingCountry = new RegistrationService.CountryInfo();
        billingCountry.CountryId = Convert.ToInt32(((DropDownList)CreditCardDetails1.FindControl("BillingCountryDropDownList")).SelectedValue);
        billingCountry.Name      = ((DropDownList)CreditCardDetails1.FindControl("BillingCountryDropDownList")).SelectedItem.Text;

        RegistrationService.AddressInfo billingAddress = new RegistrationService.AddressInfo();
        billingAddress.Address1 = ((TextBox)CreditCardDetails1.FindControl("BillingAddress1TextBox")).Text;
        billingAddress.Address2 = ((TextBox)CreditCardDetails1.FindControl("BillingAddress2TextBox")).Text;
        billingAddress.City     = ((TextBox)CreditCardDetails1.FindControl("BillingCityTextBox")).Text;
        billingAddress.State    = billingState;
        billingAddress.Zip      = ((TextBox)CreditCardDetails1.FindControl("BillingZipTextBox")).Text;
        billingAddress.Country  = billingCountry;

        RegistrationService.LookupInfo creditCardType = new RegistrationService.LookupInfo();
        creditCardType.LookupId = Convert.ToInt32(((DropDownList)CreditCardDetails1.FindControl("CardTypeDropDownList")).SelectedValue);
        creditCardType.Name     = ((DropDownList)CreditCardDetails1.FindControl("CardTypeDropDownList")).SelectedItem.Text;

        creditCard.Type            = creditCardType;
        creditCard.Number          = ((TextBox)CreditCardDetails1.FindControl("CardNumberTextBox")).Text;
        creditCard.CvvNumber       = ((TextBox)CreditCardDetails1.FindControl("CVVNumberTextBox")).Text;
        creditCard.HolderName      = ((TextBox)CreditCardDetails1.FindControl("CardHolderNameTextBox")).Text;
        creditCard.ExpirationMonth = Convert.ToInt32(((DropDownList)CreditCardDetails1.FindControl("CardMonthDropDownList")).SelectedValue);
        creditCard.ExpirationYear  = Convert.ToInt32(((DropDownList)CreditCardDetails1.FindControl("CardYearDropDownList")).SelectedValue);
        creditCard.Address         = billingAddress;

        registration.CreditCard     = creditCard;
        Session["registrationInfo"] = registration;
    }
Beispiel #4
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                ErrorLiteral.Text = "";

                if (StatusTextBox.Text == "Approval Required")
                {
                    StatusTextBox.Text = "ApprovalRequired";
                }
                ServiceAccess serviceLoader = ServiceAccess.GetInstance();
                RegistrationService.RegistrationService registrationService = serviceLoader.GetRegistration();

                RegistrationService.RegistrationInfo registration = new RegistrationService.RegistrationInfo();

                // Get user's personal modified information.
                RegistrationService.StateInfo state     = new RegistrationService.StateInfo();
                RegistrationService.LoginInfo loginInfo = (RegistrationService.LoginInfo)Session["loginInfo"];


                state.StateId = Convert.ToInt32(StateDropDownList.SelectedValue);
                state.Name    = StateDropDownList.SelectedItem.Text;

                RegistrationService.CountryInfo country = new RegistrationService.CountryInfo();
                country.CountryId = Convert.ToInt32(CountryDropDownList.SelectedValue);
                country.Name      = CountryDropDownList.SelectedItem.Text;


                RegistrationService.AddressInfo address = new RegistrationService.AddressInfo();
                address.Address1 = Address1TextBox.Text;
                address.Address2 = Address2TextBox.Text;
                address.City     = CityTextBox.Text;
                address.State    = state;
                address.Zip      = ZipTextBox.Text;
                address.Country  = country;
                address.Phone    = PhoneTextBox.Text;
                address.Fax      = FaxTextBox.Text;
                address.Mobile   = MobileTextBox.Text;

                registration.UserId      = Convert.ToInt32(UserIdHiddenField.Value);
                registration.UserName    = UserNameTextBox.Text;
                registration.FirstName   = FirstNameTextBox.Text;
                registration.MiddleName  = MiddleNameTextBox.Text;
                registration.LastName    = LastNameTextBox.Text;
                registration.CompanyName = CompanyNameTextBox.Text;
                registration.Address     = address;
                registration.Email       = EmailTextBox.Text;
                registration.Role        = (Irmac.MailingCycle.BLLServiceLoader.Registration.UserRole)Enum.Parse(typeof(Irmac.MailingCycle.BLLServiceLoader.Registration.UserRole), RoleDropDownList.SelectedValue, true);
                registration.Status      = (Irmac.MailingCycle.BLLServiceLoader.Registration.RegistrationStatus)Enum.Parse(typeof(Irmac.MailingCycle.BLLServiceLoader.Registration.RegistrationStatus), StatusTextBox.Text, true);

                registrationService.Update(registration, loginInfo.UserId);
            }
            catch (Exception ex)
            {
                ErrorLiteral.Text = "Error in Update";
            }
            if (ErrorLiteral.Text == "")
            {
                RedirectPage(Request.QueryString["PageName"]);
            }
        }
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        try
        {
            bool isExpiryValid     = false;
            bool isCardNumberValid = false;

            ((CustomValidator)CreditCardWebUserControl1.FindControl("CCExpiryCustomValidator")).Validate();
            if (Page.IsValid)
            {
                isExpiryValid = true;
            }
            ((CustomValidator)CreditCardWebUserControl1.FindControl("CardNumberTextBoxCustomValidator")).Validate();
            if (Page.IsValid)
            {
                isCardNumberValid = true;
            }

            if (isExpiryValid == true && isCardNumberValid == true)
            {
                ErrorLiteral.Text = "";
                ServiceAccess serviceLoader = ServiceAccess.GetInstance();
                RegistrationService.LoginInfo           loginInfo           = (RegistrationService.LoginInfo)Session["loginInfo"];
                RegistrationService.RegistrationService registrationService = serviceLoader.GetRegistration();

                RegistrationService.CreditCardInfo creditCardInfo = new RegistrationService.CreditCardInfo();

                RegistrationService.StateInfo billingState = new RegistrationService.StateInfo();
                billingState.StateId = Convert.ToInt32(((DropDownList)CreditCardWebUserControl1.FindControl("BillingStateDropDownList")).SelectedValue);
                billingState.Name    = ((DropDownList)CreditCardWebUserControl1.FindControl("BillingStateDropDownList")).SelectedItem.Text;

                RegistrationService.CountryInfo billingCountry = new RegistrationService.CountryInfo();
                billingCountry.CountryId = Convert.ToInt32(((DropDownList)CreditCardWebUserControl1.FindControl("BillingCountryDropDownList")).SelectedValue);
                billingCountry.Name      = ((DropDownList)CreditCardWebUserControl1.FindControl("BillingCountryDropDownList")).SelectedItem.Text;

                RegistrationService.AddressInfo billingAddress = new RegistrationService.AddressInfo();
                billingAddress.Address1 = ((TextBox)CreditCardWebUserControl1.FindControl("BillingAddress1TextBox")).Text;
                billingAddress.Address2 = ((TextBox)CreditCardWebUserControl1.FindControl("BillingAddress2TextBox")).Text;
                billingAddress.City     = ((TextBox)CreditCardWebUserControl1.FindControl("BillingCityTextBox")).Text;
                billingAddress.State    = billingState;
                billingAddress.Zip      = ((TextBox)CreditCardWebUserControl1.FindControl("BillingZipTextBox")).Text;
                billingAddress.Country  = billingCountry;

                RegistrationService.LookupInfo creditCardType = new RegistrationService.LookupInfo();
                creditCardType.LookupId = Convert.ToInt32(((DropDownList)CreditCardWebUserControl1.FindControl("CardTypeDropDownList")).SelectedValue);
                creditCardType.Name     = ((DropDownList)CreditCardWebUserControl1.FindControl("CardTypeDropDownList")).SelectedItem.Text;

                creditCardInfo.Type            = creditCardType;
                creditCardInfo.Number          = ((TextBox)CreditCardWebUserControl1.FindControl("CardNumberTextBox")).Text;
                creditCardInfo.CvvNumber       = ((TextBox)CreditCardWebUserControl1.FindControl("CVVNumberTextBox")).Text;
                creditCardInfo.HolderName      = ((TextBox)CreditCardWebUserControl1.FindControl("CardHolderNameTextBox")).Text;
                creditCardInfo.ExpirationMonth = Convert.ToInt32(((DropDownList)CreditCardWebUserControl1.FindControl("CardMonthDropDownList")).SelectedValue);
                creditCardInfo.ExpirationYear  = Convert.ToInt32(((DropDownList)CreditCardWebUserControl1.FindControl("CardYearDropDownList")).SelectedValue);
                creditCardInfo.Address         = billingAddress;


                registrationService.UpdateCreditCard(loginInfo.UserId, creditCardInfo);
            }
            else
            {
                ErrorLiteral.Text = " ";
            }
        }
        catch (Exception ex)
        {
            ErrorLiteral.Text = "Error in Update";
        }
        if (ErrorLiteral.Text == "")
        {
            MessagesLabel.Text = "Credit Card Information Updated Successfully";
        }
    }