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