From 5cf52040c8b95c967433d627374e25645c404eb2 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期一, 01 九月 2025 09:37:45 +0800
Subject: [PATCH] 复制
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 106 ++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 85 insertions(+), 21 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 8037a34..b369d8a 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -62,13 +62,17 @@
/// <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;
@@ -458,7 +465,7 @@
{
var txt = colType as RadioGroup;
if (txt != null)
- txt.SelectedIndex =int.Parse( strVal);
+ txt.SelectedIndex = int.Parse(strVal);
txt.ReadOnly = isEdt;
continue;
}
@@ -788,6 +795,7 @@
}
else
txt.ReadOnly = isEdt;
+ txt.Checked = false;
continue;
}
//鑷畾涔変粨搴�
@@ -1702,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) =>
{
@@ -1817,6 +1829,22 @@
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) =>
{
//榛樿閫変腑琛屼笉鍙樿壊
@@ -1901,6 +1929,7 @@
};
}
}
+
private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e)
{
BaseEdit edit = sender as BaseEdit;
@@ -1933,7 +1962,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;
@@ -2088,7 +2118,20 @@
}
}
+
+ /// <summary>
+ /// 鏁版嵁杩囨护
+ /// </summary>
+ /// <returns></returns>
+ public static string GetOrgWhere()
+ {
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ sb.Append(" (select aboutGuid as fid from SYS_USER_BIND where userGuid='" + LoginInfoModel.CurrentUser.LoginUserGuid + "' and ftype='缁勭粐')");
+ return sb.ToString();
+ }
#endregion
+
+
/// <summary>
/// 鍒ゆ柇鏄笉鏄竴涓湁鏁堢殑鏁板��
/// </summary>
@@ -2196,8 +2239,6 @@
txt_iCount_1.ReadOnly = true;
}
-
-
#region 鑷畾涔夎繘搴︽潯鍒�
/// <summary>
@@ -2292,7 +2333,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)
{
@@ -2336,10 +2376,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;
@@ -2352,7 +2408,6 @@
}
}
#endregion
-
//璇诲彇榛樿缁勭粐
public static string GetFirstOrg(UserControl.UcLookOrg txt_erpSczz)
@@ -2465,6 +2520,15 @@
濮斿閫�鏂欏叆搴撴,
cqcjyes,//閲嶆鏂规
cqcjno,//閲嶆鏂规
+ 浜х嚎绉伴噸,
+ iqc绉伴噸,
+ 鍙楁墭鍏ュ簱
+ }
+
+ public enum OrderType
+ {
+ 鍏跺畠鍏ュ簱,
+ 鐗╂枡璋冩嫧
}
--
Gitblit v1.9.3