示例#1
0
 private void pictureBox5_Click(object sender, EventArgs e)
 {
     Hide();
     if (sex == 1)
     {
         men M = new men(user, name);
         M.Show();
     }
     else
     {
         women W = new women(user, name);
         W.Show();
     }
 }
示例#2
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     Hide();
     if (G2 == 1)
     {
         men M = new men(A2, N2);
         M.Show();
     }
     else
     {
         women W = new women(A2, N2);
         W.Show();
     }
 }
示例#3
0
 private void pictureBox13_Click(object sender, EventArgs e)
 {
     Hide();
     if (gender == 2)
     {
         women F4 = new women(userr, name);
         F4.Show();
     }
     else
     {
         men F3 = new men(userr, name);
         F3.Show();
     }
 }
示例#4
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            string          x    = "BizzyM";
            OleDbConnection conn = new OleDbConnection();

            conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
            conn.Open();
            OleDbCommand comm = new OleDbCommand("UPDATE members SET workout='" + x + "' WHERE user = '******'", conn);

            comm.ExecuteNonQuery();
            conn.Close();
            Hide();
            if (gent == 2)
            {
                women F4 = new women(user, name);
                F4.Show();
            }
            else
            {
                men F3 = new men(user, name);
                F3.Show();
            }
        }
示例#5
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     chk = 0;
     for (int i = 0; i < 14; i++)
     {
         if (arr[i].Checked == true)
         {
             chk++;
         }
     }
     if (chk > lvl)
     {
         if (lvl == 3)
         {
             MessageBox.Show("You have a " + sub + " Subscription you can only pick 3 Courses.", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         }
         else if (lvl == 2)
         {
             MessageBox.Show("You have a " + sub + " Subscription you can only pick 2 Courses.", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         }
         else
         {
             MessageBox.Show("You have a " + sub + " Subscription you can only pick one Course.", "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         }
     }
     else if (chk <= lvl)
     {
         cour = "";
         if (arr[0].Checked)
         {
             cour = cour + "Cardiovescular ";
         }
         if (arr[1].Checked)
         {
             cour = cour + "Strengh ";
         }
         if (arr[2].Checked)
         {
             cour = cour + "Crossfit ";
         }
         if (arr[3].Checked)
         {
             cour = cour + "Water Aerobics ";
         }
         if (arr[4].Checked)
         {
             cour = cour + "Kickboxing ";
         }
         if (arr[5].Checked)
         {
             cour = cour + "Boxing ";
         }
         if (arr[6].Checked)
         {
             cour = cour + "Meditation ";
         }
         if (arr[7].Checked)
         {
             cour = cour + "Spinning ";
         }
         if (arr[8].Checked)
         {
             cour = cour + "Power Yoga ";
         }
         if (arr[9].Checked)
         {
             cour = cour + "Gymnastic ";
         }
         if (arr[10].Checked)
         {
             cour = cour + "Zumba ";
         }
         if (arr[11].Checked)
         {
             cour = cour + "Yoga ";
         }
         if (arr[12].Checked)
         {
             cour = cour + "Abs ";
         }
         if (arr[13].Checked)
         {
             cour = cour + "P.T. ";
         }
         OleDbConnection conn = new OleDbConnection();
         conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
         conn.Open();
         OleDbCommand comm = new OleDbCommand("UPDATE members SET classes='" + cour + "' WHERE user = '******'", conn);
         comm.ExecuteNonQuery();
         conn.Close();
         Hide();
         if (sex == 1)
         {
             men M = new men(user, name);
             M.Show();
         }
         else
         {
             women W = new women(user, name);
             W.Show();
         }
     }
 }
示例#6
0
        private void button2_Click(object sender, EventArgs e)
        {
            string          A;
            OleDbConnection connect = new OleDbConnection();

            connect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
            connect.Open();
            OleDbCommand command = new OleDbCommand();

            command.Connection  = connect;
            command.CommandText = "SELECT user FROM members";
            OleDbConnection connect2 = new OleDbConnection();

            connect2.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
            connect2.Open();
            OleDbCommand command2 = new OleDbCommand();

            command2.Connection  = connect2;
            command2.CommandText = "SELECT firstName FROM members";
            OleDbDataReader reader  = command.ExecuteReader();
            OleDbDataReader reader2 = command2.ExecuteReader();

            while (reader.Read())
            {
                //listBox1.Items.Add(reader["user"].ToString());
                reader2.Read();
                A = reader2["firstName"].ToString();
                if (reader["user"].ToString() == textBox2.Text)
                {
                    String          B        = reader["user"].ToString();
                    OleDbConnection connect1 = new OleDbConnection();
                    connect1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
                    connect1.Open();
                    OleDbCommand command1 = new OleDbCommand();
                    command1.Connection  = connect1;
                    command1.CommandText = "SELECT pass FROM members where user = '******'";
                    OleDbConnection connect3 = new OleDbConnection();
                    connect3.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False;";
                    connect3.Open();
                    OleDbCommand    command3 = new OleDbCommand("SELECT gender FROM members where user = '******'", connect3);
                    OleDbDataReader reader3  = command3.ExecuteReader();
                    OleDbDataReader reader1  = command1.ExecuteReader();
                    while (reader1.Read())
                    {
                        if (reader1["pass"].ToString() == textBox1.Text)
                        {
                            reader3.Read();
                            if (reader3["gender"].ToString() == "F")
                            {
                                Hide();
                                women F4 = new women(B, A);
                                F4.Show();
                            }
                            else
                            {
                                Hide();
                                men F3 = new men(B, A);
                                F3.Show();
                            }
                        }
                        else
                        {
                            MessageBox.Show("The id or password invalid");
                        }
                    }
                }
            }
            connect.Close();
        }