Esempio n. 1
0
        public async Task <IActionResult> TrainingListForSelectedDate([FromBody] CurrentDisplayedDate currentDisplayedDate)
        {
            string userName = DebugAuth.getUserName(User);
            var    list     = await _trainingService.TrainingListForSelectedDate(currentDisplayedDate, userName);

            return(Ok(new
            {
                data = list,
                date = currentDisplayedDate.currentDate
            }));
        }
Esempio n. 2
0
        public async Task <IActionResult> UploadTrainingFromGpxFile(IFormFile FilePayload)
        {
            try
            {
                await _trainingService.InsertTraining(FilePayload, DebugAuth.getUserName(User));

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> TrainingList()
        {
            string userName = DebugAuth.getUserName(User);

            try
            {
                var trainingList = await _trainingService.TrainingList(userName);

                return(Ok(trainingList));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }