From 3ff3c816c74c077a320c4a9cb3094fb0b9fcc2c5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 16 十一月 2024 15:06:23 +0800
Subject: [PATCH] 1

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs |  234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 233 insertions(+), 1 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
index 1dc64ea..1d8f5aa 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -5,8 +5,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.QC
@@ -18,6 +20,9 @@
         public Frm_MesQaItemsDetect01Check()
         {
             InitializeComponent();
+            this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
+            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
+            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             this.toolBarMenu1.btnZhiLiangChkClick += ToolBarMenu1_btnZhiLiangChkClick;
@@ -115,6 +120,75 @@
             toolBarMenu1.guidKey = rowGuid;
         }
         /// <summary>
+        /// 鍙栨秷浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
+        {
+            UtilityHelper.JumpToTab(xtraTabControl1, 0);
+        }
+        /// <summary>
+        /// 淇濆瓨浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.isSetBtn = false;
+            if (string.IsNullOrEmpty(txt_fngHandle.Text.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭悊鏂瑰紡锛�");
+                txt_fngDesc.Focus();
+                return;
+            }
+            if (string.IsNullOrEmpty(txt_fmrmode.Text.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨閫�鏂欐柟寮忥紒");
+                txt_fmrmode.Focus();
+                return;
+            }
+            var _obj = new
+            {
+                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+                fngHandle = txt_fngHandle.Text.Trim(),
+                fmrmode = txt_fmrmode.Text.Trim(),
+            };
+            try
+            {
+                string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
+                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                if (_rtn.rtnCode > 0)
+                {
+                    lbGuid.Text = _rtn.rtnData;
+                    toolBarMenu1.isSetBtn = true;
+                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+                }
+            }
+            catch (Exception ex)
+            {
+                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
+        /// <summary>
+        /// 淇敼浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
+        {
+            string rowGuid = "", rowName = "";
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            getModel(rowGuid, true, 1);
+        }
+        /// <summary>
         /// 椹冲洖
         /// </summary>
         /// <param name="sender"></param>
@@ -126,6 +200,28 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
+
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀┏鍥炲悧锛�"))
+                return;
+
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit13",
+                    JsonConvert.SerializeObject(rowGuid));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
         /// <summary>
         /// 閲囪喘鍙嶅鏍�
@@ -139,6 +235,28 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
+
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐弽瀹℃牳鍚楋紵"))
+                return;
+
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit12",
+                    JsonConvert.SerializeObject(rowGuid));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
         /// <summary>
         /// 閲囪喘瀹℃牳
@@ -152,6 +270,28 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
+
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐鏍稿悧锛�"))
+                return;
+
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcCGAudit",
+                    JsonConvert.SerializeObject(rowGuid));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
         /// <summary>
         /// 璐ㄩ噺鍙嶅鏍�
@@ -165,6 +305,28 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
+
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
+                return;
+
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit11",
+                    JsonConvert.SerializeObject(rowGuid));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
         /// <summary>
         /// 璐ㄩ噺瀹℃牳
@@ -178,6 +340,28 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
+
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
+                return;
+
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit",
+                    JsonConvert.SerializeObject(rowGuid));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
 
         /// <summary>
@@ -399,8 +583,56 @@
                 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);
+                }
+
+            }
+
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3