Пример #1
0
        public JsonResult GetOrganisations(AccessTemplateFilter accessTemplateFilter)
        {
            var accessTemplatesViewModel = new AccessTemplatesViewModel();
            accessTemplatesViewModel.Initialize(new AccessTemplateFilter
            {
                OrganisationUIDs = accessTemplateFilter.OrganisationUIDs,
                LogicalDeletationType = accessTemplateFilter.LogicalDeletationType
            });

            dynamic result = new
            {
                page = 1,
                total = 100,
                records = 100,
                rows = accessTemplatesViewModel.Organisations,
            };

            return Json(result, JsonRequestBehavior.AllowGet);
        }
Пример #2
0
		public HRViewModel(SKDTabItems skdTabItems)
		{
			SKDTabItems = skdTabItems;
			EditFilterCommand = new RelayCommand(OnEditFilter, CanEditFilter);
			ChangeIsDeletedCommand = new RelayCommand(OnChangeIsDeleted, CanChangeIsDeleted);
			EmployeesViewModel = new EmployeesViewModel();
			DepartmentsViewModel = new DepartmentsViewModel();
			PositionsViewModel = new PositionsViewModel();
			AdditionalColumnTypesViewModel = new AdditionalColumnTypesViewModel();
			CardsViewModel = new CardsViewModel();
			AccessTemplatesViewModel = new AccessTemplatesViewModel();
			PassCardTemplatesViewModel = new PassCardTemplatesViewModel();
			OrganisationsViewModel = new OrganisationsViewModel();
			DepartmentFilter = new DepartmentFilter();
			PositionFilter = new PositionFilter();
			CardFilter = new CardFilter();
			if (CanSelectEmployees) 
				IsEmployeesSelected = true;
			else if (CanSelectDepartments) 
				IsDepartmentsSelected = true;
			else if (CanSelectPositions) 
				IsPositionsSelected = true;
			else if (CanSelectAdditionalColumns) 
				IsAdditionalColumnTypesSelected = true;
			else if (CanSelectCards) 
				IsCardsSelected = true;
			else if (CanSelectAccessTemplates) 
				IsAccessTemplatesSelected = true;
			else if (CanSelectPassCardTemplates) 
				IsPassCardTemplatesSelected = true;
			else if (CanSelectOrganisations) 
				IsOrganisationsSelected = true;
			PersonTypes = new ObservableCollection<PersonType>();
			if (ClientManager.CurrentUser.HasPermission(PermissionType.Oper_SKD_Employees_View))
				PersonTypes.Add(PersonType.Employee);
			if (ClientManager.CurrentUser.HasPermission(PermissionType.Oper_SKD_Guests_View))
				PersonTypes.Add(PersonType.Guest);
			_selectedPersonType = PersonTypes.FirstOrDefault();
			var user = ClientManager.CurrentUser;
			Filter = new HRFilter() { User = user };
			Filter.EmployeeFilter.User = user;
		}