Пример #1
0
        public void DoExeRun(string id, double distance, double height, double weight, int age)
        {
            var person = people.FirstOrDefault(p => p.Id == id);

            if (person == null)
            {
                Console.WriteLine("Пользователь не найден");
                return;
            }

            var caloriesRun = _exerciseManager.Run(distance, person.Height, person.Weights, person.Age);

            var result2 = new Result
            {
                Date     = DateTime.Now,
                Type     = ExerciseType.Run,
                Colories = _exerciseManager.Run(distance, person.Height, person.Weights, person.Age)
            };

            person.ColoriesPerDay.Add(result2);
        }
Пример #2
0
        public void DoExerciseRun(string id, double distance)
        {
            var user = ChooseUserById(id);

            if (user == null)
            {
                Console.WriteLine("User not found");
                return;
            }
            var result = new Result
            {
                Date     = DateTime.Now,
                Type     = ExerciseType.Run,
                Calories = _exerciseManager.Run(distance, user.Weight)
            };

            user.CaloriesPerDay.Add(result);
        }