コード例 #1
0
        protected ViewModelBase CreateWageWidget(ICommonServices commonServices, AdvancedWageParameterType parameterType, IAdvancedWageParameter entity = null, IWageHierarchyNode hierarchyNode = null)
        {
            if (commonServices == null)
            {
                throw new ArgumentNullException(nameof(commonServices));
            }

            if (parameterType == AdvancedWageParameterType.DeliveryTime)
            {
                return(new DeliveryTimeAdvancedWageParameterViewModel
                       (
                           (DeliveryTimeAdvancedWageParameter)(entity ?? new DeliveryTimeAdvancedWageParameter {
                    Parent = hierarchyNode
                }),
                           commonServices
                       ));
            }

            if (parameterType == AdvancedWageParameterType.BottlesCount)
            {
                return(new BottlesCountAdvancedWageParameterViewModel
                       (
                           (BottlesCountAdvancedWageParameter)(entity ?? new BottlesCountAdvancedWageParameter {
                    Parent = hierarchyNode
                }),
                           commonServices
                       ));
            }

            throw new NotImplementedException(entity.AdvancedWageParameterType.ToString());
        }
コード例 #2
0
 public ViewModelBase GetAdvancedWageWidgetViewModel(AdvancedWageParameterType parameterType, IWageHierarchyNode hierarchyNode, ICommonServices commonServices)
 => CreateWageWidget(commonServices, parameterType, hierarchyNode: hierarchyNode);