Example #1
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 #2
0
 public AircraftsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IInventoryRepository inventoryRepository,
     IAircraftRepository aircraftRepository,
     IAircraftRegistrationRepository aircraftRegistrationRepository,
     IAircraftRegMarkRepository aircraftRegMarkRepository,
     ISModeCodeRepository sModeCodeRepository,
     IFileRepository fileRepository,
     IApplicationRepository applicationRepository,
     ICaseTypeRepository caseTypeRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.inventoryRepository = inventoryRepository;
     this.aircraftRepository = aircraftRepository;
     this.aircraftRegistrationRepository = aircraftRegistrationRepository;
     this.aircraftRegMarkRepository = aircraftRegMarkRepository;
     this.sModeCodeRepository = sModeCodeRepository;
     this.fileRepository = fileRepository;
     this.applicationRepository = applicationRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #3
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 #4
0
 public SuggestionsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     ISuggestionRepository suggestionRepository,
     ILotEventDispatcher lotEventDispatcher)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.suggestionRepository = suggestionRepository;
     this.lotEventDispatcher = lotEventDispatcher;
 }
Example #5
0
 public SignalsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     ISignalRepository signalRepository,
     ILotEventDispatcher lotEventDispatcher)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.signalRepository = signalRepository;
     this.lotEventDispatcher = lotEventDispatcher;
 }
Example #6
0
 public AdmissionsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IAdmissionRepository admissionRepository,
     Docs.Api.Repositories.DocRepository.IDocRepository docRepository,
     ILotEventDispatcher lotEventDispatcher)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.admissionRepository = admissionRepository;
     this.docRepository = docRepository;
     this.lotEventDispatcher = lotEventDispatcher;
 }
 public ExaminationSystemRepository(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IPersonRepository personRepository,
     IFileRepository fileRepository,
     ICaseTypeRepository caseTypeRepository,
     ILotEventDispatcher lotEventDispatcher)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.personRepository = personRepository;
     this.fileRepository = fileRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.lotEventDispatcher = lotEventDispatcher;
 }
Example #8
0
 public SModeCodesController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     INomRepository nomRepository,
     ISModeCodeRepository sModeCodeRepository,
     ICaseTypeRepository caseTypeRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.nomRepository = nomRepository;
     this.sModeCodeRepository = sModeCodeRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #9
0
 public IntegrationRepository(
     IUnitOfWork unitOfWork,
     ICaseTypeRepository caseTypeRepository,
     ILotRepository lotRepository,
     ICorrespondentRepository correspondentRepository,
     IPersonRepository personRepository,
     INomRepository nomRepository,
     ILotEventDispatcher lotEventDispatcher)
 {
     this.unitOfWork = unitOfWork;
     this.caseTypeRepository = caseTypeRepository;
     this.lotRepository = lotRepository;
     this.correspondentRepository = correspondentRepository;
     this.personRepository = personRepository;
     this.nomRepository = nomRepository;
     this.lotEventDispatcher = lotEventDispatcher;
 }
Example #10
0
 public EquipmentsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IInventoryRepository inventoryRepository,
     IEquipmentRepository equipmentRepository,
     IApplicationRepository applicationRepository,
     ICaseTypeRepository caseTypeRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.inventoryRepository = inventoryRepository;
     this.equipmentRepository = equipmentRepository;
     this.applicationRepository = applicationRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #11
0
 public AplicationsCaseController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IDocRepository docRepository,
     IApplicationRepository applicationRepository,
     IFileRepository fileRepository,
     ICaseTypeRepository caseTypeRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.docRepository = docRepository;
     this.applicationRepository = applicationRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.fileRepository = fileRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.userContext = userContext;
 }
Example #12
0
 public OrganizationsController(
     IUnitOfWork unitOfWork,
     ILotRepository lotRepository,
     IInventoryRepository inventoryRepository,
     IOrganizationRepository organizationRepository,
     IApplicationRepository applicationRepository,
     ICaseTypeRepository caseTypeRepository,
     INomRepository nomRepository,
     ILotEventDispatcher lotEventDispatcher,
     UserContext userContext)
 {
     this.unitOfWork = unitOfWork;
     this.lotRepository = lotRepository;
     this.inventoryRepository = inventoryRepository;
     this.organizationRepository = organizationRepository;
     this.applicationRepository = applicationRepository;
     this.caseTypeRepository = caseTypeRepository;
     this.nomRepository = nomRepository;
     this.lotEventDispatcher = lotEventDispatcher;
     this.userContext = userContext;
 }
Example #13
0
        public void MigrateLicenceDocuments(
            ConcurrentQueue<int> personIds,
            Dictionary<int, int> personIdToLotId,
            Dictionary<int, IEnumerable<JObject>> personsLicences,
            CookieCollection cookies,
            //cancellation
            CancellationTokenSource cts,
            CancellationToken ct)
        {
            try
            {
                this.oracleConn.Open();
            }
            catch (Exception)
            {
                cts.Cancel();
                throw;
            }

            ct.ThrowIfCancellationRequested();
            using (var dependencies = this.dependencyFactory())
            {
                this.unitOfWork = dependencies.Value.Item1;
                this.lotRepository = dependencies.Value.Item2;
                var printRepository = dependencies.Value.Item3;
                this.lotEventDispatcher = dependencies.Value.Item4;
                this.userContext = dependencies.Value.Item5;

                string connectionString = ConfigurationManager.ConnectionStrings["DbContext"].ConnectionString;

                int personId = -1;
                try
                {
                    while (personIds.TryDequeue(out personId))
                    {
                        if (personIdToLotId.ContainsKey(personId))
                        {
                            var lot = lotRepository.GetLotIndex(personIdToLotId[personId], fullAccess: true);

                            JObject licence = null;
                            ConcurrentQueue<JObject> personLicences = new ConcurrentQueue<JObject>(personsLicences[personId]);

                            while (personLicences.TryDequeue(out licence))
                            {
                                string queryString = licence.Get<string>("query_string");
                                int oldId = licence.Get<int>("old_id");

                                int editionPartIndex = lot.Index.GetParts<dynamic>("licenceEditions")
                                    .Where(e => e.Content.__oldId == oldId)
                                    .Single().Part.Index;

                                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(queryString);
                                request.CookieContainer = new CookieContainer();
                                request.CookieContainer.Add(cookies);

                                using (HttpWebResponse httpResponse = (HttpWebResponse)request.GetResponse())
                                using (var responseStream = httpResponse.GetResponseStream())
                                using (var stream = printRepository.ConvertWordStreamToPdfStream(responseStream))
                                {
                                    var licenceEditionDocBlobKey = printRepository.SaveStreamToBlob(stream, connectionString);
                                    this.UpdateLicenceEdition(licenceEditionDocBlobKey, editionPartIndex, lot);
                                }
                            }
                            Console.WriteLine("Migrated printed licences of personId: {0}", personId);
                        }
                    }
                }
                catch (Exception)
                {
                    Console.WriteLine("Error in migration of printed licences of personId: {0}", personId);
                    cts.Cancel();
                    throw;
                }
            }
        }