Beispiel #1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            labelInfo.Text = "";

            NoodleTokenClient noodleTokenClient = new NoodleTokenClient(Config.Url, null, 0);

            UserPasswordCheckRequest userPasswordCheckRequest = new UserPasswordCheckRequest();

            userPasswordCheckRequest.ClientRequestNo = Guid.NewGuid().ToString("N");
            userPasswordCheckRequest.Nick            = textBoxUser.Text;
            userPasswordCheckRequest.Password        = textBoxPassword.Text;
            long userId = noodleTokenClient.DoPost(userPasswordCheckRequest);

            noodleTokenClient = new NoodleTokenClient(Config.Url, null, userId);
            UserInfoQueryRequest userInfoQueryRequest = new UserInfoQueryRequest();

            userInfoQueryRequest.ClientRequestNo = Guid.NewGuid().ToString("N");
            UserInfoQueryDto userInfoQueryDto = noodleTokenClient.DoPost(userInfoQueryRequest);

            //记录登录用户信息
            initUserInfo(userInfoQueryDto);

            //关闭登录窗口
            this.DialogResult = DialogResult.OK;
        }
Beispiel #2
0
        private void FormVocabulary_Load(object sender, EventArgs e)
        {
            _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);

            DictionaryListRequest request = new DictionaryListRequest();

            request.ClientRequestNo = Guid.NewGuid().ToString("N");

            List <Dictionary> dictionaries = _noodleTokenClient.DoPost(request);

            _dtDictionary = DataTableHelper.ToDataTable <Dictionary>(dictionaries);

            dataGridViewDictionary.DataSource = _dtDictionary;
        }
Beispiel #3
0
        private void FormWords_Load(object sender, EventArgs e)
        {
            this.KeyPreview = true;

            _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);

            DictionaryListRequest request = new DictionaryListRequest();

            request.ClientRequestNo = Guid.NewGuid().ToString("N");

            List <Dictionary> dictionaries = _noodleTokenClient.DoPost(request);

            _dtDictionary = DataTableHelper.ToDataTable <Dictionary>(dictionaries);

            comboBoxDictionary.DataSource    = _dtDictionary;
            comboBoxDictionary.DisplayMember = "Name";
        }
Beispiel #4
0
        private void FormExerciseScore_Load(object sender, EventArgs e)
        {
            _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);

            ExerciseWordsRequest request = new ExerciseWordsRequest();

            request.ClientRequestNo = Guid.NewGuid().ToString("N");
            request.ExerciseId      = _exerciseId;
            List <ExerciseWordsDto> exerciseWordsList = _noodleTokenClient.DoPost(request);

            foreach (ExerciseWordsDto exerciseWordsDto in exerciseWordsList)
            {
                exerciseWordsDto.Correct = 1;
            }
            _dtExerciseWords = DataTableHelper.ToDataTable <ExerciseWordsDto>(exerciseWordsList);

            dataGridViewWords.DataSource = _dtExerciseWords;
        }
        private void FormReviewSelect_Load(object sender, EventArgs e)
        {
            _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);

            RefreshData();
        }
        private void FormExercise_Load(object sender, EventArgs e)
        {
            _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);

            refreshData();
        }
Beispiel #7
0
 private void FormDictionarySelect_Load(object sender, EventArgs e)
 {
     _noodleTokenClient = new NoodleTokenClient(Config.Url, UserInfo.Token, UserInfo.Id);
 }