Esempio n. 1
0
        public async Task <IHttpActionResult> Suggestion([FromBody] AuthorizedUser authorizedUser)
        {
            this.authenticateUser(authorizedUser);
            UserAccount retrievedUser = await authorizedUser.getUserAccount(db).ConfigureAwait(false);

            await retrievedUser.Login().ConfigureAwait(false);

            TilerUser tilerUser = retrievedUser.getTilerUser();

            tilerUser.updateTimeZoneTimeSpan(authorizedUser.getTimeSpan);
            if (retrievedUser.Status)
            {
                DateTimeOffset nowTime = authorizedUser.getRefNow();
                if (retrievedUser.ScheduleLogControl.Now == null)
                {
                    var         retrievalOption = DataRetrievalSet.analysisManipulation;
                    DB_Schedule schedule        = new DB_Schedule(retrievedUser, nowTime, authorizedUser.getCurrentLocation(), retrievalOptions: retrievalOption);
                    retrievedUser.ScheduleLogControl.Now = schedule.Now;
                }

                await SuggestionAnalysis(retrievedUser.ScheduleLogControl, authorizedUser.getCurrentLocation()).ConfigureAwait(false);
            }

            var retValue = new PostBackData("", 0);

            return(Ok(retValue.getPostBack));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> GetCalEvent(string id, [FromUri] AuthorizedUser myUser)
        {
            UserAccount retrievedUser = await myUser.getUserAccount(db);

            await retrievedUser.Login();

            TilerElements.CalendarEvent retrievedCalendarEvent = await retrievedUser.ScheduleLogControl.getCalendarEventWithID(id);

            PostBackData retValue = new PostBackData(retrievedCalendarEvent.ToCalEvent(), 0);


            return(Ok(retValue.getPostBack));
        }