コード例 #1
0
        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);
        }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 /// <summary>
 /// Login init
 /// </summary>
 public User()
 {
     ID          = 0;
     UserName    = string.Empty;
     Password    = string.Empty;
     UGroup      = new UserGroup();
     UVisibility = new VisibilityAccess();
 }
コード例 #4
0
 public LoginViewModel()
 {
     CurrentUser  = new User();
     ClickCommand = new RelayCommand((x) => ButtonClick(x));
     VisibilityAccess Visible = new VisibilityAccess();
 }