public object Get(NewCourse request) { return new ServiceResult<Course> { Success = true, Result = _courseManager.New(), Errors = new string[] { } }; }
private void Add() { var context = new CourseVM(teachers.ToArray(), groups.ToArray(), subjects.ToArray()); var winc = new NewCourse() { DataContext = context }; winc.ShowDialog(); System.Console.WriteLine(context.Course != null); if (context.Course != null) { ClassCourse.Add(context.Course); } }
/// <summary> /// 添加新课程 /// </summary> /// <param name="newCourse">新课程信息</param> /// <returns></returns> public bool Add(long userId, long subjectId, string title, string image, string content, string remarks, string objective) { NewCourse course = new NewCourse { UserId = userId, SubjectId = subjectId, Content = content, Image = image, Objective = objective, Remarks = remarks, Title = title }; return(course.Save()); }
private void Edit() { if (Index >= 0) { var course = ClassCourse[Index]; var context = new CourseVM(course, teachers.ToArray(), groups.ToArray(), subjects.ToArray()); var wint = new NewCourse() { DataContext = context }; wint.ShowDialog(); if (context.Teacher != null) { ClassCourse[Index] = context.Course; } } }
private void CancelCourseProc() { NewCourse?.Dispose(); _addCourseWindow.Close(); }
private void Btn_createCourse_Click(object sender, EventArgs e) { var course = new NewCourse(); course.ShowDialog(); }