コード例 #1
0
        public void WriteXmlContactListInfo(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("CONTACT_LIST_INFO");

            xml.WriteElement("CATEGORYNAME", this.CategoryName);

            xml.WriteStartElement("CONTACT");
            xml.WriteElement("NAME", this.Contact);
            xml.WriteEndElement();

            xml.WriteEndElement();
        }
コード例 #2
0
        public void GetXmlTest()
        {
            string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<function controlid=""unittest"">
    <create_aradjustment>
        <customerid>CUSTOMER1</customerid>
        <datecreated>
            <year>2015</year>
            <month>06</month>
            <day>30</day>
        </datecreated>
        <aradjustmentitems>
            <lineitem>
                <glaccountno />
                <amount>76343.43</amount>
            </lineitem>
        </aradjustmentitems>
    </create_aradjustment>
</function>";

            Stream            stream      = new MemoryStream();
            XmlWriterSettings xmlSettings = new XmlWriterSettings();

            xmlSettings.Encoding    = Encoding.UTF8;
            xmlSettings.Indent      = true;
            xmlSettings.IndentChars = "    ";

            IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings);

            ArAdjustmentCreate record = new ArAdjustmentCreate("unittest")
            {
                CustomerId      = "CUSTOMER1",
                TransactionDate = new DateTime(2015, 06, 30),
            };

            ArAdjustmentLineCreate line1 = new ArAdjustmentLineCreate();

            line1.TransactionAmount = 76343.43M;

            record.Lines.Add(line1);

            record.WriteXml(ref xml);

            xml.Flush();
            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd())
                           .WithDifferenceEvaluator(DifferenceEvaluators.Default)
                           .Build();

            Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString());
        }
コード例 #3
0
        public void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("csnentity");

            xml.WriteElement("entityid", EntityId, true);

            // Rates support up to 10 decimal places
            xml.WriteElement("bsrate", EndingSpotRate);
            xml.WriteElement("warate", WeightedAverageRate);

            xml.WriteEndElement(); //csnentity
        }
コード例 #4
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("update");
            xml.WriteStartElement("WAREHOUSE");

            xml.WriteElement("WAREHOUSEID", WarehouseId, true);

            xml.WriteElement("NAME", WarehouseName);

            if (!string.IsNullOrWhiteSpace(LocationId))
            {
                xml.WriteStartElement("LOC");
                xml.WriteElement("LOCATIONID", LocationId);
                xml.WriteEndElement(); // LOC
            }

            xml.WriteElement("MANAGERID", ManagerEmployeeId);
            xml.WriteElement("PARENTID", ParentWarehouseId);

            if (!string.IsNullOrWhiteSpace(WarehouseContactName))
            {
                xml.WriteStartElement("CONTACTINFO");
                xml.WriteElement("CONTACTNAME", WarehouseContactName);
                xml.WriteEndElement(); //CONTACTINFO
            }
            if (!string.IsNullOrWhiteSpace(ShipToContactName))
            {
                xml.WriteStartElement("SHIPTO");
                xml.WriteElement("CONTACTNAME", ShipToContactName);
                xml.WriteEndElement(); //SHIPTO
            }

            xml.WriteElement("USEDINGL", UsedInGeneralLedger);

            if (Active == true)
            {
                xml.WriteElement("STATUS", "active");
            }
            else if (Active == false)
            {
                xml.WriteElement("STATUS", "inactive");
            }

            xml.WriteCustomFieldsImplicit(CustomFields);

            xml.WriteEndElement(); //WAREHOUSE
            xml.WriteEndElement(); //update

            xml.WriteEndElement(); //function
        }
コード例 #5
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_aradjustment");

            xml.WriteElement("customerid", CustomerId, true);

            xml.WriteStartElement("datecreated");
            xml.WriteDateSplitElements(TransactionDate);
            xml.WriteEndElement(); //datecreated

            if (GlPostingDate.HasValue)
            {
                xml.WriteStartElement("dateposted");
                xml.WriteDateSplitElements(GlPostingDate.Value);
                xml.WriteEndElement(); //dateposted
            }

            xml.WriteElement("batchkey", SummaryRecordNo);

            xml.WriteElement("adjustmentno", AdjustmentNumber);

            xml.WriteElement("action", Action);

            xml.WriteElement("invoiceno", InvoiceNumber);

            xml.WriteElement("description", Description);

            xml.WriteElement("externalid", ExternalId);

            WriteXmlMultiCurrencySection(ref xml);

            xml.WriteElement("nogl", DoNotPostToGL);

            xml.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteStartElement("aradjustmentitems");

            if (Lines.Count > 0)
            {
                foreach (ArAdjustmentLineCreate Line in Lines)
                {
                    Line.WriteXml(ref xml);
                }
            }
            xml.WriteEndElement(); //aradjustmentitems

            xml.WriteEndElement(); //create_aradjustment

            xml.WriteEndElement(); //function
        }
コード例 #6
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("potransitem");

            xml.WriteElement("itemid", ItemId, true);
            xml.WriteElement("itemdesc", ItemDescription);
            xml.WriteElement("taxable", Taxable);
            xml.WriteElement("warehouseid", WarehouseId);
            xml.WriteElement("quantity", Quantity, true);
            xml.WriteElement("unit", Unit);
            xml.WriteElement("linelevelsimpletaxtype", LineLevelSimpleTaxType);
            xml.WriteElement("price", Price);
            xml.WriteElement("sourcelinekey", SourceLineRecordNo);
            xml.WriteElement("overridetaxamount", OverrideTaxAmount);

            if (!string.IsNullOrWhiteSpace(LineDeliverToContactName))
            {
                xml.WriteStartElement("deliverto");
                xml.WriteElement("contactname", LineDeliverToContactName, true);
                xml.WriteEndElement(); //deliverto
            }

            xml.WriteElement("tax", Tax);
            xml.WriteElement("locationid", LocationId);
            xml.WriteElement("departmentid", DepartmentId);
            xml.WriteElement("memo", Memo);

            if (ItemDetails.Count > 0)
            {
                xml.WriteStartElement("itemdetails");
                foreach (AbstractTransactionItemDetail itemDetail in ItemDetails)
                {
                    itemDetail.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //itemdetails
            }

            xml.WriteElement("form1099", Form1099);
            xml.WriteElement("form1099type", Form1099Type);
            xml.WriteElement("form1099box", Form1099Box);

            xml.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteElement("projectid", ProjectId);
            xml.WriteElement("customerid", CustomerId);
            xml.WriteElement("vendorid", VendorId);
            xml.WriteElement("employeeid", EmployeeId);
            xml.WriteElement("classid", ClassId);
            xml.WriteElement("contractid", ContractId);
            xml.WriteElement("billable", Billable);

            xml.WriteEndElement(); //potransitem
        }
コード例 #7
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("update");
            xml.WriteStartElement("CONTRACTDETAIL");

            xml.WriteElement("RECORDNO", RecordNo, true);

            xml.WriteElement("ITEMID", ItemId);
            xml.WriteElement("BEGINDATE", BeginDate, IaXmlWriter.IntacctDateFormat);
            xml.WriteElement("ENDDATE", EndDate, IaXmlWriter.IntacctDateFormat);
            xml.WriteElement("ITEMDESC", ItemDescription);
            xml.WriteElement("RENEWAL", Renewal);
            xml.WriteElement("EXCH_RATE_DATE", ExchangeRateDate, IaXmlWriter.IntacctDateFormat);
            xml.WriteElement("EXCHANGE_RATE", ExchangeRateValue);

            xml.WriteElement("BILLINGMETHOD", BillingMethod);
            xml.WriteElement("BILLINGOPTIONS", FixedPriceFrequency);
            xml.WriteElement("QUANTITY", FixedPriceQuantity);
            xml.WriteElement("PRICE", FixedPriceRate);
            xml.WriteElement("MULTIPLIER", FixedPriceMultiplier);
            xml.WriteElement("DISCOUNTPERCENT", FixedPriceDiscountPercent);
            xml.WriteElement("BILLINGTEMPLATE", BillingTemplate);
            xml.WriteElement("BILLINGSTARTDATE", BillingStartDate, IaXmlWriter.IntacctDateFormat);
            xml.WriteElement("BILLINGENDDATE", BillingEndDate, IaXmlWriter.IntacctDateFormat);

            xml.WriteElement("FLATAMOUNT", FlatFixedAmount);

            xml.WriteElement("REVENUETEMPLATENAME", Revenue1Template);
            xml.WriteElement("REVENUESTARTDATE", Revenue1StartDate);
            xml.WriteElement("REVENUEENDDATE", Revenue1EndDate);

            xml.WriteElement("REVENUE2TEMPLATENAME", Revenue2Template);
            xml.WriteElement("REVENUE2STARTDATE", Revenue2StartDate);
            xml.WriteElement("REVENUE2ENDDATE", Revenue2EndDate);

            xml.WriteElement("SHIPTOCONTACTNAME", ShipToContactName);

            xml.WriteElement("LOCATIONID", LocationId);
            xml.WriteElement("DEPARTMENTID", DepartmentId);
            xml.WriteElement("PROJECTID", ProjectId);
            xml.WriteElement("VENDORID", VendorId);
            xml.WriteElement("EMPLOYEEID", EmployeeId);
            xml.WriteElement("CLASSID", ClassId);
            xml.WriteCustomFieldsImplicit(CustomFields);

            xml.WriteEndElement(); //CONTRACTDETAIL
            xml.WriteEndElement(); //update

            xml.WriteEndElement(); //function
        }
コード例 #8
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("getUserPermissions");

            xml.WriteElement("userId", UserId);

            xml.WriteEndElement(); //getUserPermissions
            xml.WriteEndElement(); //function
        }
コード例 #9
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("update");
            xml.WriteStartElement("USERINFO");

            xml.WriteElement("LOGINID", UserId, true);

            xml.WriteElement("USERTYPE", UserType);
            xml.WriteElement("DESCRIPTION", UserName);

            if (Active == true)
            {
                xml.WriteElement("STATUS", "active");
            }
            else if (Active == false)
            {
                xml.WriteElement("STATUS", "inactive");
            }

            xml.WriteElement("LOGINDISABLED", WebServicesOnly);
            xml.WriteElement("SSO_ENABLED", SsoEnabled);
            xml.WriteElement("SSO_FEDERATED_ID", SsoFederatedId);

            if (RestrictedEntities.Count > 0)
            {
                foreach (string restrictedEntity in RestrictedEntities)
                {
                    xml.WriteStartElement("USERLOCATIONS");
                    xml.WriteElement("LOCATIONID", restrictedEntity);
                    xml.WriteEndElement(); //USERLOCATIONS
                }
            }

            if (RestrictedDepartments.Count > 0)
            {
                foreach (string restrictedDepartment in RestrictedDepartments)
                {
                    xml.WriteStartElement("USERDEPARTMENTS");
                    xml.WriteElement("DEPARTMENTID", restrictedDepartment);
                    xml.WriteEndElement(); //USERDEPARTMENTS
                }
            }

            xml.WriteCustomFieldsImplicit(CustomFields);

            xml.WriteEndElement(); //USERINFO
            xml.WriteEndElement(); //update

            xml.WriteEndElement(); //function
        }
コード例 #10
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("record_cctransaction");

            xml.WriteElement("chargecardid", ChargeCardId, true);

            if (TransactionDate.HasValue)
            {
                xml.WriteStartElement("paymentdate");
                xml.WriteDateSplitElements(TransactionDate.Value);
                xml.WriteEndElement(); //paymentdate
            }

            xml.WriteElement("referenceno", ReferenceNumber);
            xml.WriteElement("payee", Payee);
            xml.WriteElement("description", Description);
            xml.WriteElement("supdocid", AttachmentsId);
            xml.WriteElement("currency", TransactionCurrency);

            if (ExchangeRateValue.HasValue)
            {
                xml.WriteElement("exchrate", ExchangeRateValue);
            }
            else if (ExchangeRateDate.HasValue || !string.IsNullOrWhiteSpace(ExchangeRateType))
            {
                if (ExchangeRateDate.HasValue)
                {
                    xml.WriteStartElement("exchratedate");
                    xml.WriteDateSplitElements(ExchangeRateDate.Value);
                    xml.WriteEndElement();
                }
                xml.WriteElement("exchratetype", ExchangeRateType, true);
            }

            xml.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteStartElement("ccpayitems");
            if (Lines.Count > 0)
            {
                foreach (ChargeCardTransactionLineCreate line in Lines)
                {
                    line.WriteXml(ref xml);
                }
            }
            xml.WriteEndElement(); //ccpayitems

            xml.WriteEndElement(); //record_cctransaction

            xml.WriteEndElement(); //function
        }
コード例 #11
0
        public void GetXmlTest()
        {
            string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<function controlid=""unittest"">
    <record_cctransaction>
        <chargecardid>AMEX1234</chargecardid>
        <paymentdate>
            <year>2015</year>
            <month>06</month>
            <day>30</day>
        </paymentdate>
        <ccpayitems>
            <ccpayitem>
                <glaccountno />
                <paymentamount>76343.43</paymentamount>
            </ccpayitem>
        </ccpayitems>
    </record_cctransaction>
</function>";

            Stream            stream      = new MemoryStream();
            XmlWriterSettings xmlSettings = new XmlWriterSettings();

            xmlSettings.Encoding    = Encoding.UTF8;
            xmlSettings.Indent      = true;
            xmlSettings.IndentChars = "    ";

            IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings);

            ChargeCardTransactionCreate record = new ChargeCardTransactionCreate("unittest");

            record.ChargeCardId    = "AMEX1234";
            record.TransactionDate = new DateTime(2015, 06, 30);

            ChargeCardTransactionLineCreate line = new ChargeCardTransactionLineCreate();

            line.TransactionAmount = 76343.43M;

            record.Lines.Add(line);

            record.WriteXml(ref xml);

            xml.Flush();
            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd())
                           .WithDifferenceEvaluator(DifferenceEvaluators.Default)
                           .Build();

            Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString());
        }
コード例 #12
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_aradjustment");

            xml.WriteAttribute("key", RecordNo);

            xml.WriteEndElement(); //delete_araccountlabel

            xml.WriteEndElement(); //function
        }
コード例 #13
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_expensetype");

            xml.WriteAttribute("expensetype", ExpenseType);

            xml.WriteEndElement(); //delete_expensetype

            xml.WriteEndElement(); //function
        }
コード例 #14
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId);

            xml.WriteStartElement("getDdsDdl");

            xml.WriteElement("object", ObjectName, true);

            xml.WriteEndElement(); //getDdsDdl

            xml.WriteEndElement(); //function
        }
コード例 #15
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_employee");

            xml.WriteAttribute("employeeid", EmployeeId, true);

            xml.WriteEndElement(); //delete_employee

            xml.WriteEndElement(); //function
        }
コード例 #16
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_contact");

            xml.WriteAttribute("contactname", ContactName, true);

            xml.WriteEndElement(); //delete_contact

            xml.WriteEndElement(); //function
        }
コード例 #17
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_apaccountlabel");

            xml.WriteAttribute("accountlabel", AccountLabel);

            xml.WriteEndElement(); //delete_apaccountlabel

            xml.WriteEndElement(); //function
        }
コード例 #18
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_department");

            xml.WriteAttribute("departmentid", DepartmentId, true);

            xml.WriteEndElement(); //delete_department

            xml.WriteEndElement(); //function
        }
コード例 #19
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_supdocfolder");

            xml.WriteAttribute("key", FolderName);

            xml.WriteEndElement(); //delete_supdocfolder

            xml.WriteEndElement(); //function
        }
コード例 #20
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_allocation");

            xml.WriteAttribute("key", AllocationId);

            xml.WriteEndElement(); //delete_allocation

            xml.WriteEndElement(); //function
        }
コード例 #21
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_customerchargecard");

            xml.WriteAttribute("recordno", RecordNo);

            xml.WriteEndElement(); //delete_customerchargecard

            xml.WriteEndElement(); //function
        }
コード例 #22
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_invoice");

            xml.WriteAttribute("key", RecordNo, true);

            xml.WriteEndElement(); //delete_invoice

            xml.WriteEndElement(); //function
        }
コード例 #23
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_customer");

            xml.WriteAttribute("customerid", CustomerId, true);

            xml.WriteEndElement(); //delete_customer

            xml.WriteEndElement(); //function
        }
コード例 #24
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete");
            xml.WriteElement("object", "CONTRACTDETAIL");
            xml.WriteElement("keys", RecordNo, true);

            xml.WriteEndElement(); //delete

            xml.WriteEndElement(); //function
        }
コード例 #25
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_glaccount");

            xml.WriteAttribute("glaccountno", AccountNo, true);

            xml.WriteEndElement(); //delete_glaccount

            xml.WriteEndElement(); //function
        }
コード例 #26
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("delete_item");

            xml.WriteAttribute("itemid", ItemId, true);

            xml.WriteEndElement(); //delete_item

            xml.WriteEndElement(); //function
        }
コード例 #27
0
        public void GetXmlTest()
        {
            string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<function controlid=""unittest"">
    <create>
        <TIMESHEET>
            <EMPLOYEEID>E1234</EMPLOYEEID>
            <BEGINDATE>06/30/2016</BEGINDATE>
            <TIMESHEETENTRIES>
                <TIMESHEETENTRY>
                    <ENTRYDATE>06/30/2016</ENTRYDATE>
                    <QTY>1.75</QTY>
                </TIMESHEETENTRY>
            </TIMESHEETENTRIES>
        </TIMESHEET>
    </create>
</function>";

            Stream            stream      = new MemoryStream();
            XmlWriterSettings xmlSettings = new XmlWriterSettings();

            xmlSettings.Encoding    = Encoding.UTF8;
            xmlSettings.Indent      = true;
            xmlSettings.IndentChars = "    ";

            IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings);

            TimesheetCreate record = new TimesheetCreate("unittest");

            record.EmployeeId = "E1234";
            record.BeginDate  = new DateTime(2016, 06, 30);

            TimesheetEntryCreate entry = new TimesheetEntryCreate();

            entry.EntryDate = new DateTime(2016, 06, 30);
            entry.Quantity  = 1.75M;

            record.Entries.Add(entry);

            record.WriteXml(ref xml);

            xml.Flush();
            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd())
                           .WithDifferenceEvaluator(DifferenceEvaluators.Default)
                           .Build();

            Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString());
        }
コード例 #28
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_paymentrequest");

            if (!string.IsNullOrWhiteSpace(ChargeCardId))
            {
                xml.WriteElement("chargecardid", ChargeCardId);
            }
            else
            {
                xml.WriteElement("bankaccountid", BankAccountId);
            }

            xml.WriteElement("vendorid", VendorId, true);

            xml.WriteElement("memo", Memo);

            xml.WriteElement("paymentmethod", PaymentMethod, true);

            xml.WriteElement("grouppayments", GroupPayments);

            xml.WriteStartElement("paymentdate");
            xml.WriteDateSplitElements(PaymentDate, true);
            xml.WriteEndElement(); //paymentdate

            xml.WriteElement("paymentoption", MergeOption);

            if (ApplyToTransactions.Count > 0)
            {
                xml.WriteStartElement("paymentrequestitems");
                foreach (ApPaymentRequestItem applyToTransaction in ApplyToTransactions)
                {
                    applyToTransaction.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //paymentrequestitems
            }

            xml.WriteElement("documentnumber", DocumentNo);

            // TODO: review paymentdescription vs memo
            xml.WriteElement("paymentdescription", Memo);

            xml.WriteElement("paymentcontact", NotificationContactName);

            xml.WriteEndElement(); //create_paymentrequest

            xml.WriteEndElement(); //function
        }
コード例 #29
0
        public void WriteXmlTransactionTest()
        {
            SdkConfig config = new SdkConfig()
            {
                SessionId   = "fakesession..",
                Transaction = true,
            };

            Content          contentBlock = new Content();
            ApiSessionCreate func         = new ApiSessionCreate()
            {
                ControlId = "unittest",
            };

            contentBlock.Add(func);

            string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>
<operation transaction=""true"">
    <authentication>
        <sessionid>fakesession..</sessionid>
    </authentication>
    <content>
        <function controlid=""unittest"">
            <getAPISession />
        </function>
    </content>
</operation>";

            Stream            stream      = new MemoryStream();
            XmlWriterSettings xmlSettings = new XmlWriterSettings();

            xmlSettings.Encoding    = Encoding.UTF8;
            xmlSettings.Indent      = true;
            xmlSettings.IndentChars = "    ";

            IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings);

            OperationBlock operationBlock = new OperationBlock(config, contentBlock);

            operationBlock.WriteXml(ref xml);

            xml.Flush();
            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd())
                           .WithDifferenceEvaluator(DifferenceEvaluators.Default)
                           .Build();

            Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString());
        }
コード例 #30
0
        private void WriteCrudXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement(GetFunction());

            xml.WriteElement("object", "APPYMT");
            xml.WriteElement("keys", _recordNo);

            xml.WriteEndElement(); //delete

            xml.WriteEndElement(); //function
        }