コード例 #1
0
        /// <summary>
        /// Create the needed table to append to the collection.
        /// </summary>
        /// <returns></returns>
        internal AutoGen.AlternateTaxTable GetAutoGenTable()
        {
            AutoGen.AlternateTaxTable retVal
                              = new GCheckout.AutoGen.AlternateTaxTable();
            retVal.name       = Name;
            retVal.standalone = StandAlone;
            if (StandAlone)
            {
                retVal.standaloneSpecified = true;
            }

            //Issue 55, we must always append the node, even if no rules exist.
            retVal.alternatetaxrules = _taxRules.ToArray();

            return(retVal);
        }
コード例 #2
0
        /// <summary>
        /// Append this collection of tax tables to the request object.
        /// </summary>
        /// <param name="taxTables">The <see cref="AutoGen.TaxTables"/> used in the request</param>
        internal void AppendToRequest(AutoGen.TaxTables taxTables)
        {
            if (this.Count > 0)
            {
                AlternateTaxTable[] items = new AlternateTaxTable[this.Count];
                _taxTables.Values.CopyTo(items, 0);

                AutoGen.AlternateTaxTable[] altTables
                    = new GCheckout.AutoGen.AlternateTaxTable[items.Length];

                for (int i = 0; i < items.Length; i++)
                {
                    altTables[i] = items[i].GetAutoGenTable();
                }

                taxTables.alternatetaxtables = altTables;
            }
            else
            {
                //Console.WriteLine("AlternateTaxTable:" + 0);
            }
        }
        /// <summary>
        /// Create the needed table to append to the collection.
        /// </summary>
        /// <returns></returns>
        internal AutoGen.AlternateTaxTable GetAutoGenTable()
        {
            AutoGen.AlternateTaxTable retVal
            = new GCheckout.AutoGen.AlternateTaxTable();
              retVal.name = Name;
              retVal.standalone = StandAlone;
              if (StandAlone) {
            retVal.standaloneSpecified = true;
              }

              //Issue 55, we must always append the node, even if no rules exist.
              retVal.alternatetaxrules = _taxRules.ToArray();

              return retVal;
        }
        /// <summary>
        /// Append this collection of tax tables to the request object.
        /// </summary>
        /// <param name="taxTables">The <see cref="AutoGen.TaxTables"/> used in the request</param>
        internal void AppendToRequest(AutoGen.TaxTables taxTables)
        {
            if (this.Count > 0) {
            AlternateTaxTable[] items = new AlternateTaxTable[this.Count];
            _taxTables.Values.CopyTo(items, 0);

            AutoGen.AlternateTaxTable[] altTables
              = new GCheckout.AutoGen.AlternateTaxTable[items.Length];

            for(int i = 0; i < items.Length; i++) {
              altTables[i] = items[i].GetAutoGenTable();
            }

            taxTables.alternatetaxtables = altTables;
              }
              else {
            //Console.WriteLine("AlternateTaxTable:" + 0);
              }
        }