Exemplo n.º 1
0
 public void SaveUpdateAttributeInfo(int attributeId, string attributeName, int inputTypeID, string defaultValue, int validationTypeID,
     System.Nullable<int> length, string aliasName, string aliasToolTip, string aliasHelp, int displayOrder, bool isUnique, bool isRequired, bool isEnableEditor,
     bool showInGrid, bool showInSearch, bool showInAdvanceSearch, bool showInComparison, bool isIncludeInPriceRule,
     bool isIncludeInPromotions, bool isEnableSorting, bool isUseInFilter, bool isShownInRating, int storeId, int portalId,
     bool isActive, bool isModified, string userName, string cultureName, string itemTypes, bool flag, bool isUsedInConfigItem, string saveOptions)
 {
     try
     {
         AttributesGetByAttributeIDInfo attributeInfoToInsert = new AttributesGetByAttributeIDInfo
         {
             AttributeID = attributeId,
             AttributeName = attributeName,
             InputTypeID = inputTypeID,
             DefaultValue = defaultValue,
             ValidationTypeID = validationTypeID,
             Length = length > 0 ? length : null,
             AliasName = aliasName,
             AliasToolTip = aliasToolTip,
             AliasHelp = aliasHelp,
             DisplayOrder = displayOrder,
             IsUnique = isUnique,
             IsRequired = isRequired,
             IsEnableEditor = isEnableEditor,
             ShowInGrid = showInGrid,
             ShowInSearch = showInSearch,
             ShowInAdvanceSearch = showInAdvanceSearch,
             ShowInComparison = showInComparison,
             IsIncludeInPriceRule = isIncludeInPriceRule,
             IsIncludeInPromotions = isIncludeInPromotions,
             IsEnableSorting = isEnableSorting,
             IsUseInFilter = isUseInFilter,
             IsShownInRating = isShownInRating,
             StoreID = storeId,
             PortalID = portalId,
             IsActive = isActive,
             IsModified = isModified,
             UpdatedBy = userName,
             AddedBy = userName,
             CultureName = cultureName,
             ItemTypes = itemTypes,
             Flag = flag,
             IsUsedInConfigItem = isUsedInConfigItem,
             SaveOptions = saveOptions
         };
         ItemAttributesManagementSqlProvider obj = new ItemAttributesManagementSqlProvider();
         obj.SaveAttribute(attributeInfoToInsert);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// To Save Attribute 
        /// </summary>
        /// <returns></returns>
        public void SaveAttribute(AttributesGetByAttributeIDInfo attributeToInsert)
        {
            try
            {
                List<KeyValuePair<string, object>> ParaMeterCollection = new List<KeyValuePair<string, object>>();
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@AttributeID", attributeToInsert.AttributeID));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@AttributeName", attributeToInsert.AttributeName));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@InputTypeID", attributeToInsert.InputTypeID));

                ParaMeterCollection.Add(new KeyValuePair<string, object>("@DefaultValue", attributeToInsert.DefaultValue));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@Length", attributeToInsert.Length));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@AliasName", attributeToInsert.AliasName));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@AliasToolTip", attributeToInsert.AliasToolTip));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@AliasHelp", attributeToInsert.AliasHelp));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@DisplayOrder", attributeToInsert.DisplayOrder));

                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsUnique", attributeToInsert.IsUnique));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsRequired", attributeToInsert.IsRequired));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ShowInAdvanceSearch", attributeToInsert.ShowInAdvanceSearch));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ShowInComparison", attributeToInsert.ShowInComparison));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsIncludeInPriceRule", attributeToInsert.IsIncludeInPriceRule));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsIncludeInPromotions", attributeToInsert.IsIncludeInPromotions));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsEnableEditor", attributeToInsert.IsEnableEditor));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ShowInSearch", attributeToInsert.ShowInSearch));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ShowInGrid", attributeToInsert.ShowInGrid));

                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsEnableSorting", attributeToInsert.IsEnableSorting));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsUseInFilter", attributeToInsert.IsUseInFilter));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsShownInRating", attributeToInsert.IsShownInRating));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsActive", attributeToInsert.IsActive));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsModified", attributeToInsert.IsModified));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ValidationTypeID", attributeToInsert.ValidationTypeID));

                ParaMeterCollection.Add(new KeyValuePair<string, object>("@StoreID", attributeToInsert.StoreID));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@PortalID", attributeToInsert.PortalID));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@UserName", attributeToInsert.AddedBy));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@CultureName", attributeToInsert.CultureName));

                ParaMeterCollection.Add(new KeyValuePair<string, object>("@ItemTypes", attributeToInsert.ItemTypes));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@UpdateFlag", attributeToInsert.Flag));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@IsUsedInConfigItem", attributeToInsert.IsUsedInConfigItem));
                ParaMeterCollection.Add(new KeyValuePair<string, object>("@SaveOptions", attributeToInsert.SaveOptions));
                SQLHandler Sq = new SQLHandler();
                Sq.ExecuteNonQuery("dbo.usp_ASPX_AttributeAddUpdate", ParaMeterCollection);
            }
            catch (Exception e)
            {
                throw e;
            }
        }