From 4bc7030c4cea5b3deed0c938ec388ae94e33c51c Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 25 十月 2024 09:42:36 +0800 Subject: [PATCH] 修改会页 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 618 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 490 insertions(+), 128 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 83f1141..24cf5c3 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -15,8 +15,21 @@ using DevExpress.XtraEditors; using DevExpress.XtraTab; using System.Text.RegularExpressions; -using System.Xml; using System.Collections.Generic; +using Gs.DevApp.UserControl; +using DevExpress.XtraGrid.Columns; +using DevExpress.XtraGrid; +using DevExpress.XtraGrid.Views.Grid; +using System.Configuration; +using DevExpress.XtraGrid.Views.Grid.ViewInfo; +using DevExpress.XtraTreeList.Nodes; +using DevExpress.XtraTreeList; +using System.Net.Http; +using System.Threading.Tasks; +using DevExpress.Data.Helpers; +using DevExpress.Utils.About; +using DevExpress.Office.Model; + namespace Gs.DevApp.ToolBox { @@ -25,7 +38,26 @@ /// </summary> public class UtilityHelper { - private static string WebApiUrl = System.Configuration.ConfigurationSettings.AppSettings.Get("WebApiUrl").ToString(); + private static string WebApiUrl = ConfigurationManager.AppSettings["WebApiUrl"].ToString(); + + + + public static async Task<string> UploadFileAsync(string filePath) + { + using (var httpClient = new HttpClient()) + using (var form = new MultipartFormDataContent()) + { + httpClient.DefaultRequestHeaders.Add("token", ToolBox.UtilityHelper.GetBasicAuthTicket()); + using (var fs = File.OpenRead(filePath)) + using (var streamContent = new StreamContent(fs)) + { + form.Add(streamContent, "file", Path.GetFileName(filePath)); + var response = await httpClient.PostAsync(WebApiUrl + "Upload/UploadFile", form); + string responseString = await response.Content.ReadAsStringAsync(); + return responseString; + } + } + } /// <summary> /// httpPost璁块棶鏈嶅姟 @@ -65,6 +97,7 @@ } catch (Exception ex) { + LogHelper.Debug(url, param + ":" + ex.Message); throw ex; } finally @@ -75,6 +108,16 @@ } return responseStr; } + + /// <summary> + /// 榛樿椤靛ぇ灏� + /// </summary> + /// <returns></returns> + public static int GetPageSize() + { + return int.Parse(System.Configuration.ConfigurationSettings.AppSettings.Get("PageSize").ToString()); + } + /// <summary> /// 鏍规嵁鍥剧墖鍚嶈鍙栬祫婧愭枃浠�,涓嶅甫鍚庣紑鍚� /// </summary> @@ -83,11 +126,8 @@ /// <returns></returns> public static Image GetImgFromResource(string imageName, int lay) { - // 鑾峰彇褰撳墠绋嬪簭闆� Assembly assembly = Assembly.GetExecutingAssembly(); - // 鍒涘缓璧勬簮绠$悊鍣ㄦ潵璁块棶璧勬簮 ResourceManager resourceManager = new ResourceManager("Gs.DevApp.Properties.Resources", assembly); - // 灏濊瘯鑾峰彇鍥剧墖璧勬簮 try { Image image = resourceManager.GetObject(imageName) as Image; @@ -98,12 +138,30 @@ } catch (Exception ex) { + } Image image2 = resourceManager.GetObject(lay == 1 ? "chartsshowlegend_32x32" : "linktoprevious_16x16") as Image; return image2; } + /// <summary> - /// 鐢熸垚token + /// 鍒濆鍖栦竴涓〃 + /// </summary> + /// <param name="gc"></param> + /// <param name="gv"></param> + public static void SetDefaultTable(GridControl gc, GridView gv) + { + DataTable dt = new DataTable(); + foreach (GridColumn col in gv.Columns) + { + dt.Columns.Add(col.FieldName, typeof(string)); + } + gc.BindingContext = new BindingContext(); + gc.DataSource = dt; + gc.ForceInitialize(); + } + /// <summary> + /// 鐢熸垚璁块棶鏈嶅姟鐨則oken /// </summary> /// <returns></returns> public static string GetBasicAuthTicket() @@ -114,11 +172,11 @@ return token; } /// <summary> - /// 鏍囧噯json涓茶繑鍥濺eturnModel-->table锛� + /// 鏈嶅姟杩斿洖鐨刯son杞负ReturnModel-->鍖呭惈TablePage鍒嗛〉锛� /// </summary> /// <param name="strReturn"></param> /// <returns></returns> - public static ReturnModel<PageListModel> GetTableByJson(string strReturn) + public static ReturnModel<PageListModel> ReturnToTablePage(string strReturn) { ReturnModel<PageListModel> rto = new ReturnModel<PageListModel>(); JObject json = JObject.Parse(strReturn); @@ -139,11 +197,11 @@ return rto; } /// <summary> - /// 鏍囧噯json涓茶繑鍥濺eturnModel->瀛楃涓诧紝 + /// 鏈嶅姟杩斿洖鐨刯son杩斿洖ReturnModel锛� /// </summary> /// <param name="strReturn"></param> /// <returns></returns> - public static ReturnModel<dynamic> GetDataByJson(string strReturn) + public static ReturnModel<dynamic> ReturnToDynamic(string strReturn) { ReturnModel<dynamic> rto = new ReturnModel<dynamic>(); JObject json = JObject.Parse(strReturn); @@ -154,11 +212,11 @@ } /// <summary> - /// 鏍囧噯json涓茶繑鍥濺eturnModel-->table锛� + /// 鏈嶅姟杩斿洖鐨刯son涓茶繑鍥濺eturnModel-->浠呬粎鏈塴ist,涓嶅垎椤碉紝 /// </summary> /// <param name="strReturn"></param> /// <returns></returns> - public static ReturnModel<DataTable> GetNoPageTableByJson(string strReturn) + public static ReturnModel<DataTable> ReturnToList(string strReturn) { ReturnModel<DataTable> rto = new ReturnModel<DataTable>(); JObject json = JObject.Parse(strReturn); @@ -176,30 +234,21 @@ return rto; } - /// <summary> - /// 璇诲彇榛樿椤靛ぇ灏� - /// </summary> - /// <returns></returns> - public static int GetPageSize() - { - return 50; - // return int.Parse(System.Configuration.ConfigurationSettings.AppSettings.Get("PageSize").ToString()); - } - - /// <summary> - /// 鏍规嵁瀵硅薄鎵归噺璁剧疆鏂囨湰鍊� + /// 鏍规嵁瀵硅薄鎵归噺璁剧疆鏂囨湰妗嗙殑鍊� /// </summary> /// <param name="controls">controls:涓篻roupBox1.Controls/panel1.Controls</param> /// <param name="dynamicObject">瀵瑰儚</param> /// <param name="isEdt">鏄惁鍙紪杈�</param> + /// <param name="gridViews">鍏宠仈鐨刧rid</param> public static void SetValueByObj(ControlCollection controls, dynamic dynamicObject, Boolean isEdt, List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = null) { + isEdt = !isEdt; if (gridViews != null) { foreach (DevExpress.XtraGrid.Views.Grid.GridView gv in gridViews) { - gv.OptionsBehavior.Editable = isEdt; + gv.OptionsBehavior.Editable = !isEdt; } } foreach (JProperty property in dynamicObject.Properties()) @@ -208,29 +257,43 @@ string strVal = property.Value.ToString(); try { - // // 濡傛灉value鏄竴涓璞★紝鍙互閫掑綊閬嶅巻 - // if (property.Value is JObject) - // { - // JObject nestedObject = (JObject)property.Value; - // foreach (JProperty nestedProperty in nestedObject.Properties()) - // { - // Console.WriteLine("\tName: {0}, Value: {1}", nestedProperty.Name, nestedProperty.Value); - // } - // } - Control[] cols = controls.Find("txt_" + strName, true); + string _dddddd = "txt_" + strName; + Control[] cols = controls.Find(_dddddd, true); if (cols.Length > 0) { Control colType = cols[0]; - //LookUpEdit if (colType is LookUpEdit) { LookUpEdit txt = colType as LookUpEdit; if (txt != null) { txt.EditValue = strVal; - // txt.Text = strVal; } - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; + continue; + } + if (colType is ImageComboBoxEdit) + { + ImageComboBoxEdit txt = colType as ImageComboBoxEdit; + for (int i = 0; i < txt.Properties.Items.Count; i++) + { + if (txt.Properties.Items[i].Description == strVal) + { + txt.ReadOnly = isEdt; + txt.SelectedIndex = i; + continue; + }; + } + continue; + } + if (colType is ComboBoxEdit) + { + ComboBoxEdit txt = colType as ComboBoxEdit; + if (txt.Properties.TextEditStyle == DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor) + txt.SelectedIndex = int.Parse(strVal); + else + txt.Text = strVal; + txt.ReadOnly = isEdt; continue; } //涓嬫媺 @@ -241,7 +304,15 @@ txt.SelectedIndex = int.Parse(strVal); else txt.Text = strVal; - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; + continue; + } + //鑷畾涔変笅鎷� + if (colType is UcComBox) + { + UcComBox txt = colType as UcComBox; + txt.Val = strVal; + txt.Enabled = !isEdt; continue; } //鏂囨湰 @@ -250,7 +321,7 @@ TextEdit txt = colType as TextEdit; if (txt != null) txt.Text = strVal; - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; continue; } //鏁板瓧鍗� @@ -259,7 +330,7 @@ NumericUpDown txt = colType as NumericUpDown; if (txt != null) txt.Text = strVal; - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; continue; } //鍗曢�� @@ -267,29 +338,65 @@ { CheckEdit txt = colType as CheckEdit; if (txt != null) - txt.Checked = (strVal.ToString() == "1" ? true : false); - txt.Enabled = isEdt; + { + switch (strVal) + { + case "True": + txt.Checked = true; + break; + case "1": + txt.Checked = true; + break; + case "False": + txt.Checked = false; + break; + default: + txt.Checked = false; + break; + } + } + txt.ReadOnly = isEdt; + continue; + } + //鍗曢�� + if (colType is CheckBox) + { + CheckBox txt = colType as CheckBox; + if (txt != null) + txt.Checked = bool.Parse(strVal); + txt.Enabled = !isEdt; continue; } //鏃堕棿 if (colType is DateTimePicker) { DateTimePicker txt = colType as DateTimePicker; - if (txt != null) - txt.Checked = (strVal.ToString() == "1" ? true : false); - txt.Enabled = isEdt; + txt.Text = strVal.ToString(); + txt.Enabled = !isEdt; + continue; + } + //Label + if (colType is Label) + { + Label txt = colType as Label; + if (_dddddd == "txt_checkStatus") + { + if (strVal.ToString() == "True") + txt.Text = "宸插鏍�"; + if (strVal.ToString() == "False") + txt.Text = "鏈鏍�"; + } + else + txt.Text = strVal.ToString(); continue; } } } catch (Exception ex) { - - MessageBox.Show(strName + ex.Message); + MessageBox.Show(ex.Message); } - } - } /// <summary> @@ -297,24 +404,25 @@ /// </summary> /// <param name="controls">controls:涓篻roupBox1.Controls/panel1.Controls</param> /// <param name="isEdt">鏄惁鍙紪杈�</param> - public static void CleanValue(ControlCollection controls, Boolean isEdt, List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = null) + /// <param name="gridViews">鍏宠仈鐨刧rid</param> + public static void CleanValueByControl(ControlCollection controls, Boolean isEdt, List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = null) { + isEdt = !isEdt; if (gridViews != null) { foreach (DevExpress.XtraGrid.Views.Grid.GridView gv in gridViews) { - gv.OptionsBehavior.Editable = isEdt; + gv.OptionsBehavior.Editable = !isEdt; } } foreach (Control ctrl in controls) { - ctrl.Enabled = isEdt; //澶氳鏂囨湰 if (ctrl is MemoEdit) { MemoEdit txt = ctrl as MemoEdit; txt.Text = ""; - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; continue; } //涓嬫媺 @@ -325,13 +433,38 @@ txt.SelectedIndex = 0; else txt.Text = ""; - txt.Enabled = isEdt; + txt.ReadOnly = isEdt; + continue; + } + //鑷畾涔夌殑涓嬫媺 + if (ctrl is UcComBox) + { + UcComBox txt = ctrl as UcComBox; + txt.Val = "0"; + txt.Enabled = !isEdt; continue; } //鏂囨湰 if (ctrl is TextEdit) { - ctrl.Text = ""; + TextEdit txt = ctrl as TextEdit; + txt.Text = ""; + txt.ReadOnly = isEdt; + continue; + } + //鏃堕棿 + if (ctrl is DateTimePicker) + { + DateTimePicker txt = ctrl as DateTimePicker; + txt.Enabled = !isEdt; + continue; + } + //鍗曢�� + if (ctrl is CheckBox) + { + CheckBox txt = ctrl as CheckBox; + txt.Checked = false; + txt.Enabled = !isEdt; continue; } } @@ -341,14 +474,16 @@ /// 绂佺敤鎴栧惎鐢ㄥ鍣ㄩ噷闈㈢殑鎺т欢 /// </summary> /// <param name="controls">controls:涓篻roupBox1.Controls/panel1.Controls</param> - /// <param name="isEdt">鏄惁鍙紪杈�</param> - public static void ChangeEnable(ControlCollection controls, Boolean isEdt, List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = null) + /// <param name="isEdt"></param> + /// <param name="gridViews"></param> + public static void ChangeEnableByControl(ControlCollection controls, Boolean isEdt, List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = null) { + isEdt = !isEdt; if (gridViews != null) { foreach (DevExpress.XtraGrid.Views.Grid.GridView gv in gridViews) { - gv.OptionsBehavior.Editable = isEdt; + gv.OptionsBehavior.Editable = !isEdt; } } foreach (Control ctrl in controls) @@ -356,19 +491,35 @@ //鏂囨湰 if (ctrl is TextEdit) { - ctrl.Enabled = isEdt; + TextEdit txt = ctrl as TextEdit; + txt.ReadOnly = isEdt; continue; } //鏁板瓧鍗� if (ctrl is NumericUpDown) { - ctrl.Enabled = isEdt; + NumericUpDown txt = ctrl as NumericUpDown; + txt.ReadOnly = isEdt; + continue; + } + //涓嬫媺 + if (ctrl is UcComBox) + { + UcComBox txt = ctrl as UcComBox; + txt.Val = "0"; + txt.Enabled = !isEdt; continue; } //鏃ユ湡 if (ctrl is DateTimePicker) { - ctrl.Enabled = isEdt; + ctrl.Enabled = !isEdt; + continue; + } + //鍗曢�� + if (ctrl is CheckBox) + { + ctrl.Enabled = !isEdt; continue; } } @@ -379,7 +530,7 @@ /// </summary> /// <param name="tabControl">閫夐」鍗″鍣�</param> /// <param name="idx">浠�0寮�濮嬶紝濡傛灉鏄�999锛屽垯鍏ㄩ儴鍙敤</param> - public static void ChangeTab(XtraTabControl tabControl, int idx) + public static void JumpToTab(XtraTabControl tabControl, int idx) { if (idx == 999) { @@ -398,53 +549,43 @@ tabControl.SelectedTabPageIndex = idx; } - + /// <summary> + /// TreeView鑱斿姩閫夋嫨 + /// </summary> + /// <param name="e"></param> public static void TreeViewCheck(TreeViewEventArgs e) { try { if (e.Node.Nodes.Count > 0) { - bool NoFalse = true; foreach (TreeNode tn in e.Node.Nodes) { - if (tn.Checked == false) + tn.Checked = e.Node.Checked; + foreach (TreeNode x in tn.Nodes) { - NoFalse = false; - } - } - if (e.Node.Checked == true || NoFalse) - { - foreach (TreeNode tn in e.Node.Nodes) - { - if (tn.Checked != e.Node.Checked) + x.Checked = e.Node.Checked; + foreach (TreeNode y in x.Nodes) { - tn.Checked = e.Node.Checked; + y.Checked = e.Node.Checked; } } } } - if (e.Node.Parent != null && e.Node.Parent is TreeNode) + if (e.Node.Checked == true && e.Node.Parent != null && e.Node.Parent.Nodes.Count > 0) { - bool ParentNode = true; - foreach (TreeNode tn in e.Node.Parent.Nodes) + TreeNode currentNode = e.Node; + while (currentNode != null) { - if (tn.Checked == false) - { - ParentNode = false; - } - } - if (e.Node.Parent.Checked != ParentNode && (e.Node.Checked == false || e.Node.Checked == true && e.Node.Parent.Checked == false)) - { - e.Node.Parent.Checked = ParentNode; + currentNode.Checked = e.Node.Checked; + currentNode = currentNode.Parent; } } } catch (Exception ex) { - throw ex; + ToolBox.MsgHelper.ShowError(ex.Message); } - } /// <summary> @@ -452,52 +593,273 @@ /// </summary> /// <param name="input"></param> /// <returns></returns> - public static string ToCamelCase(string propertyName) + public static string ToCamelCase(string strItem) { - if (propertyName.Length > 0 && propertyName.All(char.IsUpper)) - propertyName = propertyName.ToLower(); - string dd = Regex.Replace(propertyName, @"_([a-z])", m => m.Groups[1].Value.ToUpper()); - return dd; - } - public static void UpdateAppConfig(string key, string newValue) - { - string configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; - XmlDocument xmlDoc = new XmlDocument(); - xmlDoc.Load(configFile); + //濡傛灉鍖呭惈灏忓啓锛屼絾涓嶅寘鍚笅鍒掔嚎 + bool hasLowercase = Regex.IsMatch(strItem, @"[a-z]"); + if (hasLowercase && !strItem.Contains("_")) + { + char[] chars = strItem.ToCharArray(); + chars[0] = char.ToLower(chars[0]); + return new string(chars); + } + string[] strItems = strItem.ToLower().Split('_'); + string strItemTarget = strItems[0]; + for (int j = 1; j < strItems.Length; j++) + { + string temp = strItems[j].ToString(); + string temp1 = temp[0].ToString().ToUpper(); + string temp2 = ""; + temp2 = temp1 + temp.Remove(0, 1); + strItemTarget += temp2; + } + return strItemTarget; - XmlNode node = xmlDoc.SelectSingleNode($"//appSettings//add[@key='{key}']"); - if (node != null) - { - XmlAttribute attribute = node as XmlAttribute; - attribute.Value = newValue; - xmlDoc.Save(configFile); - } } - public class CboItemEntity - { - private object _text = 0; - private object _Value = ""; - /// <summary> - /// 鏄剧ず鍊� - /// </summary> - public object Text - { - get { return this._text; } - set { this._text = value; } - } - /// <summary> - /// 瀵硅薄鍊� - /// </summary> - public object Value - { - get { return this._Value; } - set { this._Value = value; } - } - public override string ToString() + /// <summary> + /// 璇诲彇grid鐨勫綋鍓嶈 + /// </summary> + /// <param name="xtraTabControl1"></param> + /// <param name="lbGuid">缂栬緫妗嗕腑鐨勪富閿悕</param> + /// <param name="txtName">缂栬緫妗嗕腑鐨勬枃鏈鍚�</param> + /// <param name="gridView1"></param> + /// <param name="SelectedTabPageIndex"></param> + /// <returns></returns> + public static (string, string) GetCurrentRow(XtraTabControl xtraTabControl1 + , System.Windows.Forms.Label lbGuid + , DevExpress.XtraEditors.TextEdit txtName + , DevExpress.XtraGrid.Views.Grid.GridView gridView1 + , int SelectedTabPageIndex = 1) + { + string _strGuid = ""; + string _strName = ""; + if (xtraTabControl1.SelectedTabPageIndex == SelectedTabPageIndex && lbGuid.Text.Length > 10) { - return this.Text.ToString(); + _strGuid = lbGuid.Text.Trim(); + _strName = txtName.Text.Trim(); } + else + { + DataRow dr = gridView1.GetFocusedDataRow(); + if (dr == null || string.IsNullOrEmpty(dr["guid"].ToString())) + { + + } + else + { + _strGuid = dr["guid"].ToString(); + _strName = dr[2].ToString(); + } + } + return (_strGuid, _strName); + } + /// <summary> + /// 璇诲彇TreeView鐨勫綋鍓嶈 + /// </summary> + /// <param name="xtraTabControl1"></param> + /// <param name="lbGuid"></param> + /// <param name="txtName"></param> + /// <param name="tlMenu"></param> + /// <param name="SelectedTabPageIndex"></param> + /// <returns></returns> + public static (string, string) GetCurrentRow(XtraTabControl xtraTabControl1 + , System.Windows.Forms.Label lbGuid + , DevExpress.XtraEditors.TextEdit txtName + , System.Windows.Forms.TreeView tlMenu + , int SelectedTabPageIndex = 1) + { + string _strGuid = ""; + string _strName = ""; + if (xtraTabControl1.SelectedTabPageIndex == SelectedTabPageIndex && lbGuid.Text.Length > 10) + { + _strGuid = lbGuid.Text.Trim(); + _strName = txtName.Text.Trim(); + } + else + { + TreeNode clickedNode = tlMenu.SelectedNode; + if (clickedNode != null) + { + _strGuid = clickedNode.Name.ToString(); + _strName = clickedNode.Text.Trim(); + } + } + return (_strGuid, _strName); + } + + /// <summary> + /// 璇诲彇TreeList鐨勫綋鍓嶈 + /// </summary> + /// <param name="xtraTabControl1"></param> + /// <param name="lbGuid"></param> + /// <param name="txtName"></param> + /// <param name="tlMenu"></param> + /// <param name="SelectedTabPageIndex"></param> + /// <returns></returns> + public static (string, string) GetCurrentRow(XtraTabControl xtraTabControl1 + , System.Windows.Forms.Label lbGuid + , DevExpress.XtraEditors.TextEdit txtName + , DevExpress.XtraTreeList.TreeList tlMenu + , int SelectedTabPageIndex = 1) + { + string _strGuid = ""; + string _strName = ""; + if (xtraTabControl1.SelectedTabPageIndex == SelectedTabPageIndex && lbGuid.Text.Length > 10) + { + _strGuid = lbGuid.Text.Trim(); + _strName = txtName.Text.Trim(); + } + else + { + _strGuid = tlMenu.FocusedNode.GetValue("guid").ToString(); + _strName = tlMenu.FocusedNode.GetValue(0).ToString(); + } + return (_strGuid, _strName); + } + + /// <summary> + /// 璇诲彇GridView鍙屽嚮鐨勪富閿� + /// </summary> + /// <param name="gridView1"></param> + /// <param name="e"></param> + /// <param name="colName"></param> + /// <returns></returns> + public static string GetCurrentDoubleRow(DevExpress.XtraGrid.Views.Grid.GridView gridView1 + , MouseEventArgs e + , string colName) + { + GridHitInfo info = gridView1.CalcHitInfo(e.Location); + if (info.InRow) + { + GridView view = info.View as GridView; + if (view != null) + { + DataRow row = view.GetDataRow(info.RowHandle); + if (row != null) + { + string rowGuid = (row[colName].ToString()); + return rowGuid; + } + } + } + return ""; + } + + + /// <summary> + /// 璇诲彇GridView鍙屽嚮鐨勪富閿� + /// </summary> + /// <param name="gridView1"></param> + /// <param name="e"></param> + /// <param name="colName"></param> + /// <returns></returns> + public static string GetCurrentDoubleRow(DevExpress.XtraTreeList.TreeList tlMenu + , MouseEventArgs e + , string colName) + { + TreeListHitInfo info = tlMenu.CalcHitInfo(e.Location); + if (info.Node != null) + { + TreeListNode clickedNode = tlMenu.FocusedNode; + if (clickedNode.FirstNode == null) + { + string rowGuid = clickedNode.GetValue(colName).ToString(); + return rowGuid; + } + } + return ""; + } + + + } + + /// <summary> + /// 涓嬫媺妗嗘潯鐩被 + /// </summary> + public class CboItemEntity + { + public CboItemEntity() + { + } + public CboItemEntity(string val, string text) + { + this.Text = text; + this.Value = val; + } + private object _text = 0; + private object _Value = ""; + /// <summary> + /// 鏄剧ず鍊� + /// </summary> + public object Text + { + get { return this._text; } + set { this._text = value; } + } + /// <summary> + /// 瀵硅薄鍊� + /// </summary> + public object Value + { + get { return this._Value; } + set { this._Value = value; } + } + + public override string ToString() + { + return this.Text.ToString(); } } + + /// <summary> + /// 鏌ヨ妗� + /// </summary> + public class FilterEntity + { + /// <summary> + /// + /// </summary> + /// <param name="id">瀛楁鍚�</param> + /// <param name="idDec">瀛楁鍚嶅娉�</param> + /// <param name="oper">鎿嶄綔绗�</param> + /// <param name="operDec">鎿嶄綔绗﹀娉�</param> + /// <param name="val"></param> + public FilterEntity(string id, string idDec, string oper, string operDec, string val) + { + this.fileId = id; + this.fileIdDec = idDec; + this.fileOper = oper; + this.fileOperDec = operDec; + this.fileValue = val; + } + public string fileId + { + get; + set; + } + public string fileIdDec + { + get; + set; + } + public string fileOper + { + get; + set; + } + public string fileOperDec + { + get; + set; + } + public string fileValue + { + get; + set; + } + } + + + } -- Gitblit v1.9.3