private void DeleteCurrentImg() { var rows = winExplorerView1.GetSelectedRows(); if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要删除的图片"); return; } var v = (DataRowView)winExplorerView1.GetRow(rows[0]); var img = currentHistory.imgInfos.FirstOrDefault(f => f.ID == Convert.ToInt32(v["Index"])); currentHistory.imgInfos.Remove(img); if (currentHistory.HistoryNo != null) { var path = Path.Combine(User.DBPath, User.CurrentPatient.FName + User.CurrentPatient.BirthDay, currentHistory.HistoryNo, img.FileName); if (File.Exists(path + ".bmp")) { File.Delete(path + ".bmp"); } if (File.Exists(path + ".ini")) { File.Delete(path + ".ini"); } User.SaveHistorys(currentHistory); } winExplorerView1.DeleteSelectedRows(); }
private void tool_TakeOut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (User.CurrentPatient == null) { CommHelp.ShowWarning("请选择需要拍摄的患者"); } else { var form = new FormPicture(); if (form.ShowDialog() == DialogResult.OK) { LoadMdiForm(this, typeof(FormPatientEdit)); if (form.imgList.Count > 0) { foreach (var f in this.MdiChildren) { if (f.GetType() == typeof(FormPatientEdit)) { ((FormPatientEdit)f).SaveImgToHistory(form.imgList); } } } } } }
private void button1_Click(object sender, EventArgs e) { AuthRequest.Password = textBox1.Text; if (!AuthRequest.IsPasswordValid) { CommHelp.ShowWarning("密码不符合要求,请重新输入!"); return; } this.DialogResult = DialogResult.OK; }
public void Print() { List <DataRowView> rows = new List <DataRowView>(); for (int i = 0; i < winExplorerView1.RowCount; i++) { var view = (DataRowView)winExplorerView1.GetRow(i); if (Convert.ToBoolean(view["IsSelect"])) { rows.Add(view); } } if (rows.Count() > 4) { CommHelp.ShowWarning("一次只能打印4张图片"); return; } if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要打印的图片"); return; } ReportSource source = new ReportSource(); source.Name = User.CurrentPatient.FName; source.Birthday = User.CurrentPatient.BirthDay; source.No = User.CurrentPatient.SECU; source.Yijian = currentHistory.Yijian; source.Img1 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[0]["Image"]); if (rows.Count() > 1) { source.Img2 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[1]["Image"]); } if (rows.Count() > 2) { source.Img3 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[2]["Image"]); } if (rows.Count() > 3) { source.Img4 = Help.Base64Util.GetBase64FromImage((Bitmap)rows[3]["Image"]); } ReportViewerDialog dlg = new ReportViewerDialog(); dlg.DataSourceDict = new List <ReportSource>() { source }; dlg.ReportFilePath = "Report/Report.rdlc"; dlg.ShowDialog(); }
private void btnImgEdit_Click(object sender, EventArgs e) { var rows = winExplorerView1.GetSelectedRows(); if (rows.Count() == 0) { CommHelp.ShowWarning("请选择要编辑的图片"); return; } var v = (DataRowView)winExplorerView1.GetRow(rows[0]); var img = currentHistory.imgInfos.FirstOrDefault(f => f.ID == Convert.ToInt32(v["Index"])); FormImageEdit form = new FormImageEdit(img, currentHistory); form.ShowDialog(); User.ReadCurrentPatientHistorys(); BindImg(); }