/// <summary> /// Execute /// </summary> /// <returns></returns> protected override bool Execute() { //Validation of parameters and user have been successful. We may now proceed to read from the database var adoKeyword_Subject = new Keyword_Subject_ADO(Ado); //Create the Keyword_Subject - and retrieve the newly created Id int newId = adoKeyword_Subject.Create(DTO); if (newId == 0) { Response.error = Label.Get("error.create"); return(false); } else if (newId < 0) { Response.error = Label.Get("error.duplicate"); } Response.data = JSONRPC.success; return(true); }
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 = Utility.GetCustomConfig("APP_KEYWORD_DEFAULT_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 IKeywordExtractor ext = Keyword_BSO_Extract.GetExtractor(languageCode); AddToTable(ref dt, ext.ExtractSplitSingular(subjectDto.SbjValue), subjectID); keywordSubjectAdo.Create(dt); }
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); }