Exemplo n.º 1
0
        private Customization PopulateCustomizationById(int?customizationId)
        {
            Customization customization = new Customization();

            if (customizationId != null && customizationId > 0)
            {
                customization = _customizationRepository.GetById(customizationId.Value);
            }
            return(customization);
        }
Exemplo n.º 2
0
        private int?ProcessIncomingCustomization(int userId, int?customizationId, Customization customization)
        {
            var id = customizationId;

            if (customization != null)
            {
                if (id == null)
                {
                    //create customization
                    customization.CreateUserId = userId;
                    id = _customizationRepository.Create(customization);
                }
                else
                {
                    //update existing
                    var existingCustomization = _customizationRepository.GetById(id.Value);
                    existingCustomization.CustomCSS    = customization.CustomCSS;
                    existingCustomization.CustomJS     = customization.CustomJS;
                    existingCustomization.UpdateUserId = userId;
                    id = _customizationRepository.UpdateEntity(existingCustomization);
                }
            }
            return(id);
        }