Exemplo n.º 1
0
 private void RefreshProductGroupSettingVM(ProductGroupSettingVM vm)
 {
     vm.ProductGroupProperty.SysNo = 0;
     vm.PropertyBriefName          = String.Empty;
     vm.ImageShow = ProductGroupImageShow.No;
     vm.Polymeric = ProductGroupPolymeric.No;
 }
Exemplo n.º 2
0
        public ProductGroupMaintainPropertySettingVM ConvertProductGroupEntityToProductGroupMaintainPropertySettingVM(ProductGroup data)
        {
            var vm = new ProductGroupMaintainPropertySettingVM {
                ProductGroupSettings = new List <ProductGroupSettingVM>()
            };

            ProductGroupMaintainPropertySettingVM localVM = vm;

            data.ProductGroupSettings.ForEach(settingInfo =>
            {
                var setting = new ProductGroupSettingVM
                {
                    ProductGroupProperty = new PropertyVM()
                };
                if (settingInfo.ProductGroupProperty.SysNo.HasValue)
                {
                    setting.ProductGroupProperty.SysNo        = settingInfo.ProductGroupProperty.SysNo.Value;
                    setting.ProductGroupProperty.PropertyName = settingInfo.ProductGroupProperty.PropertyName.Content;
                    setting.PropertyBriefName = settingInfo.PropertyBriefName.Content;
                    setting.ImageShow         = settingInfo.ImageShow;
                    setting.Polymeric         = settingInfo.Polymeric;
                    localVM.ProductGroupSettings.Add(setting);
                }
            });

            if (vm.ProductGroupSettings.Count == 0)
            {
                vm = new ProductGroupMaintainPropertySettingVM();
            }

            if (vm.ProductGroupSettings.Count == 1)
            {
                vm.ProductGroupSettings.Add(new ProductGroupSettingVM());
            }

            return(vm);
        }