/// <summary>
        /// Creates a Keyword Product
        /// </summary>
        /// <param name="Ado"></param>
        /// <param name="productDto"></param>
        /// <param name="productID"></param>
        internal void Create(ADO Ado, Product_DTO productDto, int productID)
        {
            //If there is no direct means of finding out which langauge the product name uses,
            // we take a default language from the settings
            string LngIsoCode;

            if (productDto.LngIsoCode == null)
            {
                LngIsoCode = Configuration_BSO.GetCustomConfig("language.iso.code");
            }
            else
            {
                LngIsoCode = productDto.LngIsoCode;
            }

            //Create the table that will be bulk inserted
            DataTable dt = new DataTable();

            dt.Columns.Add("KPR_VALUE", typeof(string));
            dt.Columns.Add("KPR_PRC_ID", typeof(int));
            dt.Columns.Add("KPR_MANDATORY_FLAG", typeof(bool));

            Keyword_Product_ADO keywordProductAdo = new Keyword_Product_ADO(Ado);


            //Get a Keyword Extractor - the particular version returned will depend on the language
            Keyword_BSO_Extract kbe = new Navigation.Keyword_BSO_Extract(LngIsoCode);

            AddToTable(ref dt, kbe.ExtractSplitSingular(productDto.PrcValue), productID);

            keywordProductAdo.Create(dt);
        }
Esempio n. 2
0
        internal void Create(ADO Ado, Subject_DTO subjectDto, int subjectID)
        {
            //There is no direct means of finding out which langauge the product name uses,
            // so we take a default language from the settings
            string languageCode = Configuration_BSO.GetCustomConfig(ConfigType.global, "language.iso.code");

            //Create the table that will be bulk inserted
            DataTable dt = new DataTable();

            dt.Columns.Add("KSB_VALUE", typeof(string));
            dt.Columns.Add("KSB_SBJ_ID", typeof(int));
            dt.Columns.Add("KSB_MANDATORY_FLAG", typeof(bool));

            Keyword_Subject_ADO keywordSubjectAdo = new Keyword_Subject_ADO(Ado);


            //Get a Keyword Extractor - the particular version returned will depend on the language
            Keyword_BSO_Extract kbe = new Navigation.Keyword_BSO_Extract(languageCode);

            //IKeywordExtractor ext = kbe.GetExtractor();
            AddToTable(ref dt, kbe.ExtractSplitSingular(subjectDto.SbjValue), subjectID);

            keywordSubjectAdo.Create(dt);
        }