private void OnImageUpload(object obj) { if (ImageList==null || ImageList.Count == 0) { ModernDialog.ShowMessage("没有要上传的照片", "消息", System.Windows.MessageBoxButton.OK,null); return; } Services.NewStudentIdServicesClient service = new NewStudentIdServicesClient(); foreach (Image img in ImageList) { BitmapImage bitImage = img.Source as BitmapImage; if (bitImage != null) { string file = bitImage.UriSource.LocalPath; FileInfo fileInfo = new FileInfo(file); if (fileInfo.Exists) { FileStream fs = new FileStream(file, FileMode.Open); byte[] byteData = new byte[fs.Length]; fs.Read(byteData, 0, byteData.Length); fs.Close(); service.UpLoadStudentImage(byteData, fileInfo.Name); } } } }
public void OnSetStudentEms(object obj) { if (string.IsNullOrEmpty(StudentKsh)) { ModernDialog.ShowMessage("考生号为空,请先输入考生号", "消息", System.Windows.MessageBoxButton.OK); return; } if (string.IsNullOrEmpty(StudentEms)) { ModernDialog.ShowMessage("Ems为空,请先输入Ems号", "消息", System.Windows.MessageBoxButton.OK); return; } NewStudentIdServicesClient service = new NewStudentIdServicesClient(); string result = service.SetStudentEms(StudentKsh,StudentEms); ResultEx re = JsonConvert.DeserializeObject<ResultEx>(result); if (re.Result == false) { ModernDialog.ShowMessage(re.Message, "消息", System.Windows.MessageBoxButton.OK); } else { DataRow[] drs= StudentDataTable.Select(string.Format("考生号={0}", StudentKsh)); drs[0]["EMS号码"] = StudentEms; } }
private DataTable StudentList() { NewStudentIdServicesClient service = new NewStudentIdServicesClient(); string result = service.GetNewStudents(""); return JsonConvert.DeserializeObject<DataTable>(result); }
private void OnSave(object obj) { NewStudentIdServicesClient service = new NewStudentIdServicesClient(); if (ModernDialog.ShowMessage(" 确定要改该生信息吗? ", "消息", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes) { service.NewStudentIdUpdate(Student); ModernDialog.ShowMessage(" 修改完成 ", "消息", System.Windows.MessageBoxButton.OK); ModernWindow window = obj as ModernWindow; window.Close(); } }