示例#1
0
        public ActionResult AddLessonLevel()
        {
            var model = new Models.LessonLevelsModel()
            {
            };

            return(View(model));
        }
示例#2
0
        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 }));
        }