/// <summary>
        /// Uygulama yanıtı Header alanları
        /// </summary>
        /// <returns>Uygulama yanıtı Header alanları</returns>
        private ApplicationResponseType GetInvoiceHeader(DateTime issueDate)
        {
            var uygulamaYaniti = new ApplicationResponseType
            {
                UBLVersionID = new UBLVersionIDType {
                    Value = "2.1"
                },
                CustomizationID = new CustomizationIDType {
                    Value = "TR1.2"
                },
                ProfileID = new ProfileIDType {
                    Value = "TICARIFATURA"
                },
                ID = new IDType {
                    Value = Guid.NewGuid().ToString()
                },
                UUID = new UUIDType {
                    Value = Guid.NewGuid().ToString()
                },

                IssueDate = new IssueDateType
                {
                    Value = issueDate
                }
            };

            return(uygulamaYaniti);
        }
        /// <summary>
        ///  e-Fatura Uygulama Yanıtı UBL' ini oluşturma
        /// </summary>
        /// <returns>e-Fatura UBL'i</returns>
        public ApplicationResponseType CreateApplicationResponse(string vknTckn, string gelenfaturaId, DateTime issueDate)
        {
            ApplicationResponseType uygulamaYaniti = GetInvoiceHeader(issueDate);

            switch (vknTckn.Length)
            {
            case 10:
                uygulamaYaniti.SenderParty   = GetSender(vknTckn, "VKN");
                uygulamaYaniti.ReceiverParty = GetReceiver(vknTckn, "VKN");
                break;

            case 11:
                uygulamaYaniti.SenderParty   = GetSender(vknTckn, "TCKN");
                uygulamaYaniti.ReceiverParty = GetReceiver(vknTckn, "TCKN");
                break;
            }

            uygulamaYaniti.DocumentResponse = GetDocumentResponse(gelenfaturaId, issueDate);

            return(uygulamaYaniti);
        }
Example #3
0
        static string DecodeBulkUploadRetrievalResponse(ApplicationResponseType response)
        {
            string message = String.Empty;

            // Determine overall success or failure of the call.
            switch (response.Result)
            {
            case ApplicationResponseTypeResult.Success:
                message = String.Format("Application {0} succeeded with USI {1}.", response.ApplicationId, response.USI);
                break;

            case ApplicationResponseTypeResult.MatchFound:
                message = String.Format("Application {0} already exists.", response.ApplicationId);
                break;

            case ApplicationResponseTypeResult.Failure:
                message = String.Format("Application {0} failed.", response.ApplicationId);
                break;
            }

            if (response.USI != null)
            {
                message += String.Format(" USI={0}.", response.USI);
            }
            else
            {
                message += " USI is null.";
            }

            message += String.Format(" IdentityDocumentVerified={0}.", response.IdentityDocumentVerified);

            // Get the detailed messages if the call failed.
            if (response.Errors != null && response.Errors.Length > 0)
            {
                message += " " + String.Join(". ", response.Errors.Select(e => e.Message));
            }

            return(message);
        }