Пример #1
0
        //添加主视频
        private void addMainVideoBtn_Click(object sender, EventArgs e)
        {
            if (null == currentLessonModel)
            {
                MessageBox.Show("请先选择课程");
                return;
            }

            AddEditMainVideoForm frm = new AddEditMainVideoForm(currentLessonModel, currentMainVideoModel);

            if (frm.ShowDialog() == DialogResult.OK)//对话框返回值为ok时运行
            {
                String filePath   = currentLessonModel.videoMainJsonFilePath;
                String jsonString = JSONHandle.getJsonString(currentMainVideoModel);
                FileHandle.saveJsonFile(filePath, jsonString);

                refreshVideoDetail();
            }
        }
Пример #2
0
        //添加课程
        private void button5_Click(object sender, EventArgs e)
        {
            LessonModel lessonModel = new LessonModel(moduleModel.type, moduleModel.lessonList.Count);
            //lessonModel.type = moduleModel.type;
            // lessonModel.orderNum = moduleModel.lessonList.Count;

            LessonDetailForm frm = new LessonDetailForm(lessonModel, moduleModel, LessonDetailType.LessonDetailTypeAdd);

            if (frm.ShowDialog() == DialogResult.OK)//对话框返回值为ok时运行
            {
                moduleModel.lessonList.Add(lessonModel);
                refreshLessonListView();

                String jsonString = JSONHandle.getJsonString(moduleModel.lessonList);
                //MessageBox.Show("jsonString:" + jsonString);
                String filePath = moduleModel.jsonFileLocalPath;
                FileHandle.saveJsonFile(filePath, jsonString);
            }
        }