From fd94e95ef93cc6608e9c6ecfe8552d3f8dd9b880 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期日, 17 八月 2025 22:53:49 +0800 Subject: [PATCH] bug --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 127 +++++++++++++++++++++++++++++++++--------- 1 files changed, 99 insertions(+), 28 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 0bac2a1..9302d84 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -55,20 +55,24 @@ /// <summary> /// http璇锋眰 /// </summary> - /// <param name="url"></param> - /// <param name="meth"></param> - /// <param name="param"></param> - /// <param name="isLoading"></param> + /// <param name="url">api鏍瑰湴鍧�</param> + /// <param name="meth">鏂规硶鍚嶇О</param> + /// <param name="param">json鍙傛暟</param> + /// <param name="isLoading">鏄惁loading</param> /// <returns></returns> public static string HttpPost(string url, string meth, string param, bool isLoading = true) { - Size _size; string _caption; Color _color; Padding _pad; - (_size, _caption, _color, _pad) = getLoading(); - DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm("鍔犺浇杩涘害:" + meth, _caption, _size); - wdf.BackColor = _color; - wdf.Padding = _pad; - wdf.SetCaption("鍔犺浇杩涘害:" + meth); - wdf.Visible = isLoading; + DevExpress.Utils.WaitDialogForm wdf = null; + if (isLoading == true) + { + Size _size; string _caption; Color _color; Padding _pad; + (_size, _caption, _color, _pad) = getLoading(); + wdf = new DevExpress.Utils.WaitDialogForm("鍔犺浇杩涘害:" + meth, _caption, _size); + wdf.BackColor = _color; + wdf.Padding = _pad; + wdf.SetCaption("鍔犺浇杩涘害:" + meth); + wdf.Visible = isLoading; + } HttpWebRequest request = null; StreamWriter requestStream = null; WebResponse response = null; @@ -103,7 +107,8 @@ } catch (Exception ex) { - wdf.Close(); + if (wdf != null) + wdf.Close(); LogHelper.Debug(url, param + ":" + ex.Message); throw ex; } @@ -113,7 +118,8 @@ requestStream = null; response = null; } - wdf.Close(); + if (wdf != null) + wdf.Close(); return responseStr; } @@ -268,7 +274,8 @@ { colmn.Visible = true; colmn.OptionsColumn.ReadOnly = false; - }; + } + ; if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui")) { colmn.Visible = !isEdt; @@ -451,6 +458,15 @@ break; } txt.Enabled = !isEdt; + continue; + } + //澶氶�� + if (colType is RadioGroup) + { + var txt = colType as RadioGroup; + if (txt != null) + txt.SelectedIndex = int.Parse(strVal); + txt.ReadOnly = isEdt; continue; } //鏃堕棿 @@ -747,6 +763,15 @@ txt.ReadOnly = isEdt; continue; } + //澶氶�� + if (ctrl is RadioGroup) + { + var txt = ctrl as RadioGroup; + if (txt != null) + txt.SelectedIndex = 0; + txt.ReadOnly = isEdt; + continue; + } //鏃堕棿 if (ctrl is DateTimePicker) { @@ -770,6 +795,7 @@ } else txt.ReadOnly = isEdt; + txt.Checked = false; continue; } //鑷畾涔変粨搴� @@ -1004,6 +1030,13 @@ if (ctrl is NumericUpDown) { var txt = ctrl as NumericUpDown; + txt.ReadOnly = isEdt; + continue; + } + //澶氶�� + if (ctrl is RadioGroup) + { + var txt = ctrl as RadioGroup; txt.ReadOnly = isEdt; continue; } @@ -1677,16 +1710,20 @@ } public delegate void DelegateGetModel(string guid); public delegate void DelegateGetList(int currentPage); + /// <summary> - /// 璁剧疆涓昏〃鐨勬牱寮� + /// /// </summary> /// <param name="gridView1">gridview</param> /// <param name="picCheckBox">鍥炬爣鎸夐挳</param> - /// <param name="fm"></param> + /// <param name="fm">绐椾綋</param> /// <param name="fileName">瀛楁</param> /// <param name="icoName">鍥炬爣璺緞</param> - /// <param name="action"></param> - public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null, bool isPostSearch = true) + /// <param name="action">濮旀墭1</param> + /// <param name="tips">楦熷槾鎻愮ず</param> + /// <param name="isPostSearch"></param> + /// <param name="action2">濮旀墭2</param> + public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null, DevExpress.Utils.ToolTipController tips = null, bool isPostSearch = true, DelegateGetModel action2 = null) { gridView1.PopupMenuShowing += (s, e) => { @@ -1708,7 +1745,6 @@ } }; gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀 - if (isPostSearch == true) { gridView1.OptionsView.ShowGroupPanel = false; @@ -1725,7 +1761,6 @@ //鏄惁鏄剧ず搴曢儴鐨勮繃婊ゆ潯 // gridView1.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never; } - // gridView1.Appearance.HeaderPanel.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.ControlText; foreach (GridColumn column in gridView1.Columns) { @@ -1751,7 +1786,6 @@ column.OptionsFilter.AllowAutoFilter = false; } } - gridView1.IndicatorWidth = 60; gridView1.CustomDrawRowIndicator += (s, e) => { @@ -1793,6 +1827,21 @@ }; if (view.ActiveEditor is TextEdit) view.ActiveEditor.MouseUp += ActiveEditor_MouseUp; + }; + } + if (action2 != null) { + gridView1.FocusedRowChanged += (s, e) => + { + int _handle = gridView1.FocusedRowHandle; + if (_handle == -1) + return; + DataRow row = gridView1.GetDataRow(_handle); + if (row == null) + return; + string _guid = row["guid"].ToString(); + if (string.IsNullOrEmpty(_guid)) + return; + action2(_guid); }; } gridView1.RowStyle += (s, e) => @@ -1879,6 +1928,7 @@ }; } } + private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e) { BaseEdit edit = sender as BaseEdit; @@ -1911,7 +1961,8 @@ { int _handle = gridView1.FocusedRowHandle; bool _bl = xtraTabControl1.TabPages[0].PageEnabled; - if (_bl == false) { return; }; + if (_bl == false) { return; } + ; if (_handle < 0) { xtraTabControl1.SelectedTabPageIndex = -1; @@ -2174,8 +2225,6 @@ txt_iCount_1.ReadOnly = true; } - - #region 鑷畾涔夎繘搴︽潯鍒� /// <summary> @@ -2270,7 +2319,6 @@ // private GridColumn checkBoxColumn = null; public static void CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e) { - Rectangle checkBoxColumnHeaderRect = new Rectangle(51, 1, 37, 57); if (e.Column != null && e.Column.AbsoluteIndex == 0) { @@ -2314,10 +2362,26 @@ else { checkBoxColumn.Tag = "1"; + /********2025-07-23淇ˉ杩囨护bug 鏁呮敞閲� beg ************/ + //foreach (DataRow row in _Table.Rows) + //{ + // row["chkInt"] = true; + //} + /********2025-07-23淇ˉ杩囨护bug 鏁呮敞閲� end ************/ + /********2025-07-23淇ˉ杩囨护bug beg ************/ + System.Collections.IList ftRow = gridView1.DataController.GetAllFilteredAndSortedRows(); + System.Collections.ArrayList ftAry = new System.Collections.ArrayList(); + foreach (System.Data.DataRowView _ft in ftRow) + { + string guid = _ft["guid"].ToString(); + ftAry.Add(guid); + } foreach (DataRow row in _Table.Rows) { - row["chkInt"] = true; + if (ftAry.Contains(row["guid"].ToString())) + row["chkInt"] = true; } + /********2025-07-23淇ˉ杩囨护bug end ************/ } gcMain.BindingContext = new BindingContext(); gcMain.DataSource = _Table; @@ -2330,7 +2394,6 @@ } } #endregion - //璇诲彇榛樿缁勭粐 public static string GetFirstOrg(UserControl.UcLookOrg txt_erpSczz) @@ -2437,7 +2500,15 @@ ipqc棣栨, fqc, 鐢熶骇閫�鏂欏叆搴撴, - 鍏跺畠鍏ュ簱妫� + 鍏跺畠鍏ュ簱妫�, + 閿�鍞��璐у叆搴撴, + 瓒呮湡妫�, + 濮斿閫�鏂欏叆搴撴, + cqcjyes,//閲嶆鏂规 + cqcjno,//閲嶆鏂规 + 浜х嚎绉伴噸, + iqc绉伴噸, + 鍙楁墭鍏ュ簱 } -- Gitblit v1.9.3