コード例 #1
0
    private void BtnResigter()
    {
        genderValue = ToggleValue.GetComponent <ToggleGroupValue>().GetToggleValue();


        Debug.Log("账号:" + Account.text + "  密码:" + Password.text + "性别" + genderValue + "年龄" + Age.text);
        if (!Check())
        {
            return;
        }
        ReRegister ret = SQLController.Instance.Register(Account.text.Trim(), Password.text.Trim(), Age.text.Trim(), genderValue.Trim());

        if (ret == ReRegister.Have)
        {
            RegisterHave();
        }
        else if (ret == ReRegister.Fail)
        {
            RegisterFail();
        }
        else if (ret == ReRegister.Success)
        {
            StartCoroutine(RegisterSuccess("注册成功"));
        }
        else
        {
        }
    }
コード例 #2
0
        public async Task <IActionResult> ReRegisterConference_Application(
            [FromQuery] string apikey,
            [FromBody] ReRegister reregister,
            [FromHeader(Name = "jwttoken")] string jwttoken,
            [FromHeader(Name = "conference_id")] int conferenceID)
        {
            // Permission Level Admin
            if (this.jwtService.PermissionLevelValid(jwttoken, "admin") && this.auth.KeyIsValid(apikey))
            {
                var currentCA = await this._context.Conference_Application.Where(ca => ca.ApplicantUID == reregister.OldUID &&
                                                                                 ca.ConferenceID == conferenceID &&
                                                                                 ca.Invalid == false).FirstOrDefaultAsync();

                string  responsibleUID = this.jwtService.GetUIDfromJwtKey(jwttoken);
                History history        = new History
                {
                    ResponsibleUID = responsibleUID,
                    User           = this._context.User.FindAsync(responsibleUID).Result,
                    OldValue       = currentCA.ToString(),
                    HistoryType    = "Edit"
                };
                currentCA.Invalid = true;
                Conference_Application newCA = new Conference_Application
                {
                    ConferenceID = conferenceID,
                    Conference   = this._context.Conference.FindAsync(conferenceID).Result,
                    ApplicantUID = reregister.NewUID,
                    User         = this._context.User.FindAsync(reregister.NewUID).Result,
                };

                this._context.Conference_Application.Add(newCA);

                try
                {
                    await this._context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!this.Conference_ApplicationExists(newCA.ApplicantUID, newCA.ConferenceID))
                    {
                        return(this.NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                return(this.Ok());
            }

            return(this.Unauthorized());
        }