protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            EndUser endUser = new EndUser();
            ProcessAdminLogin processLogin = new ProcessAdminLogin();

            endUser.ContactInformation.Email = this.txtUserName.Text;
            endUser.Password = this.txtPassword.Text;
            processLogin.EndUser = endUser;

            try
            {
                processLogin.Invoke();
                if (processLogin.IsAuthenticated)
                {
                    FormsAuthentication.RedirectFromLoginPage(this.txtUserName.Text, false);
                }
                else
                {
                    this.litMessage.Text = "Invalid Login";
                }
            }
            catch
            {
                Response.Redirect("../ErrorPage.aspx");
            }
        }
    }
Exemple #2
0
 public Orders()
 {
     _creditCard = new CreditCard();
     _orderDetails = new OrderDetails();
     _endUser = new EndUser();
     _shippingAddress = new Address();
 }
    private void UnsubscribeCustomer()
    {
        ProcessNewsletterUnsubscribe unsubscribe = new ProcessNewsletterUnsubscribe();
        EndUser endUser = new EndUser();
        endUser.EndUserId = int.Parse( Request.QueryString["EndUserID"] );

        unsubscribe.EndUser = endUser;

        try
        {
            unsubscribe.Invoke();
        }
        catch
        {
            Response.Redirect( "../ErrorPage.aspx" );
        }
    }
    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");
            }

        }
    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            EndUser endUser = new EndUser();
            ProcessEndUserLogin processLogin = new ProcessEndUserLogin();
            endUser.ContactInformation.Email = txtUsername.Text;
            endUser.Password = txtPassword.Text;
            processLogin.EndUser = endUser;

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

            if (processLogin.IsAuthenticated)
            {
                base.CurrentEndUser = processLogin.EndUser;

                if (Request.Cookies["ReturnUrl"] != null)
                {
                    Response.Redirect(Request.Cookies["ReturnUrl"].Value);
                }
                else
                {
                    Response.Redirect("Account/CustomerOrder.aspx");
                }
            }
            else
            {
                this.litMessage.Text = "Invalid Login!";
            }
        }
    }
 public OrdersSelectDataParameters(EndUser endUser)
 {
     EndUser = endUser;
     this.Build();
 }
 public EndUserLoginSelectDataParameters(EndUser endUser)
 {
     EndUser = endUser;
     this.Build();
 }
 public NewsletterUpdateDataParameters(EndUser endUser)
 {
     EndUser = endUser;
     this.Build();
 }