예제 #1
0
        public void TestGetSupervisorBySupervisorId()
        {
            int supervisorId        = 1;
            AddressBookModule abMod = new AddressBookModule();
            SupervisorView    view  = abMod.AddressBook.Query().GetSupervisorBySupervisorId(supervisorId);

            Assert.Equal(view.ParentSupervisorName.ToUpper().ToString(), "PAM NISHIMOTO".ToString());
        }
예제 #2
0
        public async Task <SupervisorView> GetSupervisorBySupervisorId(long supervisorId)
        {
            try
            {
                Supervisor supervisor = await base.GetObjectAsync(supervisorId);

                Supervisor parentSupervisor   = null;
                long       parentSupervisorId = supervisor.ParentSupervisorId ?? 0;
                if (parentSupervisorId != 0)
                {
                    parentSupervisor = await base.GetObjectAsync(parentSupervisorId);
                }

                SupervisorView view = applicationViewFactory.MapSupervisorView(supervisor, parentSupervisor);


                return(view);
            }
            catch (Exception ex) { throw new Exception(GetMyMethodName(), ex); }
        }