public ActionResult SearchAdminSynonymEdit(vmAdminSearch model) { int UserIDX = db_Accounts.GetUserIDX(); int SuccID = 0; if (model.edit_synonym_text != null) { SuccID = db_Ref.InsertUpdatetT_OE_REF_SYNONYMS(model.edit_synonym_idx, model.edit_synonym_text, UserIDX); } else if (model.edit_synonym_bulk != null) { foreach (string row in model.edit_synonym_bulk.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)) { SuccID = db_Ref.InsertUpdatetT_OE_REF_SYNONYMS(null, row, UserIDX); } } if (SuccID > 0) { AzureSearch.UploadSynonyms(); AzureSearch.EnableSynonyms(); TempData["Success"] = "Update successful."; } else { TempData["Error"] = "Error updating data."; } //return View(model); return(RedirectToAction("SearchAdmin")); }
public JsonResult SearchAdminSynonymDelete(int id) { int SuccID = db_Ref.DeleteT_OE_REF_SYNONYMS(id); if (SuccID == 0) { return(Json("Unable to delete record.")); } else { AzureSearch.UploadSynonyms(); AzureSearch.EnableSynonyms(); return(Json("Success")); } }
public ActionResult SearchAdminUploadSynonyms() { try { AzureSearch.UploadSynonyms(); AzureSearch.EnableSynonyms(); TempData["Success"] = "Synonyms uploaded and enabled."; } catch (Exception ex) { TempData["Error"] = ex.ToString().SubStringPlus(0, 100); } return(RedirectToAction("SearchAdmin", "Admin")); }