public ActionResult AddLessonLevel() { var model = new Models.LessonLevelsModel() { }; return(View(model)); }
public ActionResult AddLessonLevel(Models.LessonLevelsModel model) { if (!ModelState.IsValid) { return(Json(new { error = true, errorMsg = "Введите корректное значение" })); } try { var res = BLL.Data.AdditionalData.CreateUpdateLessonLevel(new BLL.DTO.LessonLevelsDTO { name = model.name }); ViewBag.Message = res; } catch (Exception ex) { return(Json(new { error = true, errorMsg = "Произошла ошибка" })); } return(Json(new { success = true, llName = model.name })); }