public override XElement GenerateAddRq() { XElement Add = new XElement("CustomerAdd"); Add.Add(Name?.ToQBXML(nameof(Name))); Add.Add(IsActive.ToQBXML(nameof(IsActive))); Add.Add(ClassRef?.ToQBXML(nameof(ClassRef))); Add.Add(ParentRef?.ToQBXML(nameof(ParentRef))); Add.Add(CompanyName?.ToQBXML(nameof(CompanyName))); Add.Add(Salutation?.ToQBXML(nameof(Salutation))); Add.Add(FirstName?.ToQBXML(nameof(FirstName))); Add.Add(MiddleName?.ToQBXML(nameof(MiddleName))); Add.Add(LastName?.ToQBXML(nameof(LastName))); Add.Add(JobTitle?.ToQBXML(nameof(JobTitle))); Add.Add(BillAddress?.ToQBXML(nameof(BillAddress))); Add.Add(ShipAddress?.ToQBXML(nameof(ShipAddress))); Add.Add(ShipToAddress?.ToQBXML(nameof(ShipToAddress))); Add.Add(Phone?.ToQBXML(nameof(Phone))); Add.Add(AltPhone?.ToQBXML(nameof(AltPhone))); Add.Add(Fax?.ToQBXML(nameof(Fax))); Add.Add(Email?.ToQBXML(nameof(Email))); Add.Add(Cc?.ToQBXML(nameof(Cc))); Add.Add(Contact?.ToQBXML(nameof(Contact))); Add.Add(AltContact?.ToQBXML(nameof(AltContact))); Add.Add(AdditionalContactRef?.ToQBXML(nameof(AdditionalContactRef))); Add.Add(Contacts?.ToQBXML <Contacts>(nameof(Contacts))); Add.Add(CustomerTypeRef?.ToQBXML(nameof(CustomerTypeRef))); Add.Add(TermsRef?.ToQBXML(nameof(TermsRef))); Add.Add(SalesRepRef?.ToQBXML(nameof(SalesRepRef))); Add.Add(OpenBalance?.ToQBXML(nameof(OpenBalance))); Add.Add(OpenBalanceDate?.ToQBXML(nameof(OpenBalanceDate))); Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef))); Add.Add(ItemSalesTaxRef?.ToQBXML(nameof(ItemSalesTaxRef))); Add.Add(ResaleNumber?.ToQBXML(nameof(ResaleNumber))); Add.Add(AccountNumber?.ToQBXML(nameof(AccountNumber))); Add.Add(CreditLimit?.ToQBXML(nameof(CreditLimit))); Add.Add(PreferredPaymentMethodRef?.ToQBXML(nameof(PreferredPaymentMethodRef))); Add.Add(CreditCardInfo?.ToQBXML(nameof(CreditCardInfo))); Add.Add(JobStatus.ToQBXML(nameof(JobStatus))); Add.Add(JobStartDate?.ToQBXML(nameof(JobStartDate))); Add.Add(JobProjectedEndDate?.ToQBXML(nameof(JobProjectedEndDate))); Add.Add(JobEndDate?.ToQBXML(nameof(JobEndDate))); Add.Add(JobDesc?.ToQBXML(nameof(JobDesc))); Add.Add(JobTypeRef?.ToQBXML(nameof(JobTypeRef))); Add.Add(Notes?.ToQBXML(nameof(Notes))); Add.Add(AdditionalNotes?.ToQBXML(nameof(AdditionalNotes))); Add.Add(PreferredDeliveryMethod.ToQBXML(nameof(PreferredDeliveryMethod))); Add.Add(PriceLevelRef?.ToQBXML(nameof(PriceLevelRef))); Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID))); Add.Add(CurrencyRef?.ToQBXML(nameof(CurrencyRef))); XElement AddRq = new XElement("CustomerAddRq"); AddRq.Add(Add); AddRq.Add(IncludeRetElement?.ToQBXML(nameof(IncludeRetElement))); return(AddRq); }
public string toXmlAdd() { string xml = "<InvoiceLineAdd>"; if (ItemRef != null) { xml += ItemRef.toXmlRef(); } if (Desc != "") { xml += "<Desc>" + Desc + "</Desc>"; } if (Quantity != null) { xml += "<Quantity>" + Functions.FloatToString((float)Quantity) + "</Quantity>"; } if (UnitOfMeasure != "") { xml += "<UnitOfMeasure>" + UnitOfMeasure + "</UnitOfMeasure>"; } if (Rate != null) { xml += "<Rate>" + Functions.FloatToString((float)Rate) + "</Rate>"; } else if (RatePercent != null) { xml += "<RatePercent>" + Functions.FloatToString((float)RatePercent) + "</RatePercent>"; } else if (PriceLevelRef != null) { xml += PriceLevelRef.toXmlRef(); } if (ClassRef != null) { xml += ClassRef.toXmlRef(); } if (Amount != null) { xml += "<Amount>" + Functions.FloatToString((float)Amount) + "</Amount>"; } if (InventorySiteRef != null) { xml += InventorySiteRef.toXmlRef(); } //OptionForPriceRuleConflict xml += "</InvoiceLineAdd>"; return(xml); }