コード例 #1
0
        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!!");
        }
コード例 #2
0
ファイル: Helpers.cs プロジェクト: ash051005/WorkoutApp
 public static void InsertCompletedWorkout(CompletCircuit circuit)
 {
     using (var db = new LiteDatabase(GetConnectionString()))
     {
         var workoutsCol = db.GetCollection <CompletCircuit>("CompletedCircuit");
         workoutsCol.Insert(circuit);
     }
 }
コード例 #3
0
        public void DeleteCompletedCircuit()
        {
            if (workoutDataGrid.SelectedIndex == -1)
            {
                return;
            }

            CompletCircuit workout = workoutDataGrid.SelectedItem as CompletCircuit;

            Database.DeleteCompletedCircuit(workout.Id);
            LoadWorkoutData();
        }
コード例 #4
0
ファイル: Helpers.cs プロジェクト: ash051005/WorkoutApp
        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);
        }