Last active
August 29, 2015 14:06
-
-
Save pkuderov/fedd201fd92c3aa3827b to your computer and use it in GitHub Desktop.
UpdateConfiguration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<ActionResult> UpdateConfiguration(string login, string password) | |
{ | |
if (String.IsNullOrWhiteSpace(login) || String.IsNullOrWhiteSpace(password)) | |
return RedirectToAction("Index"); | |
var currentUserId = CurrentUserId; | |
var siteAccount = await SharedDbContext.SiteAccounts | |
.FirstOrDefaultAsync(sa => sa.OwnerId == currentUserId && sa.AccountType == SiteAccountType.Responses); | |
if (siteAccount == null) | |
return RedirectToAction("Index"); | |
siteAccount.Login = login; | |
siteAccount.Password = password; | |
await SharedDbContext.SaveChangesAsync(); | |
return RedirectToAction("Index"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment