private void LoginUserLoaded(LoadOperation<User> result) { if (result.Error == null) { Login.LoginUser = null; foreach (User user in result.Entities) Login.LoginUser = user; if (Login.LoginUser != null) { SmartMap_DomainContext context = new SmartMap_DomainContext(); LoadOperation loadOp = context.Load(context.GetRolePermissionsQuery(Login.LoginUser.RoleID), PermissionsLoaded, null); } else { if (_loadingAnm != null) _loadingAnm.Visibility = Visibility.Collapsed; MessageBox.Show("Incorrect Username or password."); } } else { if (_loadingAnm != null) _loadingAnm.Visibility = Visibility.Collapsed; string msg = result.Error.Message; if (result.Error.InnerException != null) msg += ("Inner: \n" + result.Error.InnerException.Message); MessageBox.Show("Custom Error Handler:\n"+ msg); } }
private void UserLaoded(LoadOperation<User> result) { Login.LoginUser = null; foreach (User user in result.Entities) Login.LoginUser = user; if (Login.LoginUser != null) { SmartMap_DomainContext context = new SmartMap_DomainContext(); LoadOperation loadOp = context.Load(context.GetRolePermissionsQuery(Login.LoginUser.RoleID), PermissionsLoaded, null); } }