Exemplo n.º 1
0
 public void UpdateWorkOutDefinition(WorkOutDefinitionRow workOutDefinitionRow)
 {
     using (var connection = DependencyService.Get <ISQLite>().GetConnection())
     {
         connection.Update(workOutDefinitionRow);
     }
 }
Exemplo n.º 2
0
        private IWorkoutDefinitionViewModel CreateWorkOutDefinition(WorkOutDefinitionRow workOut)
        {
            var workoutDefinition = App.Container.Resolve <IWorkoutDefinitionViewModel>();

            workoutDefinition.WorkOutId          = workOut.WorkOutDefinitionId;
            workoutDefinition.NumberOfWarmUpSets = workOut.NumberOfWarmUpSets;
            workoutDefinition.WarmUpRepetitions  = workOut.WarmUpRepetitions;
            workoutDefinition.WarmUpWeight       = workOut.WarmUpWeight;
            workoutDefinition.NumberOfSets       = workOut.NumberOfSets;
            workoutDefinition.WorkOutName        = workOut.WorkOutName;
            workoutDefinition.Repetitions        = workOut.Repetitions;
            workoutDefinition.Weight             = workOut.Weight;

            return(workoutDefinition);
        }
Exemplo n.º 3
0
        public void AddWorkOutDefinition(IWorkoutDefinitionViewModel workoutDefinition)
        {
            using (var connection = DependencyService.Get <ISQLite>().GetConnection())
            {
                var workOutDefinitionRow = new WorkOutDefinitionRow
                {
                    WorkOutName        = workoutDefinition.WorkOutName,
                    NumberOfWarmUpSets = workoutDefinition.NumberOfWarmUpSets,
                    WarmUpRepetitions  = workoutDefinition.WarmUpRepetitions,
                    WarmUpWeight       = workoutDefinition.WarmUpWeight,
                    NumberOfSets       = workoutDefinition.NumberOfSets,
                    Repetitions        = workoutDefinition.Repetitions,
                    Weight             = workoutDefinition.Weight
                };

                connection.Insert(workOutDefinitionRow);

                workoutDefinition.WorkOutId = workOutDefinitionRow.WorkOutDefinitionId;
            }
        }