From b7ae94a828c15feb7b04c2ff871438e1143b6a44 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 08 十月 2024 17:47:22 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.cs | 58 ++++++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchViewModel.cs | 86 ++++++++++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user | 3 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.Designer.cs | 137 +++++++++++++++++++ WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.resx | 120 +++++++++++++++++ 5 files changed, 404 insertions(+), 0 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.Designer.cs new file mode 100644 index 0000000..97ec093 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.Designer.cs @@ -0,0 +1,137 @@ +锘縩amespace HStation.WinFrmUI +{ + partial class XhsProjectSimulationSearchCtrl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); + gridControl1 = new DevExpress.XtraGrid.GridControl(); + gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); + Root = new DevExpress.XtraLayout.LayoutControlGroup(); + layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); + searchControl1 = new SearchControl(); + layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); + ((ISupportInitialize)layoutControl1).BeginInit(); + layoutControl1.SuspendLayout(); + ((ISupportInitialize)gridControl1).BeginInit(); + ((ISupportInitialize)gridView1).BeginInit(); + ((ISupportInitialize)Root).BeginInit(); + ((ISupportInitialize)layoutControlItem1).BeginInit(); + ((ISupportInitialize)searchControl1.Properties).BeginInit(); + ((ISupportInitialize)layoutControlItem2).BeginInit(); + SuspendLayout(); + // + // layoutControl1 + // + layoutControl1.Controls.Add(searchControl1); + layoutControl1.Controls.Add(gridControl1); + layoutControl1.Dock = DockStyle.Fill; + layoutControl1.Location = new Point(0, 0); + layoutControl1.Name = "layoutControl1"; + layoutControl1.Root = Root; + layoutControl1.Size = new Size(661, 483); + layoutControl1.TabIndex = 0; + layoutControl1.Text = "layoutControl1"; + // + // gridControl1 + // + gridControl1.Location = new Point(12, 36); + gridControl1.MainView = gridView1; + gridControl1.Name = "gridControl1"; + gridControl1.Size = new Size(637, 435); + gridControl1.TabIndex = 4; + gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 }); + // + // gridView1 + // + gridView1.GridControl = gridControl1; + gridView1.Name = "gridView1"; + // + // Root + // + Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; + Root.GroupBordersVisible = false; + Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem2 }); + Root.Name = "Root"; + Root.Size = new Size(661, 483); + Root.TextVisible = false; + // + // layoutControlItem1 + // + layoutControlItem1.Control = gridControl1; + layoutControlItem1.Location = new Point(0, 24); + layoutControlItem1.Name = "layoutControlItem1"; + layoutControlItem1.Size = new Size(641, 439); + layoutControlItem1.TextSize = new Size(0, 0); + layoutControlItem1.TextVisible = false; + // + // searchControl1 + // + searchControl1.Location = new Point(129, 12); + searchControl1.Name = "searchControl1"; + searchControl1.Properties.Buttons.AddRange(new EditorButton[] { new DevExpress.XtraEditors.Repository.ClearButton(), new DevExpress.XtraEditors.Repository.SearchButton() }); + searchControl1.Size = new Size(520, 20); + searchControl1.StyleController = layoutControl1; + searchControl1.TabIndex = 5; + // + // layoutControlItem2 + // + layoutControlItem2.Control = searchControl1; + layoutControlItem2.Location = new Point(0, 0); + layoutControlItem2.Name = "layoutControlItem2"; + layoutControlItem2.Size = new Size(641, 24); + layoutControlItem2.TextSize = new Size(105, 14); + // + // XhsProjectSimulationSearchCtrl + // + AutoScaleDimensions = new SizeF(7F, 14F); + AutoScaleMode = AutoScaleMode.Font; + Controls.Add(layoutControl1); + Name = "XhsProjectSimulationSearchCtrl"; + Size = new Size(661, 483); + ((ISupportInitialize)layoutControl1).EndInit(); + layoutControl1.ResumeLayout(false); + ((ISupportInitialize)gridControl1).EndInit(); + ((ISupportInitialize)gridView1).EndInit(); + ((ISupportInitialize)Root).EndInit(); + ((ISupportInitialize)layoutControlItem1).EndInit(); + ((ISupportInitialize)searchControl1.Properties).EndInit(); + ((ISupportInitialize)layoutControlItem2).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DevExpress.XtraLayout.LayoutControl layoutControl1; + private DevExpress.XtraGrid.GridControl gridControl1; + private DevExpress.XtraGrid.Views.Grid.GridView gridView1; + private DevExpress.XtraLayout.LayoutControlGroup Root; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; + private SearchControl searchControl1; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.cs new file mode 100644 index 0000000..0e306a4 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.cs @@ -0,0 +1,58 @@ +锘縩amespace HStation.WinFrmUI +{ + public partial class XhsProjectSimulationSearchCtrl : DevExpress.XtraEditors.XtraUserControl + { + public XhsProjectSimulationSearchCtrl() + { + InitializeComponent(); + this.searchControl1.SetSearchSettings(Search, Recover); + } + + /// <summary> + /// 搴旂敤鏌ヨ浜嬩欢 + /// </summary> + public event Action<List<Yw.Model.HydroParterInfo>> ApplySearchEvent; + + //姘村姏淇℃伅鏂规硶 + private Func<Yw.Model.HydroModelInfo> _hydroInfoFunc; + + /// <summary> + /// 鍒濆鍖栨暟鎹� + /// </summary> + public void InitialData(Func<Yw.Model.HydroModelInfo> hydroInfoFunc) + { + _hydroInfoFunc = hydroInfoFunc; + } + + //鏌ヨ + private void Search(object sender, EventArgs e) + { + var condition = this.searchControl1.Text.Trim(); + if (string.IsNullOrEmpty(condition)) + { + return; + } + var hydroInfo = _hydroInfoFunc?.Invoke(); + if (hydroInfo == null) + { + return; + } + //var allParterList = + } + + //瑕嗙洊 + private void Recover(object sender, EventArgs e) + { + var hydroInfo = _hydroInfoFunc?.Invoke(); + if (hydroInfo == null) + { + return; + } + this.ApplySearchEvent?.Invoke(null); + } + + + + + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.resx b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchCtrl.resx @@ -0,0 +1,120 @@ +锘�<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchViewModel.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchViewModel.cs new file mode 100644 index 0000000..1bed1be --- /dev/null +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/05-search/XhsProjectSimulationSearchViewModel.cs @@ -0,0 +1,86 @@ +锘縩amespace HStation.WinFrmUI +{ + /// <summary> + /// + /// </summary> + public class XhsProjectSimulationSearchViewModel + { + /// <summary> + /// + /// </summary> + public XhsProjectSimulationSearchViewModel() { } + + /// <summary> + /// + /// </summary> + public XhsProjectSimulationSearchViewModel(Yw.Model.HydroParterInfo rhs) + { + this.ID = rhs.ID; + this.Catalog = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(rhs.Catalog); + this.Name = rhs.Name; + this.Code = rhs.Code; + this.ModelType = rhs.ModelType; + this.HasDbId = !string.IsNullOrEmpty(rhs.DbId); + this.DbLocked = rhs.DbLocked; + this.FlagsString = Yw.Untity.FlagsHelper.ToString(rhs.Flags); + this.Description = rhs.Description; + } + + /// <summary> + /// id + /// </summary> + [Display(Name = "ID")] + [Browsable(false)] + public long ID { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [Display(Name = "鍒嗙被")] + public string Catalog { get; set; } + + /// <summary> + /// 鍚嶇О + /// </summary> + [Display(Name = "鍚嶇О")] + public string Name { get; set; } + + /// <summary> + /// 缂栫爜 + /// </summary> + [Display(Name = "缂栫爜")] + public string Code { get; set; } + + /// <summary> + /// 鍨嬪彿 + /// </summary> + [Display(Name = "鍨嬪彿")] + public string ModelType { get; set; } + + /// <summary> + /// 鍖归厤 + /// </summary> + [Display(Name = "鍖归厤")] + public bool HasDbId { get; set; } + + /// <summary> + /// 閿佸畾 + /// </summary> + [Display(Name = "閿佸畾")] + public bool DbLocked { get; set; } + + /// <summary> + /// 鏍囩 + /// </summary> + [Display(Name = "鏍囩")] + public string FlagsString { get; set; } + + /// <summary> + /// 璇存槑 + /// </summary> + [Display(Name = "璇存槑")] + public string Description { get; set; } + + + } +} diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user index c7a387a..890d42e 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/HStation.WinFrmUI.Xhs.Core.csproj.user @@ -76,6 +76,9 @@ <Compile Update="03-simulation\06-simulation\02-check\XhsProjectSimulationHydroCheckFailedDlg.cs"> <SubType>Form</SubType> </Compile> + <Compile Update="03-simulation\06-simulation\05-search\XhsProjectSimulationSearchCtrl.cs"> + <SubType>UserControl</SubType> + </Compile> <Compile Update="03-simulation\XhsProjectSimulationMgrPage.cs"> <SubType>UserControl</SubType> </Compile> -- Gitblit v1.9.3