public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e) { base.ProviderLoaded(sender, e); List<Profile> profileList = null; string randomPwd = null; switch (e.RequestCode) { case RC_GET_ALL: if (e.IsSuccess) { profileList = Parser.Serialize<List<Profile>>(); } break; case RC_RESET_PASSWORD: if (e.IsSuccess) { randomPwd = Parser.Serialize<string>(); } break; default: break; } if (ProfileEvent != null) { UserManageEventArgs userManageEventArgs = new UserManageEventArgs(profileList); userManageEventArgs.RandomPassword = randomPwd; userManageEventArgs.LoadEventArgs(e); ProfileEvent(this, userManageEventArgs); } }
private void ProfileELoadedEvent(object sender, UserManageEventArgs e) { if (DispatchManageProvider.RC_GET_ALL == e.RequestCode && e.IsSuccess) { TeacherList = new ObservableCollection<Profile>(e.UserProfileList); } }
private void ProfileLoadedEvent(object sender, UserManageEventArgs e) { if (CourseProvider.Providers.Advance.CourseProvider.RC_CREATE == e.RequestCode && e.IsSuccess) { DialogHelper.Close(); DialogHelper.Show("成功添加"); DialogHelper.Dispatcher.Invoke(delegate { BackToPreviousCommand.Execute(null); }); return; } DialogHelper.Show("添加失败,请重试"); }
public void ProfileLoadedEvent(object sender, UserManageEventArgs e) { if (e.IsSuccess) { switch (e.RequestCode) { case UserManageProvider.RC_GET_ALL: ProfileList = e.UserProfileList != null ? new ObservableCollection<Profile>(e.UserProfileList) : null; break; case UserManageProvider.RC_CREATE: DialogHelper.Dispatcher.Invoke(delegate { GetAll(0); }); break; case UserManageProvider.RC_RESET_PASSWORD: DialogHelper.Close(); DialogHelper.Show("重置成功,密码为:" + e.RandomPassword, "请及时修改!"); break; default: break; } } }