コード例 #1
0
        public void UpdateProduct(CourseDetailModel obj)
        {
            var index = CourseDetailModels1.IndexOf(obj);

            CourseDetailModels1.Remove(obj);
            CourseDetailModels1.Insert(index, obj);
        }
コード例 #2
0
 public void Hideorshowbutton(CourseDetailModel obj)
 {
     if (_OldDisciplinaryData == obj)
     {
         obj.Isbuttonvisible = !obj.Isbuttonvisible;
         UpdateProduct(obj);
     }
     else
     {
         if (_OldDisciplinaryData != null)
         {
             foreach (var items in CourseDetailModels1)
             {
                 if (_OldDisciplinaryData.courseName == items.courseName)
                 {
                     _OldDisciplinaryData.Isbuttonvisible = false;
                     UpdateProduct(_OldDisciplinaryData);
                     break;
                 }
             }
         }
         obj.Isbuttonvisible = true;
         UpdateProduct(obj);
     }
     _OldDisciplinaryData = obj;
 }
コード例 #3
0
        public ActionResult GetCourseDetailModel(string courseID)
        {
            var courseDetail        = courseApp.GetCourseDetail(courseID);
            var courseChapterList   = courseApp.GetCourseChapterList(courseID);
            var courseTeacherList   = courseApp.GetTeacherList(courseChapterList.Select(x => x.UserID).Distinct().ToArray());
            CourseDetailModel model = new CourseDetailModel();

            model.coursemodel = courseDetail;
            model.chapter     = courseChapterList;
            model.teachers    = courseTeacherList;
            return(Json(model.ToJson()));
        }
コード例 #4
0
 public async void OnTapCommand(CourseDetailModel obj)
 {
     Hideorshowbutton(obj);
 }
コード例 #5
0
 public async void OnDeleteCommand(CourseDetailModel obj)
 {
     StudentService.DeleteCourse(obj.courseId);
 }
コード例 #6
0
 public async void OnEditCommand(CourseDetailModel obj)
 {
     await App.Current.MainPage.Navigation.PushModalAsync(new EditCourse(obj.userId, obj.courseId, obj.courseName, obj.code));
 }