Beispiel #1
0
        public async Task <ActionResult> Edit(string id, UserViewModel viewModel)
        {
            try
            {
                // TODO: Add update logic here
                IdentityUser rawUser = _userAdminManager.FindById(id);
                rawUser.UserName = viewModel.UserName;
                rawUser.Email    = viewModel.UserName;
                await _userAdminManager.Update(viewModel.Role, rawUser).ConfigureAwait(false);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            Result result = _userAdminManager.Update(new UserAdmin
            {
                Id       = int.Parse(txtId.Text),
                Password = txtPassword.Text,
                UserName = txtUserName.Text
            });

            if (result.ResultState == ResultState.Erorr)
            {
                MessageBox.Show(result.Message, "Hata işlem yapılamadı");
            }
            else
            {
                DataGridFill();
                TextboxClear();
            }
        }