예제 #1
0
        public ActionResult Edit(string key)
        {
            ViewData["id"] = key;
            var m   = _lessonSv.GetLesson(key);
            var mdl = new TrainLessonViewModel()
            {
                LessonInfo      = "",
                IsEdit          = true,
                TrainBaseLesson = m
            };

            return(PartialView(mdl));
        }
예제 #2
0
        public ActionResult AddStart(Base_DataBind model, string info)
        {
            string whr = DataBindToWhere(model);
            int    i   = _lessonSv.GetBindId(whr);

            if (i == -1)
            {
                throw new Exception("Bind id not found");
            }


            var mdl = new TrainLessonViewModel
            {
                IsEdit          = false,
                TrainBaseLesson = new TrainBaseLesson()
                {
                    Id = Guid.NewGuid().ToString("n"),
                    Base_DataBindId = i
                },
                LessonInfo = info
            };

            return(PartialView("edit", mdl));
        }