Esempio n. 1
0
        public Tagge.Common.Models.ProductAlternateIdResponse ConvertToAlternateIdResponse()
        {
            var response = new Tagge.Common.Models.ProductAlternateIdResponse();

            // Properties
            response.Id   = PC_AlternateId_Id;
            response.Sku  = Sku;
            response.Unit = Unit;
            response.AlternateIdTypeId = PC_AlternateIdTypeId;
            response.AlternateId       = AlternateId;
            response.Description       = Description;

            // Custom Fields
            if (CustomFields != null)
            {
                response.CustomFields = new List <Tagge.Common.Models.GenericCustomFieldResponse>();
                foreach (var customField in CustomFields)
                {
                    response.CustomFields.Add(customField.ConvertToResponse());
                }
            }

            // ExternalIds - Managed in PC_ExternalId

            return(response);
        }
Esempio n. 2
0
        public Tagge.Common.Models.ProductAlternateIdResponse ConvertToResponse(string companyId, string tableName, IMongoDatabase db)
        {
            var response = new Tagge.Common.Models.ProductAlternateIdResponse();

            // Properties
            response.Id   = PC_AlternateId_Id;
            response.Sku  = Sku;
            response.Unit = Unit;
            response.AlternateIdTypeId = PC_AlternateIdTypeId;
            response.AlternateId       = AlternateId;
            response.Description       = Description;

            // Custom Fields
            if (CustomFields != null)
            {
                response.CustomFields = new List <Tagge.Common.Models.GenericCustomFieldResponse>();
                foreach (var customField in CustomFields)
                {
                    response.CustomFields.Add(customField.ConvertToResponse());
                }
            }

            // ExternalIds
            response.ExternalIds = PC_ExternalId.ConvertToResponse(PC_AlternateId_Id, tableName, companyId, db);

            return(response);
        }