Example #1
0
        internal static List<object> GetATCLLangCerts(IEnumerable<PersonLangCertDO> includedLangCerts, INomRepository nomRepository)
        {
            var langLevel = new List<object>();
            foreach (var cert in includedLangCerts.Where(c => c.LangLevelId.HasValue))
            {
                var langLevelNom = nomRepository.GetNomValue("langLevels", cert.LangLevelId.Value);
                if (langLevelNom.TextContent.GetItems<string>("roleAliases").First() == "bgCert")
                {
                    langLevel.Add(new
                    {
                        LEVEL = langLevelNom.Name,
                        ISSUE_DATE = cert.DocumentDateValidFrom,
                        VALID_DATE = langLevelNom.Code.Contains("6") ? "unlimited" : (cert.DocumentDateValidTo.HasValue ? cert.DocumentDateValidTo.Value.ToString("dd.MM.yyyy") : null)
                    });
                }
                else
                {
                    langLevel.Add(new
                    {
                        LEVEL = langLevelNom.Name,
                        ISSUE_DATE = cert.DocumentDateValidFrom,
                        VALID_DATE = cert.DocumentDateValidTo.HasValue ? cert.DocumentDateValidTo.Value.ToString("dd.MM.yyyy") : null
                    });
                }
            }

            return langLevel;
        }
Example #2
0
 public AuditsController(
     IUnitOfWork unitOfWork,
     INomRepository nomRepository)
 {
     this.unitOfWork = unitOfWork;
     this.nomRepository = nomRepository;
 }
Example #3
0
        internal static Tuple<string, string> GetAddress(PersonAddressDO personAddress, INomRepository nomRepository)
        {
            List<string> addressData = new List<string>();
            List<string> addressDataAlt = new List<string>();

            if (personAddress.SettlementId.HasValue)
            {
                NomValue settlement = nomRepository.GetNomValue("cities", personAddress.SettlementId.Value);
                NomValue country = nomRepository.GetNomValue("countries", settlement.ParentValueId.Value);
                addressDataAlt.Add(country.NameAlt);
                addressDataAlt.Add(settlement.NameAlt);

                addressData.Add(country.Name);
                addressData.Add(settlement.Name);
            }

            if (personAddress != null)
            {
                if (!string.IsNullOrEmpty(personAddress.AddressAlt))
                {
                    addressDataAlt.Add(personAddress.AddressAlt);
                }
                if (!string.IsNullOrEmpty(personAddress.Address))
                {
                    addressData.Add(personAddress.Address);
                }
            }

            return new Tuple<string, string>(string.Join(", ", addressDataAlt), string.Join(", ", addressData));
        }
Example #4
0
 public AML_III(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #5
0
        internal static List<object> GetPrivileges(List<string> authCodes, INomRepository nomRepository)
        {
            List<object> result = new List<object>();
            foreach (string code in authCodes)
            {
                var authorizationGroup = nomRepository.GetNomValues("instructorExaminerCertificateAttachmentAuthorizations").Where(i =>
                    Regex.Matches(code, "(^" + i.Code + Regex.Escape("(") + ")").Count > 0 ||
                    Regex.Matches(code, "(^" + i.Code + "\\s\\w+)").Count > 0 ||
                    i.Code == code)
                    .FirstOrDefault();

                if (authorizationGroup != null)
                {
                    result = result.Union(nomRepository.GetNomValues("instructorExaminerCertificateAttachmentPrivileges")
                        .Where(p => p.ParentValueId == authorizationGroup.NomValueId)
                        .Select(p => new
                        {
                            REFERENCE = p.Code,
                            PRIVILEGES = p.Name,
                            PRIVILEGES_ALT = p.NameAlt
                        })).ToList();
                }
            }

            return result;
        }
Example #6
0
 public GvaNomController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IApplicationRepository applicationRepository,
     IPersonRepository personRepository,
     IAircraftRepository aircraftRepository,
     IAirportRepository airportRepository,
     IEquipmentRepository equipmentRepository,
     IOrganizationRepository organizationRepository,
     ICaseTypeRepository caseTypeRepository,
     INomRepository nomRepository,
     IStageRepository stageRepository,
     IExaminationSystemRepository examinationSystemRepository,
     IAircraftRegistrationRepository aircraftRegistrationRepository,
     IEnumerable<IDataGenerator> dataGenerators)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.applicationRepository = applicationRepository;
     this.personRepository = personRepository;
     this.aircraftRepository = aircraftRepository;
     this.airportRepository = airportRepository;
     this.equipmentRepository = equipmentRepository;
     this.organizationRepository = organizationRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.nomRepository = nomRepository;
     this.stageRepository = stageRepository;
     this.examinationSystemRepository = examinationSystemRepository;
     this.aircraftRegistrationRepository = aircraftRegistrationRepository;
     this.dataGenerators = dataGenerators;
 }
Example #7
0
 public PersonRepository(
     IUnitOfWork unitOfWork,
     INomRepository nomRepository)
 {
     this.unitOfWork = unitOfWork;
     this.nomRepository = nomRepository;
 }
Example #8
0
 public CoordinatorSimi(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #9
0
 public ExaminerCert(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #10
0
 public PersonsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IApplicationRepository applicationRepository,
     IApplicationStageRepository applicationStageRepository,
     ICaseTypeRepository caseTypeRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     IPersonDocumentRepository personDocumentRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.applicationRepository = applicationRepository;
     this.applicationStageRepository = applicationStageRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.nomRepository = nomRepository;
     this.fileRepository = fileRepository;
     this.personDocumentRepository = personDocumentRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #11
0
 public AMLNational(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #12
0
 public CabinCrewLicence(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #13
0
 public CAL03year2013(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #14
0
 public ApplicationsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IOrganizationRepository organizationRepository,
     IAircraftRepository aircraftRepository,
     IAirportRepository airportRepository,
     IEquipmentRepository equipmentRepository,
     IDocRepository docRepository,
     IApplicationRepository applicationRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     IExaminationSystemRepository examinationSystemRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.organizationRepository = organizationRepository;
     this.aircraftRepository = aircraftRepository;
     this.airportRepository = airportRepository;
     this.equipmentRepository = equipmentRepository;
     this.docRepository = docRepository;
     this.applicationRepository = applicationRepository;
     this.nomRepository = nomRepository;
     this.examinationSystemRepository = examinationSystemRepository;
     this.fileRepository = fileRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #15
0
 public Pilot142year2013(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #16
0
        internal static List<object> GetRatings(
            IEnumerable<PartVersion<PersonRatingDO>> includedRatings,
            IEnumerable<PartVersion<PersonRatingEditionDO>> ratingEditions,
            List<int> authorizationGroupIds,
            INomRepository nomRepository)
        {
            List<object> ratings = new List<object>();
            foreach (var edition in ratingEditions)
            {
                var rating = includedRatings.Where(r => r.Part.Index == edition.Content.RatingPartIndex).Single();

                NomValue authorization = rating.Content.AuthorizationId.HasValue ? nomRepository.GetNomValue("authorizations", rating.Content.AuthorizationId.Value) : null;
                if (authorization == null ||
                    (authorization.Code != "RTO" &&
                    (authorization.ParentValueId.HasValue ? !authorizationGroupIds.Contains(authorization.ParentValueId.Value) : true)))
                {
                    ratings.Add(new
                    {
                        TYPE = string.Format(
                            "{0} {1}",
                            rating.Content.RatingClassId.HasValue ? nomRepository.GetNomValue("ratingClasses", rating.Content.RatingClassId.Value).Code : string.Empty,
                            rating.Content.RatingTypes.Count() > 0 ? string.Join(", ", nomRepository.GetNomValues("ratingTypes", rating.Content.RatingTypes.ToArray()).Select(rt => rt.Code)) : "").Trim(),
                        AUTH_NOTES = string.Format(
                            "{0} {1}",
                            authorization == null ? string.Empty : authorization.Code,
                            edition.Content.NotesAlt).Trim(),
                        VALID_DATE = edition.Content.DocumentDateValidTo
                    });
                }
            }

            return ratings;
        }
Example #17
0
 public InstructorCert(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #18
0
 public FCLAuthForm(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
 }
Example #19
0
 public StudentFilghtLicence(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.number = 6;
 }
Example #20
0
 public Pilot(
     ILotRepository lotRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.number = 6;
 }
Example #21
0
 public ForeignLicence(
     ILotRepository lotRepository,
     INomRepository nomRepository,
     IOrganizationRepository organizationRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.organizationRepository = organizationRepository;
 }
Example #22
0
 public GvaSuggestionController(
     IInventoryRepository inventoryRepository,
     INomRepository nomRepository,
     IPersonDocumentRepository personDocumentRepository)
 {
     this.inventoryRepository = inventoryRepository;
     this.nomRepository = nomRepository;
     this.personDocumentRepository = personDocumentRepository;
 }
Example #23
0
 public SModeCodeRepository(
     IUnitOfWork unitOfWork,
     INomRepository nomRepository,
     ILotRepository lotRepository)
 {
     this.unitOfWork = unitOfWork;
     this.nomRepository = nomRepository;
     this.lotRepository = lotRepository;
 }
Example #24
0
 public ApplicationNote(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IFileRepository fileRepository,
     INomRepository nomRepository)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.fileRepository = fileRepository;
     this.nomRepository = nomRepository;
 }
Example #25
0
 public RVD_Licence(
     ILotRepository lotRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     ICaseTypeRepository caseTypeRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.fileRepository = fileRepository;
     this.caseTypeRepository = caseTypeRepository;
 }
Example #26
0
 public PersonExportXmlController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     INomRepository nomRepository,
     IApplicationRepository applicationRepository)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.applicationRepository = applicationRepository;
 }
Example #27
0
 public PersonTrainingRepository(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IFileRepository fileRepository,
     INomRepository nomRepository)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.fileRepository = fileRepository;
     this.nomRepository = nomRepository;
 }
Example #28
0
 public RegistrationCert(
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IOrganizationRepository organizationRepository,
     INomRepository nomRepository)
 {
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.organizationRepository = organizationRepository;
     this.nomRepository = nomRepository;
 }
Example #29
0
 public Atcl1Licence(
     ILotRepository lotRepository,
     INomRepository nomRepository,
     IFileRepository fileRepository,
     ICaseTypeRepository caseTypeRepository)
 {
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.fileRepository = fileRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.number = 5;
 }
Example #30
0
 public AppController(IUnitOfWork unitOfWork,
     IAppRepository appRepository,
     IDocRepository docRepository,
     IUserRepository userRepository,
     IClassificationRepository classificationRepository,
     INomRepository nomRepository,
     IDataGenerator dataGenerator)
 {
     this.unitOfWork = unitOfWork;
     this.appRepository = appRepository;
     this.docRepository = docRepository;
     this.userRepository = userRepository;
     this.classificationRepository = classificationRepository;
     this.nomRepository = nomRepository;
     this.dataGenerator = dataGenerator;
 }