Represents a lesson server service.
상속: ServerServiceBase
예제 #1
0
        /// <summary>
        /// Deletes a lesson.
        /// </summary>
        /// <param name="idToDelete">The identifier.</param>
        /// <returns>The result.</returns>
        public ResultDto DeleteLesson(IdDto idToDelete)
        {
            this.SetResponseHeaderCacheExpiration();

            AccountPassword credentials = this.GetCredentialsFromRequest();
            AccountServerService accountService = new AccountServerService();
            Guid accountId = accountService.GetAccountId(credentials.Account);

            LessonServerService service = new LessonServerService();
            return service.DeleteLesson(idToDelete.Id, accountId);
        }
예제 #2
0
        /// <summary>
        /// Returns the lessons of a week.
        /// </summary>
        /// <returns>The lessons.</returns>
        public List<LessonEditDto> GetLessonOfWeek()
        {
            this.SetResponseHeaderCacheExpiration();

            AccountPassword credentials = this.GetCredentialsFromRequest();
            AccountServerService accountService = new AccountServerService();
            Guid accountId = accountService.GetAccountId(credentials.Account);

            LessonServerService service = new LessonServerService();
            return service.GetLessonsOfWeek(accountId);
        }
예제 #3
0
        /// <summary>
        /// Updates a lesson.
        /// </summary>
        /// <param name="itemToSave">The item to save.</param>
        /// <returns></returns>
        public ResultDto UpdateLesson(LessonEditDto itemToSave)
        {
            this.SetResponseHeaderCacheExpiration();

            AccountPassword credentials = this.GetCredentialsFromRequest();
            AccountServerService accountService = new AccountServerService();
            Guid accountId = accountService.GetAccountId(credentials.Account);

            LessonServerService service = new LessonServerService();
            return service.InsertUpdateLesson(itemToSave, accountId);
        }
예제 #4
0
        /// <summary>
        /// Returns the lesson of a day to display.
        /// </summary>
        /// <param name="id">The day identifier.</param>
        /// <returns>The lessons.</returns>
        public List<LessonDisplayDto> GetLessonOfDayToDisplay(string id)
        {
            this.SetResponseHeaderCacheExpiration();

            AccountPassword credentials = this.GetCredentialsFromRequest();
            AccountServerService accountService = new AccountServerService();
            Guid accountId = accountService.GetAccountId(credentials.Account);

            LessonServerService service = new LessonServerService();
            return service.GetLessonsOfDayToDisplay(new Guid(id), accountId);
        }