/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
public void TestCleanup() { this.service = null; }
public void TestInitialize() { this.service = new LessonServerService(); }