/// <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); }
/// <summary> /// Create or update a product language /// </summary> /// <param name="dto"></param> /// <param name="Ado"></param> /// <returns></returns> internal int CreateOrUpdate(Product_DTO dto, ADO Ado) { ProductLanguage_ADO adoProductLanguage = new ProductLanguage_ADO(Ado); ProductLanguage_DTO dtoProductLanguage = new ProductLanguage_DTO(); dtoProductLanguage.PrcCode = dto.PrcCode; dtoProductLanguage.LngIsoCode = dto.LngIsoCode; dtoProductLanguage.PlgValue = dto.PrcValue; //If the productID is already represented in this language then an update is performed //Otherwise do an insert return(adoProductLanguage.CreateOrUpdate(dtoProductLanguage)); }