Example #1
0
    protected void commandRegister_Click(object sender, EventArgs e)
    {
        EndUser           enduser     = new EndUser();
        ProcessAddEndUser processuser = new ProcessAddEndUser();

        if (IsValid)
        {
            enduser.EndUserTypeID             = ( int )Enums.EndUserType.CUSTOMER;
            enduser.FirstName                 = textFirstname.Text;
            enduser.LastName                  = textLastname.Text;
            enduser.Address.AddressLine       = textAddress.Text;
            enduser.Address.AddressLine2      = textAddress2.Text;
            enduser.Address.City              = textCity.Text;
            enduser.Address.State             = textState.Text;
            enduser.Address.PostalCode        = textPostalCode.Text;
            enduser.Password                  = textPassword.Text;
            enduser.ContactInformation.Email  = textEmail.Text;
            enduser.ContactInformation.Phone  = textPhone.Text;
            enduser.ContactInformation.Phone2 = textPhone2.Text;
            enduser.ContactInformation.Fax    = textFax.Text;
            enduser.IsSubscribed              = checkboxNewsletter.Checked;

            processuser.EndUser = enduser;

            try
            {
                processuser.Invoke();
            }
            catch
            {
                Response.Redirect("ErrorPage.aspx");
            }

            CurrentEndUser = processuser.EndUser;

            if (Request.Cookies["ReturnURL"].Value != null)
            {
                Response.Redirect(Request.Cookies["ReturnURL"].Value);
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
        }
    }
Example #2
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        EndUser endUser = new EndUser();
        ProcessAddEndUser processUser = new ProcessAddEndUser();

        if (IsValid)
        {
            endUser.EndUserTypeId = (int)Enums.EndUserType.CUSTOMER;
            endUser.FirstName = this.txtFirstname.Text;
            endUser.LastName = this.txtLastname.Text;
            endUser.Address.AddressLine = this.txtAddress.Text;
            endUser.Address.AddressLine2 = this.txtAddress2.Text;
            endUser.Address.City = this.txtCity.Text;
            endUser.Address.PostalCode = this.txtPostalCode.Text;
            endUser.Password = this.txtPassword.Text;
            endUser.ContactInformation.Email = this.txtEmail.Text;
            endUser.ContactInformation.Phone = this.txtPhone.Text;
            endUser.IsSubscribed = this.chkNewsletter.Checked;

            processUser.EndUser = endUser;

            try
            {
                processUser.Invoke();
            }
            catch(Exception ex)
            {
                Response.Redirect("ErrorPage.aspx");
            }

            CurrentEndUser = processUser.EndUser;

            if (Request.Cookies["ReturnUrl"].Value != null)
            {
                Response.Redirect(Request.Cookies["ReturnUrl"].Value);
            }
            else
            {
                Response.Redirect("Login.aspx");
            }

        }
    }