Ejemplo n.º 1
0
        protected void lbtnCreateAccountCustomer_Click(object sender, EventArgs e)
        {
            Account custAccount = new Account();

            custAccount.password    = txtConfirmPass.Text;
            custAccount.accountType = "customer";
            custAccount.firstName   = txtCustomerFName.Text;
            custAccount.lastName    = txtCustomerLName.Text;
            custAccount.email       = txtCustomerEmail.Text;
            custAccount.phoneNumber = txtCustomerPhone.Text;

            NewAccount(custAccount);

            NewAccountService.Account customer = new NewAccountService.Account();

            customer.firstName   = txtCustomerFName.Text;
            customer.lastName    = txtCustomerLName.Text;
            customer.email       = txtCustomerEmail.Text;
            customer.phoneNumber = txtCustomerPhone.Text;


            NewAccountService.NewAccount proxy = new NewAccountService.NewAccount();

            if (proxy.AddCustomer(customer))
            {
                DataSet userData = procedure.getaccountidfromemail(txtCustomerEmail.Text);
                //Email verificationEmail = new Email();
                //string receiveremail = txtCustomerEmail.Text;
                //string senderEmail = "*****@*****.**";
                //string subject = "Verify your account";
                int account = int.Parse(userData.Tables[0].Rows[0]["Account_ID"].ToString());

                //string body = "Please refer to this URL to confirm your account creation. http://localhost:63822/verification.aspx?ID=" + account;
                //verificationEmail.SendMail(receiveremail, senderEmail, subject, body);

                Response.Redirect("verification.aspx?ID=" + account);
                lblStoreName.Text = "Customer Account was created successfully!";
            }
            else
            {
                lblStoreName.Text = "Account was not created D:";
            }
        }
Ejemplo n.º 2
0
        public void NewAccount(Account account)
        {
            NewAccountService.Account AccountInfo = new NewAccountService.Account();

            AccountInfo.password    = account.password;
            AccountInfo.accountType = account.accountType;
            AccountInfo.firstName   = account.firstName;
            AccountInfo.lastName    = account.lastName;
            AccountInfo.email       = account.email;
            AccountInfo.phoneNumber = account.phoneNumber;

            NewAccountService.NewAccount proxy = new NewAccountService.NewAccount();

            if (proxy.AddAccount(AccountInfo))
            {
                lblStoreName.Text = "Account was created successfully!";
            }
            else
            {
                lblStoreName.Text = "Account was not created D:";
            }
        }