示例#1
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));
        }
示例#2
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));
        }
示例#3
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));
        }
示例#4
0
 public void TestCleanup()
 {
     this.service = null;
 }
示例#5
0
 public void TestInitialize()
 {
     this.service = new TeacherServerService();
 }