public UserDetailUC(UserService userService, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _userBasicInformation = userBasicInformation; if (userBasicInformation.UserLevel < (int)EUserLevel.User) { tbMyInfo.IsEnabled = false; } _userService = userService; SetValues(); _userService.GetAllAgentsByUser().ContinueWith(task => { if (task.Result.IsSuccess) { gridAgends.ItemsSource = task.Result.Success.Items; _agents = task.Result.Success.Items; } else { MessageBox.Show("Falha na obtenção dos agents", "Falha", MessageBoxButton.OK, MessageBoxImage.Warning); } }, _taskSchedule); }
public CompanyUC(EventHandler onRemove, EventHandler onEdit, CompanyResumeViewModel companyResumeViewModel, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _companyResumeViewModel = companyResumeViewModel; _onRemove = onRemove; _onEditHandler = onEdit; _userBasicInformation = userBasicInformation; SetCompanyValues(); }
public AgentUC(EventHandler onRemove, EventHandler onEdit, AgentResumeViewModel agentResumeViewModel, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _agentResumeViewModel = agentResumeViewModel; _onRemove = onRemove; _onEditHandler = onEdit; _userBasicInformation = userBasicInformation; SetAgentValues(); }
public CompaniesUserControl(CompanyService companyService, EventHandler onSwitchControl, IUserService userService, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _onSwitchControl = onSwitchControl; _companyService = companyService; _userService = userService; _userBasicInformation = userBasicInformation; _indexes = new Dictionary <Guid, CompanyUC>(); }
public Home(CustomHttpCliente customHttpCliente, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _customHttpCliente = customHttpCliente; InstanceServices(); VerifyPermissionsUser(userBasicInformation); IncludeUserControl(new UserDetailUC(_userService, _userBasicInformation), new EventArgs()); }
private void VerifyPermissionsUser(UserBasicInformationViewModel userBasicInformation) { _userBasicInformation = userBasicInformation; this.lblUserName.Text = _userBasicInformation.FullName; if (this._userBasicInformation.UserLevel < (int)UserLevel.Admin) { this.btnMonitoramentos.Visibility = Visibility.Collapsed; } if (this._userBasicInformation.UserLevel < (int)UserLevel.System) { this.menuItemCompanies.Visibility = Visibility.Collapsed; } }
public ArchiveUC(EventHandler onRemove, EventHandler onEdit, ArchiveViewModel archiveViewModel, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _onRemove = onRemove; _onEdit = onEdit; _userBasicInformation = userBasicInformation; if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { btnDel.IsEnabled = btnDel.IsEnabled = false; btnDel.Visibility = btnDel.Visibility = Visibility.Collapsed; } SetArchiveValues(archiveViewModel); }
public CompanyDetailUC(CompanyService companyService, IUserService userService, UserBasicInformationViewModel userBasicInformation, Guid companyId = default) { InitializeComponent(); _companyService = companyService; _userService = userService; _companyId = companyId != default ? companyId : userBasicInformation.CompanyId; tbUsers.Content = new UsersUserControl(_userService, userBasicInformation, _companyId); this._userBasicInformation = userBasicInformation; SetValues(); }
public ServiceUC(EventHandler onRemove, EventHandler onEdit, EventHandler onRestart, SystemServiceViewModel systemServiceViewModel, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _onRemove = onRemove; _onEdit = onEdit; _onRestart = onRestart; _userBasicInformation = userBasicInformation; if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { btnRestart.IsEnabled = btnDel.IsEnabled = false; btnRestart.Visibility = btnDel.Visibility = Visibility.Collapsed; } SetServiceValues(systemServiceViewModel); }
public AgentsUserControl(AgentService agentService, ItemsMonitoringService itensMonitoringService, EventHandler onSwitchControl, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _agentService = agentService; _onSwitchControl = onSwitchControl; _itensMonitoringService = itensMonitoringService; _userBasicInformation = userBasicInformation; _indexes = new Dictionary <Guid, AgentUC>(); if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { btnAdd.IsEnabled = false; btnAdd.Visibility = Visibility.Collapsed; } }
public UsersUserControl(IUserService userService, UserBasicInformationViewModel userBasicInformation, Guid companyId) { InitializeComponent(); _companyId = companyId; _userService = userService; _currentItems = new List <UserResumeViewModel>(); _userBasicInformation = userBasicInformation; if (_userBasicInformation.UserLevel < 2) { pnlButtons.Visibility = Visibility.Collapsed; pnlButtons.IsEnabled = false; } LoadUsers(); }
public ArchiveDetailWindow(EventHandler modified, ArchiveViewModel archiveViewModel, ItemsMonitoringService itemsMonitoringService, UserBasicInformationViewModel userBasicInformation) { _onModified = modified; _archiveViewModel = archiveViewModel; _itemsMonitoringService = itemsMonitoringService; _userBasicInformation = userBasicInformation; InitializeComponent(); Populate(); if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { btnEdit.IsEnabled = false; btnEdit.Visibility = Visibility.Collapsed; } }
public JsonResult Update(UserBasicInformationViewModel model) { var rh = new ResponseHelper(); if (ModelState.IsValid) { rh = _userService.Update(new ApplicationUser { Id = model.Id, Name = model.Name, LastName = model.LastName }); } else { rh.SetValidations(ModelState.GetErrors()); } return(Json(rh)); }
public AgentDetailUC(Guid id, UserBasicInformationViewModel userBasicInformation, AgentService agentService, ItemsMonitoringService itensMonitoringService) { InitializeComponent(); _id = id; _userBasicInformation = userBasicInformation; _itensMonitoringService = itensMonitoringService; _agentsService = agentService; if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { this.pnlProfile.IsEnabled = false; } PopulateServices(); PopulateArchives(); InsertAgentDetail().ContinueWith(task => { PopulateCbProfile(); }, TaskScheduler.FromCurrentSynchronizationContext()); }
public ArchivesUserControl(Guid agentId, UserBasicInformationViewModel userBasicInformation, ItemsMonitoringService itemsMonitoringService, AgentService agentService) { InitializeComponent(); _agentId = agentId; _userBasicInformation = userBasicInformation; _agentService = agentService; _itemsMonitoringService = itemsMonitoringService; _indexes = new Dictionary <Guid, ArchiveUC>(); _currentTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); if (_userBasicInformation.UserLevel < (int)EUserLevel.Admin) { btnAdd.IsEnabled = false; btnAdd.Visibility = Visibility.Collapsed; } Populate(); }
public Home(CustomHttpCliente customHttpCliente, UserBasicInformationViewModel userBasicInformation) { InitializeComponent(); _customHttpCliente = customHttpCliente; VerifyPermissionsUser(userBasicInformation); }
private void VerifyPermissionsUser(UserBasicInformationViewModel userBasicInformation) { _userBasicInformation = userBasicInformation; this.lblUserName.Text = _userBasicInformation.FullName; }