public ActionResult GetTextMistakesTableInline(int pk, string value, string name) { var txt = new TextMistakesManager(); txt.EditItemField(pk, name, value); return(Json(new { result = true })); }
public ActionResult GetTextMistakesTable_remove(int id) { var res = false; var txt = new TextMistakesManager(); var item = txt.GetItem(id); var msg = ""; if (item != null) { txt.DeleteItem(id); msg = "Запись успешно удалена!"; res = true; } return(Json(new { result = res, msg = msg })); }
public ActionResult TextMistakesSave() { var res = false; var mesage = ""; try { var parameters = AjaxModel.GetAjaxParameters(HttpContext); var comment = parameters["comment"].ToString(); var selectText = parameters["selectText"].ToString(); var url = parameters["url"].ToString(); if (selectText != null && url != null) { var txt = new TextMistakesManager(); var user = HttpContext.User.Identity.IsAuthenticated ? Membership.GetUser(HttpContext.User.Identity.Name) : null; var item = new as_textMistakes { id = 0, userID = user != null ? (Nullable <Guid>)user.ProviderUserKey : null, url = url, selectText = selectText, comment = comment, correct = false }; txt.SaveItem(item); res = true; } } catch (Exception ex) { res = false; } return(Json(new { result = res, msg = mesage }, JsonRequestBehavior.AllowGet)); }
public LulchenkoTextMistakesController() { mistakesManager = new TextMistakesManager(); }