Ejemplo n.º 1
0
        /// <summary>
        /// A basic add example
        /// </summary>
        /// <param name="orgCode">Organization code</param>
        /// <param name="orderNumber">The order number of the item's parent order</param>
        /// <param name="function">Specify the function ID this order item is from (ex: the merchandising function)</param>
        /// <param name="resourceType">The resource type of the item you want from the Resource master table (ER370_RES_MASTER)</param>
        /// <param name="resourceCode">The resource code of the item you want from the Resource master table (ER370_RES_MASTER)</param>
        /// <param name="units">The amount of items you want on the order</param>
        /// <param name="unitCharge">The price per unit</param>
        /// <param name="registrant">Specify the registrant account code on the order this will attach to</param>
        /// <param name="itemStatus">The status code for the new item.  The order item status is set to the code found in the Order Item Status Master window of v20</param>
        /// <param name="registrantType">This is the Registrant Type code of the order item.  Find this on the "Registrant Type" field on the Order.</param>
        /// <returns></returns>
        public RegistrationOrderItemsModel Add(string orgCode, int orderNumber, int function, string resourceType, string resourceCode, int units, int unitCharge, string registrant, string itemStatus, string registrantType)
        {
            //Note that OrderLineNumber shouldn't be set for POST operations.  Ungerboeck will assign the order line number automatically

            var myRegistrationOrderItem = new RegistrationOrderItemsModel
            {
                OrganizationCode = orgCode,
                OrderNumber      = orderNumber,
                Function         = function,
                ResourceType     = resourceType,
                ResourceCode     = resourceCode,
                Units            = units,
                UnitCharge       = unitCharge,
                Registrant       = registrant,
                ItemStatus       = itemStatus,
                RegistrantType   = registrantType,
                StartDate        = System.DateTime.Now,
                EndDate          = System.DateTime.Now.AddDays(1)
            };

            return(APIUtil.AddRegistrationOrderItem(USISDKClient, myRegistrationOrderItem));
        }