From b83d3b9f4ea67b2982117753ebdd4861922bb07b Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 24 十月 2024 19:08:04 +0800 Subject: [PATCH] 检验 --- DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs | 218 ++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 161 insertions(+), 57 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs index d8bdca8..f466def 100644 --- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs +++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs @@ -78,6 +78,16 @@ /// </summary> public event EventHandler btnFChkClick; + + /// <summary> + /// 妫�楠� + /// </summary> + public event EventHandler btnJianYanClick; + /// <summary> + /// 鍙嶆楠� + /// </summary> + public event EventHandler btnFjianYanClick; + #endregion #region 鍏叡灞炴�� @@ -96,22 +106,22 @@ public List<string> actions { get; } /// <summary> - /// 鎶ヨ〃绫诲瀷锛屽湪鏁版嵁搴撲腑瑕佸敮涓�锛屽惁鍒欎細淇濆瓨涓嶄簡鎶ヨ〃璁捐 + /// 鎶ヨ〃锛屽湪鏁版嵁搴撲腑瑕佸敮涓�,濡傦細瀛樺偍杩囩▼鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏 /// </summary> - public string rptService { get; set; } + public string rptParameter { get; set; } /// <summary> - /// 瀵煎嚭鏈嶅姟鍚� + /// 瀵煎嚭锛岃鍥惧悕,濡傦細瑙嗗浘鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏 /// </summary> - public string xlsOutView { get; set; } + public string xlsOutParameter { get; set; } /// <summary> - /// 瀵煎叆鏈嶅姟鍚� + /// 瀵煎叆 /// </summary> public string xlsInService { get; set; } /// <summary> - /// 瀹℃牳鍙傛暟,褰㈠锛歁ES_HOLIDAY,check_date,check_status,check_by + /// 瀹℃牳鍙傛暟,琛ㄥ悕,瀛楁鍚嶏紝濡傦細MES_HOLIDAY,check_date,check_status,check_by /// </summary> public string chkParameter { get; set; } #endregion @@ -135,6 +145,8 @@ this.btnIn.ItemClick += BtnIn_ItemClick; this.btnChk.ItemClick += BtnChk_ItemClick; this.btnFchk.ItemClick += BtnFchk_ItemClick; + this.btnJianYan.ItemClick += BtnJianYan_ItemClick; + this.btnFjianYan.ItemClick += BtnFjianYan_ItemClick; List<string> lst = new List<string>(); foreach (BarItem item in barManager1.Items) { @@ -146,6 +158,7 @@ } this.actions = lst; } + /// <summary> /// 鍒濆鍖栨寜閽姸鎬� @@ -195,8 +208,6 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } } - - private void BtnChk_ItemClick(object sender, ItemClickEventArgs e) { if (btnChkClick != null) @@ -234,6 +245,83 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } } + + private void BtnFjianYan_ItemClick(object sender, ItemClickEventArgs e) + { + if (btnFjianYanClick != null) + { + btnFjianYanClick(this, e); + } + else + return; + + if (string.IsNullOrEmpty(this.guidKey)) + { + ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (string.IsNullOrEmpty(this.chkParameter)) + { + ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾妫�楠屽弬鏁帮紝璇疯仈绯诲紑鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍙嶆楠屽悧锛�")) + return; + var _obj = new + { + guid = this.guidKey, + parameter = this.chkParameter + }; + string strJson = UtilityHelper.HttpPost("", "General/GeneralFCheck", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData["outMsg"].ToString()); + } + else + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + } + } + + private void BtnJianYan_ItemClick(object sender, ItemClickEventArgs e) + { + if (btnJianYanClick != null) + { + btnJianYanClick(this, e); + } + else + return; + + if (string.IsNullOrEmpty(this.guidKey)) + { + ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + return; + } + if (string.IsNullOrEmpty(this.chkParameter)) + { + ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾妫�楠屽弬鏁帮紝璇疯仈绯诲紑鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); + return; + } + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鎻愪氦妫�楠屽悧锛�")) + return; + var _obj = new + { + guid = this.guidKey, + parameter = this.chkParameter + }; + string strJson = UtilityHelper.HttpPost("", "General/GeneralCheck", JsonConvert.SerializeObject(_obj)); + ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData["outMsg"].ToString()); + } + else + { + ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + } + } + private async void BtnIn_ItemClick(object sender, ItemClickEventArgs e) { if (string.IsNullOrEmpty(this.xlsInService)) @@ -271,81 +359,82 @@ private void BtnOut_ItemClick(object sender, ItemClickEventArgs e) { - if (string.IsNullOrEmpty(this.xlsOutView)) - { - ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾瀵煎嚭鏈嶅姟锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); - return; - } - using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) - { - folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�"; - DialogResult dialogResult = folderBrowserDialog.ShowDialog(); - if (dialogResult == DialogResult.OK) - { - string _folder = folderBrowserDialog.SelectedPath; - var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutView); - try - { - string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj)); - ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) - { - string _file = _rtn.rtnData.fileUrl.ToString(); - string _folderName = _folder + "\\" + _file.Replace("down/", ""); - string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file; - using (WebClient client = new WebClient()) - { - client.DownloadFile(_url, _folderName); - } - ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�"); - } - else - { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); - } - } - catch (Exception ex) - { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); - } - } - } + //if (string.IsNullOrEmpty(this.xlsOutView)) + //{ + // ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾瀵煎嚭鏈嶅姟锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); + // return; + //} + //using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) + //{ + // folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�"; + // DialogResult dialogResult = folderBrowserDialog.ShowDialog(); + // if (dialogResult == DialogResult.OK) + // { + // string _folder = folderBrowserDialog.SelectedPath; + // var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutView); + // try + // { + // string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj)); + // ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); + // if (_rtn.rtnCode > 0) + // { + // string _file = _rtn.rtnData.fileUrl.ToString(); + // string _folderName = _folder + "\\" + _file.Replace("down/", ""); + // string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file; + // using (WebClient client = new WebClient()) + // { + // client.DownloadFile(_url, _folderName); + // } + // ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�"); + // } + // else + // { + // ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + // } + // } + // catch (Exception ex) + // { + // ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + // } + // } + //} } private void BtnReport_ItemClick(object sender, ItemClickEventArgs e) { - if (string.IsNullOrEmpty(this.rptService)) + if (string.IsNullOrEmpty(this.rptParameter)) { - ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃绫诲瀷锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); + ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒"); return; } bool _bl = false; _bl = _ckRptService(); if (_bl) { - Gs.DevApp.DevFrm.Rpt.RptPreview frm = new Gs.DevApp.DevFrm.Rpt.RptPreview(this.rptService); + Gs.DevApp.DevFrm.Rpt.RptPreview frm = new Gs.DevApp.DevFrm.Rpt.RptPreview(this.rptParameter); frm.Show(); return; } - ToolBox.MsgHelper.ShowError("杩樻病鏈夎璁℃ā鏉匡紝璇峰厛璁捐妯℃澘锛�"); + ToolBox.MsgHelper.ShowError("娌℃湁璁捐妯℃澘锛岃鍏堣璁℃ā鏉匡紒"); + return; } private void BtnDesign_ItemClick(object sender, ItemClickEventArgs e) { - if (string.IsNullOrEmpty(this.rptService)) + if (string.IsNullOrEmpty(this.rptParameter)) { - ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃绫诲瀷锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒"); + ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒"); return; } bool _bl = false; _bl = _ckRptService(); - //濡傛灉宸茬粡鏈夋ā鏉夸簡锛岀洿鎺ユ墦寮� + //濡傛灉宸茬粡鏈夋ā鏉夸簡锛岀洿鎺ユ墦寮�璁剧疆妯℃澘 if (_bl) { - Gs.DevApp.DevFrm.Sys.EasyRptDesign frm = new Gs.DevApp.DevFrm.Sys.EasyRptDesign(this.rptService); + Gs.DevApp.DevFrm.Sys.EasyRptDesign frm = new Gs.DevApp.DevFrm.Sys.EasyRptDesign(this.rptParameter); frm.Show(); return; } //鍚﹀垯鍚戝璁捐妯℃澘 - UserControl.ShowRptWizard rptWizard = new ShowRptWizard(this.rptService); + UserControl.ShowRptWizard rptWizard = new ShowRptWizard(this.rptParameter); rptWizard.ShowDialog(); } @@ -519,6 +608,7 @@ ); if (ld1 == true) { + btnEsc.Visibility = btnSave.Visibility = btnLoad.Visibility = BarItemVisibility.Always; btnAdd.Visibility = BarItemVisibility.Always; _enabledList.Add(item.Name); @@ -547,6 +637,19 @@ { item.Visibility = BarItemVisibility.Always; //鍑嗗鍚敤 + _enabledList.Add(item.Name); + continue; + } + } + ///鍏锋湁鑱斿姩鍏崇郴鐨勬寜閽�(鎻愪氦妫�楠�)锛� + if (item.Caption == "鎻愪氦妫�楠�") + { + bool ld1 = dt.AsEnumerable().Any(row => row.Field<string>("name") == "鎻愪氦妫�楠�" + ); + if (ld1 == true) + { + btnJianYan.Visibility = btnFjianYan.Visibility = btnLoad.Visibility = BarItemVisibility.Always; + btnJianYan.Visibility = BarItemVisibility.Always; _enabledList.Add(item.Name); continue; } @@ -596,7 +699,7 @@ { var _obj = new { - reportType = this.rptService, + rptParameter = this.rptParameter, }; string strJson = UtilityHelper.HttpPost("", "Report/GetTemplate", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); @@ -611,6 +714,7 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); return true; } + return false; } } } -- Gitblit v1.9.3