Represents a teacher server service.
Наследование: ServerServiceBase
 public void TestInitialize()
 {
     this.service = new TeacherServerService();
 }
 public void TestCleanup()
 {
     this.service = null;
 }
Пример #3
0
        /// <summary>
        /// Updates a teacher.
        /// </summary>
        /// <param name="itemToSave">The item to save.</param>
        /// <returns>The result.</returns>
        public ResultDto UpdateTeacher(TeacherEditDto itemToSave)
        {
            this.SetResponseHeaderCacheExpiration();

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

            TeacherServerService service = new TeacherServerService();
            return service.UpdateTeacher(itemToSave, accountId);
        }
Пример #4
0
        /// <summary>
        /// Deletes a teacher.
        /// </summary>
        /// <param name="idToDelete">The identifier.</param>
        /// <returns>The result.</returns>
        public ResultDto DeleteTeacher(IdDto idToDelete)
        {
            this.SetResponseHeaderCacheExpiration();

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

            TeacherServerService service = new TeacherServerService();
            return service.DeleteTeacher(idToDelete.Id, accountId);
        }
Пример #5
0
        /// <summary>
        /// Returns the teacher lookup.
        /// </summary>
        /// <returns>The teacher lookup.</returns>
        public List<TeacherLookupDto> GetTeacherLookup()
        {
            this.SetResponseHeaderCacheExpiration();

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

            TeacherServerService service = new TeacherServerService();
            return service.GetTeacherLookup(accountId);
        }