public ActionResult DeleteUser([DataSourceRequest] DataSourceRequest request, User user) { if (user != null) { DataProvider.Delete(user); } return Json(new[] { user }.ToDataSourceResult(request, ModelState)); }
public ActionResult UpdateUser([DataSourceRequest] DataSourceRequest request, User user) { if (user != null && ModelState.IsValid) { DataProvider.Update(user); } return Json(new[] { user }.ToDataSourceResult(request, ModelState)); }
public bool Authenticate(Credentials credentials) { string connectionString = CreateConnectionString(credentials.Username, credentials.Password); var provider = new MsSqlDataProvider(connectionString); if (provider.TestConnection()) { dataProvider = provider; User = provider.GetItem(new UserDataFilter { Login = credentials.Username }); return true; } return false; }