Esempio n. 1
0
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            OleDbCommand cmd = new OleDbCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "insert into [user] ([username],[pass],[weight]) values (?,?,?)";
            cmd.Parameters.AddWithValue("@username", textBox.Text);
            cmd.Parameters.AddWithValue("@pass", textBox1.Text);
            cmd.Parameters.AddWithValue("@weight", textBox2.Text);

            cmd.Connection = conn;
            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
            Pages.instrumentsPage instruments = new instrumentsPage();
            this.NavigationService.Navigate(instruments);
        }
Esempio n. 2
0
 private void button5_Click(object sender, RoutedEventArgs e)
 {
     if (gymGuestPage.current_user_id == null)
     {
         Pages.gymGuestPage gmGst = new gymGuestPage();
         this.NavigationService.Navigate(gmGst);
     }
     else if (controlPage.employee)
     {
         Pages.instrumentsPage instr = new instrumentsPage();
         this.NavigationService.Navigate(instr);
     }
     else
     {
         Pages.instrumentsPage instr = new instrumentsPage();
         this.NavigationService.Navigate(instr);
     }
 }
Esempio n. 3
0
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            conn.Open();

            String          query = "Select id,username from [user] where username='******'  and pass='******'";
            OleDbCommand    cmd   = new OleDbCommand(query, conn);
            OleDbDataReader rdr   = cmd.ExecuteReader();

            if (rdr.Read())
            {
                gymGuestPage.current_user_id = rdr.GetValue(1).ToString();
                Pages.instrumentsPage instruments = new instrumentsPage();
                this.NavigationService.Navigate(instruments);
            }
            else
            {
                MessageBox.Show("Δεν βρέθηκε χρήστης με αυτά τα στοιχεία !");
            }
            conn.Close();
        }
Esempio n. 4
0
 private void help(object sender, RoutedEventArgs e)
 {
     Pages.instrumentsPage instruments = new instrumentsPage();
     this.NavigationService.Navigate(instruments);
 }