public void DispatchLoadedEvent(object sender, DispatchCourseEventArgs e) { if (e.IsSuccess) { switch (e.RequestCode) { case DispatchCourseProvider.RC_GET_USER_COUSR: if (e.DispatchCourseList != null) { DispatchCourseList = new ObservableCollection<DispatchCourse>(e.DispatchCourseList); } break; default: break; } return; } }
public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e) { base.ProviderLoaded(sender, e); List<DispatchCourse> dispatchList = null; Dictionary<string, List<DispatchCourse>> availableCourseList = null; if (e.IsSuccess) { switch (e.RequestCode) { case RC_GET_USER_COUSR: dispatchList = Parser.SerializeList<DispatchCourse>(); break; case RC_GET_AVAILABLE_COURSE: availableCourseList = Parser.SerializeDict<string, List<DispatchCourse>>(); break; default: break; } } if (DispatchCouseEvent != null) { DispatchCourseEventArgs eventArgs = new DispatchCourseEventArgs(dispatchList); eventArgs.LoadEventArgs(e); DispatchCouseEvent(this, eventArgs); } if (AvailableCourseEvent != null) { AvailableCourseEventArgs eventArgs = new AvailableCourseEventArgs(availableCourseList); eventArgs.LoadEventArgs(e); AvailableCourseEvent(this, eventArgs); } }
public void DispatchLoadedEvent(object sender, DispatchCourseEventArgs e) { if (e.IsSuccess) { switch (e.RequestCode) { case DispatchCourseProvider.RC_GET_USER_COUSR: if (e.DispatchCourseList != null) { DispatchCourseList = new ObservableCollection<DispatchCourse>(e.DispatchCourseList); } break; case DispatchCourseProvider.RC_QUIT_COURSE: CleanRemovedCourse(); // Update to the child view UpdateChildViewModel(); // Update from remote server GetUserCourse(); DialogHelper.Show("更改已提交"); break; default: break; } return; } DialogHelper.ShowError("操作失败", e.ErrorMessage == null ? null : e.ErrorMessage.ToArray()); }