private void CompletedCircuit3_Click(object sender, RoutedEventArgs e) { CompletCircuit completCircuit = Utils.CreateCompletedCircuit(user1.Username, ComCircuit.Circuit3, "Circuit 3"); Database.InsertCompletedWorkout(completCircuit); MessageBox.Show("Workout Completed!!"); }
public static void InsertCompletedWorkout(CompletCircuit circuit) { using (var db = new LiteDatabase(GetConnectionString())) { var workoutsCol = db.GetCollection <CompletCircuit>("CompletedCircuit"); workoutsCol.Insert(circuit); } }
public void DeleteCompletedCircuit() { if (workoutDataGrid.SelectedIndex == -1) { return; } CompletCircuit workout = workoutDataGrid.SelectedItem as CompletCircuit; Database.DeleteCompletedCircuit(workout.Id); LoadWorkoutData(); }
public static CompletCircuit CreateCompletedCircuit(string name, Circuit circuit, string circuitName) { Circuit completedCircuit = CreateCircuit(circuit.Station1, circuit.Station2, circuit.Station3); CompletCircuit didWorkout = new CompletCircuit { Name = name, FinishedCircuit = completedCircuit, CircuitName = circuitName }; return(didWorkout); }