Beispiel #1
0
        private Guid CreateReceiptDocFileContent(Doc initialDoc, Doc receiptDoc, Doc rootDoc, List<ElectronicDocumentDiscrepancyTypeNomenclature> discrepancies, ApplicationDataDo applicationDataDo, ServiceProviderDo serviceProviderDo)
        {
            bool isDocAcknowledged = discrepancies == null || discrepancies.Count() == 0;

            string registerIndex;
            string sequenceNumber;
            DateTime receiptOrSigningDate;

            string receiptMessage;
            if (!isDocAcknowledged)
            {
                registerIndex = receiptDoc.RegIndex;
                sequenceNumber = receiptDoc.RegNumber.Value.ToString("D6");
                receiptOrSigningDate = receiptDoc.RegDate.Value;

                receiptMessage = this.rioDocumentParser.XmlSerializeReceiptNotAcknowledgedMessage(
                    this.CreateReceiptNotAcknowledgedMessage(registerIndex, sequenceNumber, receiptOrSigningDate, applicationDataDo, discrepancies, serviceProviderDo));
            }
            else
            {
                registerIndex = initialDoc.RegIndex;
                sequenceNumber = initialDoc.RegNumber.Value.ToString("D6");
                receiptOrSigningDate = initialDoc.RegDate.Value;

                string aisUserIdentifier = "Системен потребител";
                string aisURI = String.Format("{0} АИС", serviceProviderDo.Name);

                string htmlFormat = @"<p>Номер на преписка: <b>{0}</b><br/>Код за достъп: <b>{1}</b><br/></p>";
                string regUri = rootDoc != null ? rootDoc.RegUri : initialDoc.RegUri;
                string accessCode = rootDoc != null ? rootDoc.AccessCode : initialDoc.AccessCode;
                string caseAccessIdentifier = String.Format(htmlFormat, regUri, accessCode);

                receiptMessage = this.rioDocumentParser.XmlSerializeReceiptAcknowledgedMessage(
                    this.CreateReceiptAcknowledgedMessage(registerIndex, sequenceNumber, receiptOrSigningDate, aisUserIdentifier, aisURI, caseAccessIdentifier, applicationDataDo, serviceProviderDo));
            }

            byte[] content = Utf8Utils.GetBytes(receiptMessage);
            Guid fileKey = WriteToBlob(content);

            return fileKey;
        }
Beispiel #2
0
        private ReceiptNotAcknowledgedMessage CreateReceiptNotAcknowledgedMessage(
            string registerIndex,
            string sequenceNumber,
            DateTime receiptOrSigningDate,
            ApplicationDataDo applicationDataDo,
            List<ElectronicDocumentDiscrepancyTypeNomenclature> discrepancies,
            ServiceProviderDo serviceProviderDo)
        {
            var receiptMessage = new ReceiptNotAcknowledgedMessage();
            receiptMessage.MessageURI = new DocumentURI();
            receiptMessage.MessageURI.RegisterIndex = registerIndex;
            receiptMessage.MessageURI.SequenceNumber = sequenceNumber;
            receiptMessage.MessageURI.ReceiptOrSigningDate = receiptOrSigningDate;
            receiptMessage.Applicant = applicationDataDo.ElectronicServiceApplicant;
            receiptMessage.ElectronicServiceProvider = applicationDataDo.ElectronicServiceProviderBasicData;
            receiptMessage.ElectronicServiceProvider.EntityBasicData.Name = serviceProviderDo.Name;
            receiptMessage.TransportType = "0006-000001"; //Чрез уеб базирано приложение;
            receiptMessage.DocumentTypeURI = applicationDataDo.DocumentTypeURI;
            receiptMessage.DocumentTypeName = applicationDataDo.DocumentTypeName;
            receiptMessage.MessageCreationTime = receiptOrSigningDate;
            receiptMessage.Discrepancies = new Discrepancies();
            receiptMessage.Discrepancies.DiscrepancyCollection = new DiscrepancyCollection();
            foreach (var discrepancy in discrepancies)
            {
                receiptMessage.Discrepancies.DiscrepancyCollection.Add(discrepancy.Uri);
            }

            return receiptMessage;
        }
Beispiel #3
0
        private ReceiptAcknowledgedMessage CreateReceiptAcknowledgedMessage(
            string registerIndex,
            string sequenceNumber,
            DateTime receiptOrSigningDate,
            string aisUserIdentifier,
            string aisURI,
            string caseAccessIdentifier,
            ApplicationDataDo applicationDataDo,
            ServiceProviderDo serviceProviderDo)
        {
            var receiptMessage = new ReceiptAcknowledgedMessage();
            receiptMessage.DocumentURI = new DocumentURI();
            receiptMessage.DocumentURI.RegisterIndex = registerIndex;
            receiptMessage.DocumentURI.SequenceNumber = sequenceNumber;
            receiptMessage.DocumentURI.ReceiptOrSigningDate = receiptOrSigningDate;
            receiptMessage.Applicant = applicationDataDo.ElectronicServiceApplicant;
            receiptMessage.ElectronicServiceProvider = applicationDataDo.ElectronicServiceProviderBasicData;
            receiptMessage.ElectronicServiceProvider.EntityBasicData.Name = serviceProviderDo.Name;
            receiptMessage.TransportType = "0006-000001"; //Чрез уеб базирано приложение;
            receiptMessage.DocumentTypeURI = applicationDataDo.DocumentTypeURI;
            receiptMessage.DocumentTypeName = applicationDataDo.DocumentTypeName;
            receiptMessage.RegisteredBy = new RegisteredBy();
            receiptMessage.RegisteredBy.Officer = new Officer();
            receiptMessage.RegisteredBy.Officer.AISUserIdentifier = aisUserIdentifier;
            receiptMessage.RegisteredBy.AISURI = aisURI;
            receiptMessage.CaseAccessIdentifier = caseAccessIdentifier;

            return receiptMessage;
        }