Beispiel #1
0
        public ActionResult TestD0501()
        {
            InvoiceD0501 model = new InvoiceD0501()
            {
                CancelAllowanceNumber = "QE00000000",
                AllowanceDate         = "20210619",
                CancelDate            = "20210519",
                CancelTime            = "16:20:17",
                SellerId     = "12345678",
                BuyerId      = "0000000000",
                CancelReason = "測試",
            };

            InvoiceXMLServices service = new InvoiceXMLServices();
            // 下載檔案的方式
            var result = new FileContentResult(Encoding.UTF8.GetBytes(service.GeneratorD0501(model)), "text/xml");

            result.FileDownloadName = "TestD0501.xml";
            return(result);
            //return Content(service.GeneratorD0501(model), "text/xml");
        }
 /// <summary>
 /// 平台存證作廢折讓證明單訊息規格
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public string GeneratorD0501(InvoiceD0501 data)
 {
     return(this.GeneratorXML(data, @"~/einv/template/templateD0501.txt", "urn:GEINV:eInvoiceMessage:D0501:3.2", @"~/einv/xsd/v32/D0501.xsd"));
 }