private void AuthenticationEventHandler(
     object sender,
     AuthenticationService.AuthenticationEventArgs e)
 {
     this.AuthenticatedMember    = this.UnitOfWork.MemberRepository.GetById(e.AuthenticatedMember.Id);
     this.CheckoutSheet.OpenedBy = this.AuthenticatedMember;
     this.CheckoutSheet.ClosedBy = this.AuthenticatedMember;
 }
예제 #2
0
 private void ConfigurationViewModelOnMemberAuthenticated(
     object sender,
     AuthenticationService.AuthenticationEventArgs args)
 {
     Application.Current.Dispatcher.Invoke((Action)(() =>
     {
         this.SettingsMenu.Clear();
         if (args.AuthenticatedMember.Roles.Count <Role>((Func <Role, bool>)(r => r.Name == "Admin")) > 0)
         {
             this.SettingsMenu.Add(Resources.PageConfigurationMenuProducts);
             this.SettingsMenu.Add(Resources.PageConfigurationMenuUserRights);
             this.SelectedMenuItem = Resources.PageConfigurationMenuProducts;
         }
         else
         {
             if (args.AuthenticatedMember.Roles.Count <Role>((Func <Role, bool>)(r => r.Name == "ProductAdmin")) <= 0)
             {
                 return;
             }
             this.SettingsMenu.Add(Resources.PageConfigurationMenuProducts);
             this.SelectedMenuItem = Resources.PageConfigurationMenuProducts;
         }
     }));
 }
예제 #3
0
 private void ConfigurationViewModelOnMemberDeauthenticated(
     object sender,
     AuthenticationService.AuthenticationEventArgs args)
 {
     Application.Current.Dispatcher.Invoke((Action)(() => this.SettingsMenu.Clear()));
 }