基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
namespace Lskj.Control.AutoSelectControlUp
|
||||
{
|
||||
partial class AutoSelectControl
|
||||
{
|
||||
/// <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 Windows Form 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()
|
||||
{
|
||||
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
|
||||
this.labObscure = new Lskj.Control.LabelTextEdit();
|
||||
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
|
||||
this.gridControl = new DevExpress.XtraGrid.GridControl();
|
||||
this.gcMain = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
|
||||
this.panelControl1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl2)).BeginInit();
|
||||
this.panelControl2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panelControl1
|
||||
//
|
||||
this.panelControl1.Controls.Add(this.labObscure);
|
||||
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panelControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panelControl1.Name = "panelControl1";
|
||||
this.panelControl1.Size = new System.Drawing.Size(698, 49);
|
||||
this.panelControl1.TabIndex = 1;
|
||||
//
|
||||
// labObscure
|
||||
//
|
||||
this.labObscure.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.labObscure.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labObscure.EditText = "";
|
||||
this.labObscure.Enabled = false;
|
||||
this.labObscure.FontSize = 0F;
|
||||
this.labObscure.LabelText = "模糊查询";
|
||||
this.labObscure.Location = new System.Drawing.Point(13, 13);
|
||||
this.labObscure.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.labObscure.Model = null;
|
||||
this.labObscure.Name = "labObscure";
|
||||
this.labObscure.NullText = "";
|
||||
this.labObscure.ReadOnly = false;
|
||||
this.labObscure.Required = false;
|
||||
this.labObscure.Size = new System.Drawing.Size(236, 21);
|
||||
this.labObscure.TabIndex = 2;
|
||||
//
|
||||
// panelControl2
|
||||
//
|
||||
this.panelControl2.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.panelControl2.Controls.Add(this.gridControl);
|
||||
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panelControl2.Location = new System.Drawing.Point(0, 49);
|
||||
this.panelControl2.Name = "panelControl2";
|
||||
this.panelControl2.Size = new System.Drawing.Size(698, 447);
|
||||
this.panelControl2.TabIndex = 2;
|
||||
//
|
||||
// gridControl
|
||||
//
|
||||
this.gridControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gridControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.gridControl.MainView = this.gcMain;
|
||||
this.gridControl.Name = "gridControl";
|
||||
this.gridControl.Size = new System.Drawing.Size(698, 447);
|
||||
this.gridControl.TabIndex = 5;
|
||||
this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gcMain});
|
||||
//
|
||||
// gcMain
|
||||
//
|
||||
this.gcMain.Appearance.HeaderPanel.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gcMain.Appearance.HeaderPanel.Options.UseFont = true;
|
||||
this.gcMain.Appearance.HeaderPanel.Options.UseTextOptions = true;
|
||||
this.gcMain.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
|
||||
this.gcMain.Appearance.Preview.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gcMain.Appearance.Preview.Options.UseFont = true;
|
||||
this.gcMain.Appearance.Row.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gcMain.Appearance.Row.Options.UseBackColor = true;
|
||||
this.gcMain.Appearance.Row.Options.UseFont = true;
|
||||
this.gcMain.Appearance.Row.Options.UseForeColor = true;
|
||||
this.gcMain.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
|
||||
this.gcMain.GridControl = this.gridControl;
|
||||
this.gcMain.IndicatorWidth = 30;
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.OptionsBehavior.Editable = false;
|
||||
this.gcMain.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.gcMain.OptionsView.ColumnAutoWidth = false;
|
||||
this.gcMain.OptionsView.RowAutoHeight = true;
|
||||
this.gcMain.OptionsView.ShowGroupPanel = false;
|
||||
this.gcMain.PaintStyleName = "Skin";
|
||||
//
|
||||
// AutoSelectControl
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(698, 496);
|
||||
this.Controls.Add(this.panelControl2);
|
||||
this.Controls.Add(this.panelControl1);
|
||||
this.Name = "AutoSelectControl";
|
||||
this.Text = "提示:双击选择";
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit();
|
||||
this.panelControl1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.panelControl2)).EndInit();
|
||||
this.panelControl2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.PanelControl panelControl1;
|
||||
private DevExpress.XtraEditors.PanelControl panelControl2;
|
||||
private DevExpress.XtraGrid.GridControl gridControl;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gcMain;
|
||||
private LabelTextEdit labObscure;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/******************************
|
||||
* 说明:多选界面
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-03-20
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Lskj.Control.Model;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraEditors.Repository;
|
||||
using DevExpress.Data;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Menu;
|
||||
using DevExpress.Utils.Menu;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Lskj.Util;
|
||||
using Lskj.Business;
|
||||
using Lskj.Model;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Reflection;
|
||||
using DevExpress.Data.Filtering;
|
||||
using Lskj.Core;
|
||||
|
||||
namespace Lskj.Control.AutoSelectControlUp
|
||||
{
|
||||
public partial class AutoSelectControl : BaseForm
|
||||
{
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
/// <value>The edit value.</value>
|
||||
public string EditValue { get; set; }
|
||||
/// <summary>
|
||||
/// 显示值
|
||||
/// </summary>
|
||||
/// <value>The edit text.</value>
|
||||
public string EditText { get; set; }
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember { get; set; }
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField { get; set; }
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField { get; set; }
|
||||
/// <summary>
|
||||
/// 查询sql
|
||||
/// </summary>
|
||||
public string SourceSQL { get; set; }
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public DataTable DataSource { get; set; }
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = "remark";
|
||||
public AutoSelectControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:窗口加载</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
|
||||
base.OnLoad(e);
|
||||
this.SetReadOnlyColumns();
|
||||
labObscure.TextEdit.KeyDown += new KeyEventHandler(OnTextEditKeyDown);
|
||||
this.gcMain.DoubleClick += new EventHandler(OnRowDoubleClick);
|
||||
}
|
||||
/// <summary>
|
||||
/// 双击选中值
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnRowDoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
DataRow dataRow= this.gcMain.GetFocusedDataRow();
|
||||
this.EditValue = dataRow[ValueField]+"";
|
||||
this.EditText = dataRow[TextField]+"";
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定回车搜索事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnTextEditKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
string expand = "and (";
|
||||
foreach (GridColumn gridColumn in DataSource.Columns)
|
||||
{
|
||||
expand += gridColumn.FieldName + " like '%{0}%' or ";
|
||||
}
|
||||
expand += ")";
|
||||
expand = string.Format(expand, labObscure.TextEdit.Text);
|
||||
this.gcMain.GridControl.DataSource = BaseImpl.GetDataTableResult(SourceSQL + expand);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置只读列</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
private void SetReadOnlyColumns()
|
||||
{
|
||||
this.gcMain.Columns.Clear();
|
||||
if (this.DataSource != null)
|
||||
{
|
||||
GridColumn valueColumn = new GridColumn();
|
||||
valueColumn.FieldName = valueColumn.Name = ValueField;
|
||||
valueColumn.Caption = "编码";
|
||||
valueColumn.Width = 200;
|
||||
//valueColumn.Visible = true;
|
||||
valueColumn.Visible = ValueMember.Substring(0, 1) != "_";
|
||||
valueColumn.OptionsColumn.AllowEdit = false;
|
||||
valueColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
|
||||
|
||||
GridColumn textColumn = new GridColumn();
|
||||
textColumn.FieldName = textColumn.Name = TextField;
|
||||
textColumn.Caption = "名称";
|
||||
textColumn.Width = 350;
|
||||
//textColumn.Visible = true;
|
||||
textColumn.Visible = TextField.Substring(0, 1) != "_";
|
||||
textColumn.OptionsColumn.AllowEdit = false;
|
||||
textColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
|
||||
|
||||
this.gcMain.Columns.AddRange(new GridColumn[] { valueColumn, textColumn });
|
||||
|
||||
if (DataSource.Columns.IndexOf("remark") != -1)
|
||||
{
|
||||
DataColumn column = DataSource.Columns.Cast<DataColumn>().FirstOrDefault(x => x.ColumnName.ToLower() == RemarkField);
|
||||
if (column != null) RemarkField = column.ColumnName;
|
||||
|
||||
GridColumn remarkColumn = new GridColumn();
|
||||
remarkColumn.Name = remarkColumn.FieldName = RemarkField;
|
||||
remarkColumn.Caption = "备注";
|
||||
remarkColumn.Visible = true;
|
||||
remarkColumn.Width = 120;
|
||||
//字段第一个字符为下划线代表不显示
|
||||
if (RemarkField.Substring(0, 1) == "_")
|
||||
remarkColumn.Visible = false;
|
||||
|
||||
remarkColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
|
||||
this.gcMain.Columns.Add(remarkColumn);
|
||||
}
|
||||
|
||||
foreach (DataColumn dcol in DataSource.Columns)
|
||||
{
|
||||
if ((dcol.ColumnName.Substring(0, 1) != "_") && (dcol.ColumnName.ToLower() != ValueField.ToLower()) && (dcol.ColumnName.ToLower() != TextField.ToLower()) && ((int)dcol.ColumnName[0] > 127))
|
||||
{
|
||||
GridColumn otherColumn = new GridColumn();
|
||||
otherColumn.Name = otherColumn.FieldName = otherColumn.Caption = dcol.ColumnName;
|
||||
otherColumn.Visible = true;
|
||||
otherColumn.Width = 150;
|
||||
otherColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.CheckedList;
|
||||
this.gcMain.Columns.Add(otherColumn);
|
||||
}
|
||||
}
|
||||
// this.gcDetail.GridControl.DataSource = this.gridControl1.DataSourceTable().Clone();
|
||||
// //this.gcDetail.SelectAll();
|
||||
// //this.gcDetail.DeleteSelectedRows();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user