예제 #1
0
 public object Get(NewCourse request)
 {
     return new ServiceResult<Course>
     {
         Success = true,
         Result = _courseManager.New(),
         Errors = new string[] { }
     };
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        /// <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());
        }
예제 #4
0
 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;
         }
     }
 }
예제 #5
0
 private void CancelCourseProc()
 {
     NewCourse?.Dispose();
     _addCourseWindow.Close();
 }
예제 #6
0
        private void Btn_createCourse_Click(object sender, EventArgs e)
        {
            var course = new NewCourse();

            course.ShowDialog();
        }