Ejemplo n.º 1
0
 private void nameChangeButton_Click(object sender, EventArgs e)
 {
     if (CLNTextBox.Text == "")
     {
         MessageBox.Show("Please Fill in All Information");
     }
     else
     {
         SqlConnection con = new SqlConnection("server=localhost;database=CarDealership;Trusted_Connection=Yes;");
         con.Open();
         string         query = "update customer set customerLN = '" + CLNTextBox.Text + "'where customerid = " + customerid;
         SqlCommand     cmd   = new SqlCommand(query, con);
         SqlDataAdapter da    = new SqlDataAdapter();
         da.InsertCommand = new SqlCommand(query, con);
         da.InsertCommand.ExecuteNonQuery();
         cmd.Dispose();
         con.Close();
         CLNTextBox.Clear();
         MessageBox.Show("Last Name Changed");
     }
 }
Ejemplo n.º 2
0
        private void signUpButton_Click(object sender, EventArgs e)
        {
            string fn    = CFNTextBox.Text;
            string ln    = CLNTextBox.Text;
            string pn    = CPNTextBox.Text;
            string email = CUserTextBox.Text;
            string pass  = CPassTextBox.Text;

            if (fn == "" | ln == "" | pn == "" | email == "" | pass == "")
            {
                MessageBox.Show("Please fill in all information");
            }
            else
            {
                addCustomer();
            }
            CFNTextBox.Clear();
            CLNTextBox.Clear();
            CPNTextBox.Clear();
            CUserTextBox.Clear();
            CPassTextBox.Clear();
        }