private void GetValueFromAddEditDialog(AddSettingValueViewModel vm, ref SettingValue settingValue)
        {
            switch (vm.ValueType)
            {
            case Infrastructure.Enumerations.ValueType.Boolean:
                settingValue.BooleanValue = vm.BooleanValue;
                settingValue.ValueType    = textBoolean;
                break;

            case Infrastructure.Enumerations.ValueType.DataTime:
                settingValue.DateTimeValue = vm.DateTimeValue;
                settingValue.ValueType     = textDateTime;
                break;

            case Infrastructure.Enumerations.ValueType.Decimal:
                settingValue.DecimalValue = vm.DecimalValue;
                settingValue.ValueType    = textDecimal;
                break;

            case Infrastructure.Enumerations.ValueType.Integer:
                settingValue.IntegerValue = vm.IntegerValue;
                settingValue.ValueType    = textInteger;
                break;

            case Infrastructure.Enumerations.ValueType.LongText:
                settingValue.LongTextValue = vm.LongTextValue;
                settingValue.ValueType     = textLongText;
                break;

            case Infrastructure.Enumerations.ValueType.ShortText:
                settingValue.ShortTextValue = vm.ShortTextValue;
                settingValue.ValueType      = textShortText;
                break;
            }
        }
        private void RaiseAddSettingRequest(OperationType operationType)
        {
            if (CommonConfirmRequest != null)
            {
                var operType = operationType;
                var itemVM   = new AddSettingValueViewModel(ValueType, operationType);
                ConditionalConfirmation confirmation = new ConditionalConfirmation();

                if (operationType == OperationType.Edit)
                {
                    switch (ValueType)
                    {
                    case Infrastructure.Enumerations.ValueType.Boolean:
                        itemVM.BooleanValue = SelectedSettingValue.BooleanValue;
                        break;

                    case Infrastructure.Enumerations.ValueType.DataTime:
                        itemVM.DateTimeValue = SelectedSettingValue.DateTimeValue;
                        break;

                    case Infrastructure.Enumerations.ValueType.Decimal:
                        itemVM.DecimalValue = SelectedSettingValue.DecimalValue;
                        break;

                    case Infrastructure.Enumerations.ValueType.Integer:
                        itemVM.IntegerValue = SelectedSettingValue.IntegerValue;
                        break;

                    case Infrastructure.Enumerations.ValueType.LongText:
                        itemVM.LongTextValue = SelectedSettingValue.LongTextValue;
                        break;

                    case Infrastructure.Enumerations.ValueType.ShortText:
                        itemVM.ShortTextValue = SelectedSettingValue.ShortTextValue;
                        break;
                    }
                    confirmation.Title = "Edit setting value".Localize();
                }
                else
                {
                    confirmation.Title = "Add setting value".Localize();
                }

                confirmation.Content = itemVM;

                CommonConfirmRequest.Raise(confirmation,
                                           (x) =>
                {
                    if (x.Confirmed)
                    {
                        var vm = x.Content as AddSettingValueViewModel;

                        if (operType == OperationType.Add)
                        {
                            SettingValue settingToAdd = new SettingValue();

                            GetValueFromAddEditDialog(vm, ref settingToAdd);

                            this.InnerItem.SettingValues.Add(settingToAdd);
                        }
                        else
                        {
                            SettingValue settingToEdit = SelectedSettingValue;
                            GetValueFromAddEditDialog(vm, ref settingToEdit);
                        }

                        OnPropertyChanged("IsValid");
                        ItemAddCommand.RaiseCanExecuteChanged();
                        OnIsValidChanged();
                    }
                });
            }
        }