From 2ea047bd801dd9c0f5ed693be452ee67aa8b5ff3 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期一, 11 十一月 2024 19:35:17 +0800 Subject: [PATCH] 质量审核上的五个按钮 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 51 insertions(+), 3 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs index 3d7cfae..bc7044e 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs @@ -6,8 +6,10 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; using System.Drawing; +using System.Net; using System.Windows.Forms; namespace Gs.DevApp.DevFrm @@ -393,8 +395,8 @@ var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - fngDesc=txt_fngDesc.Text.Trim(), - lotNo1=txt_lotNo1.Text.Trim(), + fngDesc = txt_fngDesc.Text.Trim(), + lotNo1 = txt_lotNo1.Text.Trim(), }; try { @@ -625,7 +627,53 @@ return; if (e.Button.Index == 0) { - MsgHelper.Warning("鎻愮ず锛�" + "寮�鍙戜腑"); + try + { + var dr = gvMx3.GetDataRow(rowhandle); + var urlPath = dr["urlPath"].ToString(); + Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath); + frm.ShowDialog(); + } + catch (Exception ex) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + } + + } + } + + private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx3.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + try + { + var dr = gvMx3.GetDataRow(rowhandle); + var urlPath = dr["urlPath"].ToString(); + using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) + { + folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�"; + DialogResult dialogResult = folderBrowserDialog.ShowDialog(); + if (dialogResult == DialogResult.OK) + { + string _folder = folderBrowserDialog.SelectedPath; + string _folderName = _folder + "\\" + urlPath; + string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath; + using (WebClient client = new WebClient()) + { + client.DownloadFile(_url, _folderName); + } + ToolBox.MsgHelper.ShowInformation("涓嬭浇鎴愬姛锛�"); + } + } + } + catch (Exception ex) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); + } } } } -- Gitblit v1.9.3