Пример #1
0
        /// <summary>
        /// 交互(针对于所有用户)
        /// </summary>
        /// <param name="currentUser">当前用户</param>
        /// <param name="cmd">可执行命令</param>
        /// <returns></returns>
        private static UserCore RunForUser(UserCore currentUser, Command cmd)
        {
            UserCore user = null;

            switch (cmd)
            {
            case Command.GetHelp:
                currentUser.GetHelp();
                break;

            case Command.SwitchUser:
                user = currentUser.SwitchUser();
                break;

            case Command.ShowMe:
                currentUser.ViewPersonalInformation();
                break;

            case Command.ChangePasswd:
                currentUser.CallChangeMyPasswd();
                break;

            case Command.ChangeAge:
                currentUser.CallChangeMyAge();
                break;

            case Command.ChangeAddress:
                currentUser.ChangeMyAddress();
                break;

            case Command.ChangeSex:
                currentUser.ChangeMySex();
                break;

            case Command.ViewMyHistory:
                currentUser.ViewMyHistory();
                break;

            case Command.ViewCurriculums:
                currentUser.ViewCurriculum();
                break;

            case Command.ViewHeadTeacher:
                currentUser.ViewTheInformationOfTheHeadteacher();
                break;

            case Command.LeaveAMessage:
                currentUser.LeaveAMessage();
                break;     //Todo:

            case Command.ViewLeaveMessages:
                currentUser.ViewTheLeaveMessages();
                break;     //Todo:

            case Command.Exit:
                currentUser.LogOut();
                _appState = State.Off;
                break;

            case Command.UrlTest:
                currentUser.UrlTest();
                break;

            default:
                Ui.DisplayTheInformationOfErrorCode(ErrorCode.NotACommand, cmd.ToString());
                break;
            }
            return(user);
        }