public void UpdateProduct(CourseDetailModel obj) { var index = CourseDetailModels1.IndexOf(obj); CourseDetailModels1.Remove(obj); CourseDetailModels1.Insert(index, obj); }
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; }
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())); }
public async void OnTapCommand(CourseDetailModel obj) { Hideorshowbutton(obj); }
public async void OnDeleteCommand(CourseDetailModel obj) { StudentService.DeleteCourse(obj.courseId); }
public async void OnEditCommand(CourseDetailModel obj) { await App.Current.MainPage.Navigation.PushModalAsync(new EditCourse(obj.userId, obj.courseId, obj.courseName, obj.code)); }