private void button1_Click(object sender, EventArgs e) { requestUser open = new requestUser(); open.Show(); this.Close(); }
public async Task <ActionResult <requestUser> > Register([FromBody] requestUser user) { var _user = await db.users.FirstOrDefaultAsync(x => x.UserName == user.UserName); var __user = await db.usersrequests.FirstOrDefaultAsync(x => x.UserName == user.UserName); if (_user != null || __user != null) { return(BadRequest(new { errorText = "Такой аккаунт уже есть, либо вы уже подали заявку." })); } SHA256 hash = SHA256.Create(); user.Password = string.Concat(hash.ComputeHash(Encoding.UTF8.GetBytes(user.Password)).Select(x => x.ToString("X2"))); await db.usersrequests.AddAsync(user); await db.SaveChangesAsync(); return(user); }