From c441404eed5793bea46e8be5d45774bd171c0559 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 28 十一月 2024 18:05:49 +0800
Subject: [PATCH] 图标
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs | 252 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 245 insertions(+), 7 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
index 697842b..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>
@@ -187,8 +371,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
}
/// <summary>
@@ -234,7 +420,7 @@
}
_loading.Stop();
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private async void getModel(string strGuid, bool isEdit, int tabIdx)
{
if (string.IsNullOrEmpty(strGuid))
{
@@ -242,13 +428,14 @@
return;
}
UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+ UcLoading _loading = new UcLoading();
var _obj = new
{
guid = strGuid,//涓诲缓
};
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
+ string strJson = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
@@ -284,6 +471,7 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ _loading.Stop();
}
/// <summary>
/// 閫夐」鍗″垏鎹�
@@ -337,8 +525,9 @@
/// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋�
/// </summary>
/// <param name="guid5"></param>
- private void getList12(string guid5)
+ private async void getList12(string guid5)
{
+ UcLoading _loading = new UcLoading();
var _obj = new
{
parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
@@ -346,7 +535,7 @@
};
try
{
- var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
+ var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
var dd = UtilityHelper.ReturnToList(strReturn);
var dt = dd.rtnData;
gcMx2.BindingContext = new BindingContext();
@@ -357,6 +546,7 @@
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ _loading.Stop();
}
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
@@ -393,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