Esempio n. 1
0
 private void mNewSet_Click(object sender, EventArgs e)
 {
     NewSetEventArgs args = new NewSetEventArgs();
     args.Reps = 0;
     args.Weight = 0;
     args.Notes = "";
     AddSet(null, args);
     GetSets(null, EventArgs.Empty);
 }
Esempio n. 2
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     NewSetEventArgs args = new NewSetEventArgs();
     args.Reps = 0;
     args.Weight = 0;
     args.Notes = "";
     CopySet(args);
 }
Esempio n. 3
0
 private void AddSet(object sender, NewSetEventArgs e)
 {
     string sql = "INSERT INTO tblWoSets (idWorkoutExercise, idExerciseType, Reps, Weight, Notes) " +
                  "VALUES(@idWorkoutExercise, @idExerciseType, @reps, @weight, @notes)";
     SqlCommand cmd = Global.conn1.CreateCommand();
     cmd.Parameters.AddWithValue("@idWorkoutExercise", IdExercise);
     cmd.Parameters.AddWithValue("@idExerciseType", IdExerciseType);
     cmd.Parameters.AddWithValue("@reps", e.Reps);
     cmd.Parameters.AddWithValue("@weight", e.Weight);
     cmd.Parameters.AddWithValue("@notes", e.Notes);
     cmd.CommandText = sql;
     if (Global.conn1.State != ConnectionState.Open)
         Global.conn1.Open();
     cmd.ExecuteNonQuery();
     Global.conn1.Close();
     GetSets(null, EventArgs.Empty);
 }
Esempio n. 4
0
 protected virtual void CopySet(NewSetEventArgs e)
 {
     EventHandler<NewSetEventArgs> handler = CopySetEvent;
     if (handler != null)
         handler(this, e);
 }