/// <summary> /// Gets the user parameters passed on from the loginvm and loads the correct table paramaeters /// </summary> void GetUserCredentials() { UserCredentials = _ServiceProxy.VerifyLogin(Logger.UserId); if (UserCredentials != null) { UserFullName = UserCredentials.Name + " " + UserCredentials.Surname; RaisePropertyChanged("UserFullName"); AccessName = _ServiceProxy.GetLevel(UserCredentials.UserLevelId); RaisePropertyChanged("AccessName"); if (UserCredentials.UserLevelId < 4) { ManagementAccess = true; foreach (var item in _ServiceProxy.GetUserTables()) { AllUserTables.Add(item); } } else { ManagementAccess = false; foreach (var item in _ServiceProxy.GetUserTables(UserCredentials.UserId)) { AllUserTables.Add(item); } } } GetUserTables(); }
void GetUserTables() { AllUserTables.Clear(); if (ManagementAccess == true) { foreach (var item in _ServiceProxy.GetUserTables()) { AllUserTables.Add(item); } } else { foreach (var item in _ServiceProxy.GetUserTables(UserCredentials.UserId)) { AllUserTables.Add(item); } } }