public void InsertTest() { WorkoutType workoutType = new WorkoutType(); workoutType.Id = Guid.NewGuid(); workoutType.Name = "Testing"; workoutType.CaloriesPerMinute = 50; int results = WorkoutTypeManager.Insert(workoutType, true); Assert.IsTrue(results > 0); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (logger.IsWarnEnabled) { logger.Warn(txtWorkoutName.Text); } workout.Name = txtWorkoutName.Text; workout.CaloriesPerMinute = Int32.Parse(txtWorkoutCalories.Text); int result = WorkoutTypeManager.Insert(workout); Reload(); if (result == 1) { MessageBox.Show("Success!"); } else { MessageBox.Show("Failure"); } }
// POST api/values public int Post([FromBody] WorkoutType value) { return(WorkoutTypeManager.Insert(value)); }