public VisibilityAccess CheckPermissions(User CurentUser) { var holder = new VisibilityAccess { //Summary CanViewSummary = CurentUser.UGroup.CanViewSummary ? Visibility.Visible : Visibility.Hidden, //TimeSheet CanViewTimesheet = CurentUser.UGroup.CanViewTimesheet ? Visibility.Visible : Visibility.Hidden, //Report CanViewReports = CurentUser.UGroup.CanViewReports ? Visibility.Visible : Visibility.Hidden, //Projects CanViewProject = CurentUser.UGroup.CanViewProject ? Visibility.Visible : Visibility.Hidden, //User CanViewUsers = CurentUser.UGroup.CanViewUsers ? Visibility.Visible : Visibility.Hidden, //UserGroup CanViewGroupUser = CurentUser.UGroup.CanViewUserGroup ? Visibility.Visible : Visibility.Hidden, //Settings CanViewSettings = CurentUser.UGroup.CanViewSettings ? Visibility.Visible : Visibility.Hidden, //User CanViewClient = CurentUser.UGroup.CanViewClient ? Visibility.Visible : Visibility.Hidden, //ToDoView CanViewToDo = CurentUser.UGroup.CanViewToDo ? Visibility.Visible : Visibility.Hidden, //Invoice CanViewInvoice = CurentUser.UGroup.CanViewInvoice ? Visibility.Visible : Visibility.Hidden, //Quote CanViewQuote = CurentUser.UGroup.CanViewQuote ? Visibility.Visible : Visibility.Hidden }; return(holder); }
public User(User u) { try { ID = u.ID; UserName = u.UserName; Password = u.Password; FirstName = u.FirstName; LastName = u.LastName; Active = u.Active; UGroup = u.UGroup; UVisibility = u.UVisibility; } catch { ID = 0; UserName = string.Empty; Password = string.Empty; FirstName = string.Empty; LastName = string.Empty; Active = false; UGroup = new UserGroup(); UVisibility = new VisibilityAccess(); } }
/// <summary> /// Login init /// </summary> public User() { ID = 0; UserName = string.Empty; Password = string.Empty; UGroup = new UserGroup(); UVisibility = new VisibilityAccess(); }
public LoginViewModel() { CurrentUser = new User(); ClickCommand = new RelayCommand((x) => ButtonClick(x)); VisibilityAccess Visible = new VisibilityAccess(); }