Пример #1
0
        protected override object ReadRow(IRowReader reader)
        {
            BrandMetadataSelectableSetting brandMetadataSelectableSetting = BrandMetadataSelectableSetting.New();

            // Table Fields
            brandMetadataSelectableSetting.BrandMetadataSelectableSettingId = reader.GetInt32("BrandMetadataSelectableSettingId");

            brandMetadataSelectableSetting.BrandMetadataSettingId = reader.GetInt32("BrandMetadataSettingId");
            brandMetadataSelectableSetting.SelectableType         = reader.GetInt32("SelectableType");
            brandMetadataSelectableSetting.Depth                = reader.GetInt32("Depth");
            brandMetadataSelectableSetting.IsLinear             = reader.GetBoolean("IsLinear");
            brandMetadataSelectableSetting.SortType             = reader.GetInt32("SortType");
            brandMetadataSelectableSetting.AllowMultiple        = reader.GetBoolean("AllowMultiple");
            brandMetadataSelectableSetting.OrderType            = reader.GetInt32("OrderType");
            brandMetadataSelectableSetting.ColumnCount          = reader.GetInt32("ColumnCount");
            brandMetadataSelectableSetting.FilterGroup          = reader.GetInt32("FilterGroup");
            brandMetadataSelectableSetting.FilterSelectableType = reader.GetInt32("FilterSelectableType");
            brandMetadataSelectableSetting.FilterDepth          = reader.GetInt32("FilterDepth");

            brandMetadataSelectableSetting.IsDirty = false;
            brandMetadataSelectableSetting.ChangedProperties.Clear();

            return(brandMetadataSelectableSetting);
        }
Пример #2
0
        public static BrandMetadataSelectableSetting FindOne(BrandMetadataSelectableSettingFinder finder)
        {
            BrandMetadataSelectableSetting BrandMetadataSelectableSetting = BrandMetadataSelectableSettingMapper.Instance.FindOne(finder);

            return(BrandMetadataSelectableSetting ?? Empty);
        }
Пример #3
0
 public static BrandMetadataSelectableSetting Update(BrandMetadataSelectableSetting metadataSetting)
 {
     return(BrandMetadataSelectableSettingMapper.Instance.Update(metadataSetting));
 }
Пример #4
0
        public static BrandMetadataSelectableSetting Get(Nullable <Int32> BrandMetadataSelectableSettingId)
        {
            BrandMetadataSelectableSetting BrandMetadataSelectableSetting = BrandMetadataSelectableSettingMapper.Instance.Get(BrandMetadataSelectableSettingId);

            return(BrandMetadataSelectableSetting ?? Empty);
        }
Пример #5
0
 /// <summary>
 /// overrides the default logic where the selecatble setting is retrieved from the database. this way a selectable setting
 /// that is not yet persisted to the database can be used instead for example for previewing purposes
 /// </summary>
 /// <param name="setting"></param>
 public void SetSelectableSetting(BrandMetadataSelectableSetting setting)
 {
     m_BrandMetadataSelectableSetting = setting;
 }
Пример #6
0
        public virtual BrandMetadataSelectableSetting Update(BrandMetadataSelectableSetting brandMetadataSelectableSetting)
        {
            if (!brandMetadataSelectableSetting.IsDirty || brandMetadataSelectableSetting.IsNull)
            {
                // Nothing to do - no point hammering the database unnecessarily
                return(brandMetadataSelectableSetting);
            }

            IDbCommand command = CreateCommand();

            if (brandMetadataSelectableSetting.IsNew)
            {
                // Adding
                command.CommandText
                    = @"INSERT INTO [BrandMetadataSelectableSetting] 
                                ([BrandMetadataSettingId], 
                                 [SelectableType], 
                                 [Depth], 
                                 [IsLinear], 
                                 [SortType], 
                                 [AllowMultiple], 
                                 [OrderType], 
                                 [ColumnCount],
                                 [FilterGroup],
                                 [FilterSelectableType],
                                 [FilterDepth]

                                 ) VALUES (
                                 @brandMetadataSettingId, 
                                 @selectableType		, 
                                 @depth				, 
                                 @isLinear			, 
                                 @sortType			, 
                                 @allowMultiple		, 
                                 @orderType			, 
                                 @columnCount       ,
                                 @filterGroup       ,
                                 @filterSelectableType,       
                                 @filterDepth       
                                    ) ; SELECT @@identity AS NewId;";
            }
            else
            {
                // Updating
                command.CommandText = @"UPDATE [BrandMetadataSelectableSetting] 
                                        SET 
                                            [BrandMetadataSettingId]=   @brandMetadataSettingId, 
                                            [SelectableType]=  @selectableType, 
                                            [Depth]=  @depth, 
                                            [IsLinear]=  @isLinear, 
                                            [SortType]=  @sortType, 
                                            [AllowMultiple]=  @allowMultiple, 
                                            [OrderType]=  @orderType, 
                                            [ColumnCount]=  @columnCount,				 
                                            [FilterGroup]=  @filterGroup,				 
                                            [FilterSelectableType]=  @filterSelectableType,				 
                                            [FilterDepth]=  @filterDepth				 

                                        WHERE BrandMetadataSelectableSettingId = @brandMetadataSelectableSettingId";
            }

            command.Parameters.Add(CreateParameter("@brandMetadataSettingId", brandMetadataSelectableSetting.BrandMetadataSettingId));
            command.Parameters.Add(CreateParameter("@selectableType", brandMetadataSelectableSetting.SelectableType));
            command.Parameters.Add(CreateParameter("@depth", brandMetadataSelectableSetting.Depth));
            command.Parameters.Add(CreateParameter("@isLinear", brandMetadataSelectableSetting.IsLinear));
            command.Parameters.Add(CreateParameter("@sortType", brandMetadataSelectableSetting.SortType));
            command.Parameters.Add(CreateParameter("@allowMultiple", brandMetadataSelectableSetting.AllowMultiple));
            command.Parameters.Add(CreateParameter("@orderType", brandMetadataSelectableSetting.OrderType));
            command.Parameters.Add(CreateParameter("@columnCount", brandMetadataSelectableSetting.ColumnCount));
            command.Parameters.Add(CreateParameter("@filterGroup", brandMetadataSelectableSetting.FilterGroup));
            command.Parameters.Add(CreateParameter("@filterSelectableType", brandMetadataSelectableSetting.FilterSelectableType));
            command.Parameters.Add(CreateParameter("@filterDepth", brandMetadataSelectableSetting.FilterDepth));

            if (brandMetadataSelectableSetting.IsNew)
            {
                brandMetadataSelectableSetting.BrandMetadataSelectableSettingId = Convert.ToInt32(ExecScalar(command));
            }
            else
            {
                command.Parameters.Add(CreateParameter("@brandMetadataSelectableSettingId", brandMetadataSelectableSetting.BrandMetadataSelectableSettingId));
                ExecuteCommand(command);
            }

            brandMetadataSelectableSetting.IsDirty = false;
            brandMetadataSelectableSetting.ChangedProperties.Clear();

            return(brandMetadataSelectableSetting);
        }