Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: ColtW/UI
        public void btnSignUp_Click(object sender, EventArgs e)
        {
            TeamBWindowsFormSignupPage.SignupPage signup = new TeamBWindowsFormSignupPage.SignupPage();
            signup.Activate();
            signup.Visible = true;
            this.Visible   = false;

            UIdll.RegisteredCustomer newPerson = new UIdll.RegisteredCustomer();
            newPerson.MakeRegisteredCustomer();
        }
Exemplo n.º 2
0
    {//Colt isn't claiming this class but offering suggestions based on what I did in the Person superclass
     //check out my fields I declared in Person, make an operator object, and set the fields accordingly.

        public void MakeRegisteredCustomer()
        {
            //make this class talk with the window form for customers
            RegisteredCustomer mrc = new RegisteredCustomer();

            mrc.securityClearenceLevel = 2;

            mrc.username = "******";

            mrc.name = "";

            mrc.password = "******";
            mrc.email    = "";
        }
Exemplo n.º 3
0
Arquivo: Form1.cs Projeto: ColtW/UI
        public void btnSignUp_Click(object sender, EventArgs e)
        {
            // when button clicked this will save all of the text the EU has provided... Colin
            UIdll.RegisteredCustomer newCustomer = new UIdll.RegisteredCustomer();
            newCustomer.username         = txtUsername.Text;
            newCustomer.password         = txtPassword.Text;
            newCustomer.email            = txtEmail.Text;
            newCustomer.creditCardNumber = txtCreditCard.Text;
            newCustomer.plateNumber      = txtLicensePlate.Text;
            newCustomer.MakeCustomer();

            if (txtPassword.Text == txtConfirmPassword.Text)
            {
                newCustomer.password = txtPassword.Text;
                TeamBWindowsFormLoginPage.LoginPage goBackToSignup = new TeamBWindowsFormLoginPage.LoginPage();
                this.Visible = false;
                goBackToSignup.Activate();
                goBackToSignup.Visible = true;

                // Following code will add the customer and all their information to the customer database
                SqlConnection connection = new SqlConnection();
                connection.ConnectionString = "Server=cis1.actx.edu;Database=project2;User Id=db2;Password = db20;";
                connection.Open();

                using (SqlCommand addCustomer = connection.CreateCommand())
                {
                    addCustomer.CommandText = "insert into dbo.Customers (FirstName, LastName, EmailAddress, CreditCardNumber, Username, Password, LicensePlateNumber) values ('"
                                              + txtFirstName.Text + "','"
                                              + txtLastName.Text + "','"
                                              + txtEmail.Text + "','"
                                              + int.Parse(txtCreditCard.Text) + "','"
                                              + txtUsername.Text + "','"
                                              + txtPassword.Text + "',"
                                              + txtLicensePlate.Text + "');";
                    addCustomer.ExecuteNonQuery();
                }
            }
            else
            {
                MessageBox.Show("Password verification failed.  Re-enter password.");
                txtPassword.Text        = "";
                txtConfirmPassword.Text = "";
            }

            if (chkIfGuest.Checked == true)
            {
                guestList.Add(1);
                Console.WriteLine(guestList);
                UIdll.Customer guest = new UIdll.Customer();
                guest.MakeCustomer();
                guest.name     = txtFirstName.Text + " " + txtLastName.Text;
                guest.username = txtUsername.Text;

                if (txtPassword.Text == txtConfirmPassword.Text)
                {
                    guest.password = txtPassword.Text;
                    TeamBWindowsFormLoginPage.LoginPage goBackToSignup = new TeamBWindowsFormLoginPage.LoginPage();
                    this.Visible = false;
                    goBackToSignup.Activate();
                    goBackToSignup.Visible = true;
                }
                else
                {
                    MessageBox.Show("Password verification failed.  Re-enter password.");
                    txtPassword.Text        = "";
                    txtConfirmPassword.Text = "";
                }

                guest.email            = txtEmail.Text;
                guest.creditCardNumber = txtCreditCard.Text;
                guest.plateNumber      = txtLicensePlate.Text;


                //    //MessageBox.Show(guestList.ToString());
                //    if(textBox1.Text != "")
                //    {
                //        if(textBox2.Text != "")
                //        {
                //            if(textBox4.Text != "")
                //            {
                //                button1.Enabled = true;
                //            }
                //            else
                //            {
                //                MessageBox.Show("Please fill out necessary information.");
                //            }
                //        }
                //        else
                //        {
                //            MessageBox.Show("Please fill out necessary information.");
                //        }
                //    }
                //    else
                //    {
                //        MessageBox.Show("Please fill out necessary information.");
                //    }
            }
        }