private async void btu_OneKeySelectAllCourseByHand_Click(object sender, RoutedEventArgs e) { var list = selectClassCarVM.ToList(); for (int i = 0; i < list.Count; i++) { var cla = list[i]; if (cla.SelectStatus != "已成功") { cla.SelectStatus = "正在输入验证码"; selectClassCarVM_Update(cla); await RrefreshSelectCar(); ValicodeWindow valicodeWindow = new ValicodeWindow(loginData.access_token, "验证码-" + cla.CourseName); valicodeWindow.ShowDialog(); if (ValicodeWindow.Valicode != null) { var valicode = ValicodeWindow.Valicode as string; ValicodeWindow.Valicode = null; var result = await AddCourse(cla.TeachClassId, valicode); Debug.WriteLine(result); cla.SelectStatus = result; selectClassCarVM_Update(cla); await RrefreshSelectCar(); } } RefreshSelectCarStatus(cla); } }
private void btu_selectClass_Click(object sender, RoutedEventArgs e) { var btu = sender as Button; var TeachClassId = btu.CommandParameter.ToString(); if (TeachClassId != null) { Debug.WriteLine(TeachClassId); ValicodeWindow valicodeWindow = new ValicodeWindow(loginData.access_token); valicodeWindow.ShowDialog(); if (ValicodeWindow.Valicode != null) { var valicode = ValicodeWindow.Valicode as string; ValicodeWindow.Valicode = null; AddCourse(TeachClassId, valicode); } } }