예제 #1
0
        public void TestMethod_Insert()
        {
            LessonUnitBll bll = new LessonUnitBll();

            for (int i = 0; i < 10; i++)
            {
                DtoLessonUnit unit = new DtoLessonUnit();
                unit.CourseId   = 9999;
                unit.LessonId   = 9999;
                unit.Index      = i;
                unit.Name       = $"第{i + 1}页";
                unit.Screenshot = "";
                unit.Status     = 0;
                unit.Steps      = new List <Step>();
                unit.Steps.Add(new Step
                {
                    id      = 0,
                    StepNum = 0,
                    Actions = new List <StepAction>()
                    {
                        new SetTitle()
                        {
                            Actionid = "asdfgh", Text = "test", Align = "left", Color = "#000000", ActionNum = 0, InType = "none", Size = "big", X = 102.3435, Y = 123.2342
                        }
                    }
                });
                bll.Add(unit);
            }
        }
예제 #2
0
        public JsonResult AddPage(Page page)
        {
            LessonUnitBll bll = new LessonUnitBll();
            //修改数据
            int id = bll.Add(new DtoLessonUnit
            {
                CourseId   = page.courseId,
                LessonId   = page.lessonId,
                Name       = "",
                Screenshot = "",
                Steps      = null,
                Index      = page.pageNum,
            });

            return(Json(new JsonResponse <int> {
                State = true, ErrorCode = 0, ErrorMsg = "", Data = id
            }));
        }