From a985c4d4b80fbf3eb4abbe385adcd0536fd29eda Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期五, 22 十一月 2024 15:04:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 5b0c13b..da48bf5 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -5,6 +5,7 @@ using System.Drawing; using System.IO; using System.Net; +using System.Net.Cache; using System.Net.Http; using System.Reflection; using System.Resources; @@ -75,6 +76,9 @@ request.Accept = "*/*"; request.Timeout = 15000; request.AllowAutoRedirect = false; + request.ServicePoint.Expect100Continue = false; + HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); + request.CachePolicy = noCachePolicy; using (Stream requestStream = await request.GetRequestStreamAsync()) { byte[] dataBytes = Encoding.UTF8.GetBytes(param); @@ -109,6 +113,9 @@ request.Accept = "*/*"; request.Timeout = 15000; request.AllowAutoRedirect = false; + request.ServicePoint.Expect100Continue = false; + HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); + request.CachePolicy = noCachePolicy; StreamWriter requestStream = null; WebResponse response = null; string responseStr = null; @@ -858,6 +865,7 @@ , Label lbGuid , TextEdit txtName , GridView gridView1 + , string fileName = "" , int SelectedTabPageIndex = 1) { var _strGuid = ""; @@ -877,7 +885,10 @@ else { _strGuid = dr["guid"].ToString(); - _strName = dr[1].ToString(); + if (string.IsNullOrEmpty(fileName)) + _strName = dr[1].ToString(); + else + _strName = dr[fileName].ToString(); } } @@ -1008,6 +1019,39 @@ return ""; } + + + /// <summary> + /// + /// </summary> + /// <param name="s"></param> + /// <param name="btnChkIco"></param> + /// <param name="fm"></param> + /// <param name="fileName">瀵瑰簲鐨勫鏍稿瓧娈靛悕绉�</param> + /// <param name="icoName"></param> + public static void SetCheckIco(object s, PictureBox btnChkIco, Form fm, string fileName = "checkStatus", string icoName = "") + { + GridView dgv = s as GridView; + if (dgv != null) + { + if (dgv.GetSelectedRows() != null) + { + var selectedRow = dgv.GetSelectedRows()[0]; // 鑾峰彇绗竴涓�変腑琛岀殑绱㈠紩 + if (selectedRow >= 0) + { + var checkStatus = dgv.GetRowCellValue(selectedRow, fileName).ToString(); // 鑾峰彇鎸囧畾鍒楃殑鍊� + btnChkIco.Text = checkStatus; + btnChkIco.Visible = true; + if (checkStatus == "1" || checkStatus.ToUpper() == true.ToString().ToUpper()) + btnChkIco.Image = global::Gs.DevApp.Properties.Resources.ico_check; + else + btnChkIco.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck; + btnChkIco.Anchor = AnchorStyles.Top | AnchorStyles.Right; // 闈犲彸 + btnChkIco.Location = new Point(fm.ClientSize.Width - btnChkIco.Width - 20, 80); // 璺濈椤堕儴10鍍忕礌 + } + } + } + } } /// <summary> -- Gitblit v1.9.3