private void virtualTree1_NodeMouseClick(object sender, VirtualTreeEventArgs e) { if (e.SubItem == null) { VirtualNode[] selectNodes = this.virtualTree1.GetCheckedNodes(null); this.lbl_PatientCount.Text = selectNodes.Count().ToString(); return; } if (e.SubItem.Index == 1 || e.SubItem.Index == 2) { string szImageName = e.SubItem.Tag as string; RecPaper recPaper = e.Node.Tag as RecPaper; if (string.IsNullOrEmpty(szImageName)) { return; } string szPath = szImageName; GlobalMethods.UI.SetCursor(this.virtualTree1, Cursors.WaitCursor); szPath = RecPaperAccess.Instance.GetImageLocalFile(szImageName); if (!File.Exists(szPath)) { short shRet = RecPaperAccess.Instance.GetImageFromFtp(recPaper, szImageName, ref szPath); if (shRet != SystemData.ReturnValue.OK) { MessageBoxEx.Show("预览图片失败"); return; } } GlobalMethods.UI.SetCursor(this.virtualTree1, Cursors.Default); Heren.MedQC.Utilities.Dialogs.ImageViewerDialog diglog = new Utilities.Dialogs.ImageViewerDialog(); diglog.ImagePath = szPath; diglog.ShowDialog(); } }
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) { return; } DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex]; if (e.ColumnIndex == this.colCheckBox.Index) { if (row.Cells[this.colCheckBox.Index].Value == null || row.Cells[this.colCheckBox.Index].Value.ToString().ToLower() == "false") { row.Cells[this.colCheckBox.Index].Value = true; } else { row.Cells[this.colCheckBox.Index].Value = false; } } if (e.ColumnIndex == this.col_IMAGE_FRONTAGE.Index || e.ColumnIndex == this.col_IMAGE_OPPOSITE.Index) { string szImageName = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag as string; RecPaper recPaper = row.Cells[this.colCheckBox.Index].Tag as RecPaper; if (string.IsNullOrEmpty(szImageName)) { return; } string szPath = szImageName; GlobalMethods.UI.SetCursor(this.dataGridView1, Cursors.WaitCursor); szPath = RecPaperAccess.Instance.GetImageLocalFile(szImageName); if (!File.Exists(szPath)) { short shRet = RecPaperAccess.Instance.GetImageFromFtp(recPaper, szImageName, ref szPath); if (shRet != SystemData.ReturnValue.OK) { MessageBoxEx.Show("预览图片失败"); return; } } GlobalMethods.UI.SetCursor(this.dataGridView1, Cursors.Default); Heren.MedQC.Utilities.Dialogs.ImageViewerDialog diglog = new Utilities.Dialogs.ImageViewerDialog(); diglog.ImagePath = szPath; diglog.ShowDialog(); } }