public ProjectAdministrationModel(IAdministrationRemoteService adminService, ApplicationGlobalModel globalModel, [Named("WpfClientMapper")] IMapper mapper, IEventAggregator eventAggregator) { this.adminService = adminService; this.globalModel = globalModel; this.mapper = mapper; this._eventAggregator = eventAggregator; TabModel = new TabModel() { Title = Properties.Resources.AdministrationTab_Title_Project, CanClose = false, IsModified = false }; IsProjectSelected = false; AllCompanyUsers = new ObservableCollection <User>(); ProjectUsers = new ObservableCollection <ProjectUser>(); AddUserToProjectCommand = new AwaitableDelegateCommand(AddUserToProject, CanExecuteAddUserToProject); RemoveUserFromProjectCommand = new AwaitableDelegateCommand(RemoveUserFromProject, CanExecuteRemoveUserFromProject); InviteUserCommand = new AwaitableDelegateCommand(InviteUser, CanExecuteInviteUser); CompanyAdminCheckCommand = new AwaitableDelegateCommand(CompanyAdminCheck); ProjectSetAsAdminCommand = new AwaitableDelegateCommand(SetAsAdmin, CanSetAsAdmin); InitializeCommand = new AwaitableDelegateCommand(LoadProjects); ChangeNotification = new InteractionRequest <INotification>(); }
public UserSelfAdministrationModel(IAdministrationRemoteService adminService, ApplicationGlobalModel globalModel, UserNameClientCredentials userCredentials, [Named("WpfClientMapper")] IMapper mapper, IEventAggregator eventAggregator) { this._adminService = adminService; this._mapper = mapper; this._userCredentials = userCredentials; this._eventAggregator = eventAggregator; TabModel = new TabModel() { Title = Properties.Resources.AdministrationTab_Title_User, CanClose = false, IsModified = false }; CurrentUser = globalModel.CurrentUser; BackupUser = new User(); IsUserInEditMode = false; IsPasswordInEditMode = false; PasswordChangeModel = new PasswordChangeViewModel(); StartUserChangesCommand = new DelegateCommand(StartUserChanges); SaveUserChangesCommand = new AwaitableDelegateCommand(SaveUserChanges); CancelUserChangesCommand = new DelegateCommand(CancelUserChanges); StartPasswordChangeCommand = new DelegateCommand(StartPasswordChange); ChangeUserPasswordCommand = new AwaitableDelegateCommand(ChangeUserPassword); CancelPasswordChangeCommand = new DelegateCommand(CancelPasswordChange); ChangeNotification = new InteractionRequest <INotification>(); }
public CategoryListModel(ITaskRemoteService taskService, IAdministrationRemoteService adminService, IEventAggregator eventAggregator) { this._taskService = taskService; this._adminService = adminService; this._eventAggregator = eventAggregator; CreateCategory = new AwaitableDelegateCommand(OnCreateCategory); Categories = new ObservableCollection <Category>(); }
public async System.Threading.Tasks.Task InitializeKernelAsync() { kernel = new StandardKernel(); kernel.Load(new ServiceConsumerNinjectModule()); Mock <IServiceRunningIndicator> servMock = new Mock <IServiceRunningIndicator>(); kernel.Bind <IServiceRunningIndicator>().ToConstant(servMock.Object); service = kernel.Get <IAdministrationRemoteService>(); pinzService = kernel.Get <IPinzAdminRemoteService>(); taskService = kernel.Get <ITaskRemoteService>(); authorisationService = kernel.Get <IAuthorisationRemoteService>(); UserNameClientCredentials credentials = kernel.Get <UserNameClientCredentials>(); credentials.UserName = TestUserCredentials.UserName; credentials.Password = TestUserCredentials.Password; credentials.UpdateCredentialsForAllFactories(); company = new Company() { Name = "Pinz Online" }; company = await pinzService.CreateCompanyAsync(company); Project project = new Project() { CompanyId = company.CompanyId, Name = "My test project", Description = "Descirption" }; await service.CreateProjectAsync(project); User user = new User() { EMail = "*****@*****.**", IsCompanyAdmin = true, CompanyId = company.CompanyId }; user = await service.CreateUserAsync(user); await service.AddUserToProjectAsync(user, project, true); category = await taskService.CreateCategoryInProjectAsync(project); }
public async System.Threading.Tasks.Task InitializeKernelAsync() { kernel = new StandardKernel(); kernel.Load(new ServiceConsumerNinjectModule()); Mock <IServiceRunningIndicator> servMock = new Mock <IServiceRunningIndicator>(); kernel.Bind <IServiceRunningIndicator>().ToConstant(servMock.Object); service = kernel.Get <IAdministrationRemoteService>(); pinzService = kernel.Get <IPinzAdminRemoteService>(); credentials = kernel.Get <UserNameClientCredentials>(); credentials.UserName = TestUserCredentials.UserName; credentials.Password = TestUserCredentials.Password; credentials.UpdateCredentialsForAllFactories(); Company company1 = new Company() { Name = "Pinz Online" }; company = await pinzService.CreateCompanyAsync(company1); }
public CompanyAdministrationModel(IAdministrationRemoteService adminService, IPinzAdminRemoteService pinzAdminService, ApplicationGlobalModel globalModel, IEventAggregator eventAggregator) { this._globalModel = globalModel; TabModel = new TabModel { Title = Resources.AdministrationTab_Title_Company, CanClose = false, IsModified = false }; this._adminService = adminService; this._pinzAdminService = pinzAdminService; this._eventAggregator = eventAggregator; StartEditCompany = new DelegateCommand(OnStartEditCompany, IsCompanyAdmin); CancelEditCompany = new DelegateCommand(OnCancelEditCompany, IsCompanyAdmin); UpdateCompany = new AwaitableDelegateCommand(OnUpdateCompany, IsCompanyAdmin); NewProject = new DelegateCommand(OnNewProject, CanCreateNewProject); StartEditProject = new DelegateCommand(OnEditProject, IsCompanyAdmin); DeleteProject = new AwaitableDelegateCommand(OnDeleteProject, IsCompanyAdmin); UpdateProject = new AwaitableDelegateCommand(OnSaveProject, IsCompanyAdmin); CancelEditProject = new DelegateCommand(OnCancelEditProject, IsCompanyAdmin); StartEditUser = new DelegateCommand(OnEditUser, IsCompanyAdmin); DeleteUser = new AwaitableDelegateCommand(OnDeleteUser, IsCompanyAdmin); UpdateUser = new AwaitableDelegateCommand(OnUpdateUser, IsCompanyAdmin); CancelEditUser = new DelegateCommand(OnCancelEditUser, IsCompanyAdmin); Projects = new ObservableCollection <Project>(); Users = new ObservableCollection <User>(); InitializeCommand = new AwaitableDelegateCommand(LoadCompany); this.DeleteConfirmation = new InteractionRequest <IConfirmation>(); }