public void CreateTraining(TrainingForDetail training)
        {
            List <TrainingForDetail> trainings = GetTrainings();

            trainings.Add(training);
            SaveTrainings(trainings);
        }
        public void UpdateTraining(TrainingForDetail training)
        {
            List <TrainingForDetail> trainings = GetTrainings();

            TrainingForDetail t = trainings.Find(x => x.Date == training.Date);

            t = training;
            SaveTrainings(trainings);
        }
Exemple #3
0
        public static TrainingModel Convert(this TrainingForDetail training)
        {
            if (training == null)
            {
                return(null);
            }

            return(new TrainingModel
            {
                Name = training.Name,
                Date = training.Date,
                Notes = training.Notes,
                Score = training.Score,
                TimeCap = training.TimeCap,
                Type = training.Type
            });
        }
Exemple #4
0
        public void UpdateTraining(TrainingForDetail training)
        {
            DataManagement api = new DataManagement(URL_BASE);

            Dictionary <string, string> header = new Dictionary <string, string>
            {
                { "Authorization", "Bearer " + Token }
            };

            Dictionary <string, object> userData = new Dictionary <string, object>
            {
                { "name", training.Name },
                { "date", training.Date },
                { "type", training.Type },
                { "time_cap", training.Name },
                { "score", training.Score },
                { "notes", training.Notes },
            };

            var content = new StringContent(JsonConvert.SerializeObject(userData), Encoding.UTF8, "application/json");

            api.SendPut("/trainings", content, header);
        }
 public void UpdateTraining(TrainingForDetail training)
 {
     this._wsWodBoard.UpdateTraining(training);
 }
 public void CreateTraining(TrainingForDetail training)
 {
     this._wsWodBoard.CreateTraining(training);
 }