init lserp cs 5.0

This commit is contained in:
cyf
2026-07-10 15:25:05 +08:00
commit 90f3fda86a
3799 changed files with 976868 additions and 0 deletions
@@ -0,0 +1,290 @@
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 CommonLib.data;
using CommonLib;
using DevExpress.XtraGrid.Columns;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using System.Collections;
namespace Lskj.MyControl.LookUpAdd
{
public partial class FrmMain : FormBase
{
#region
/// <summary>
/// sql语句
/// </summary>
public string SQL { get; set; }
/// <summary>
/// 列集合
/// </summary>
public Dictionary<string, string> Columns { get; set; }
/// <summary>
/// 选择Value字段
/// </summary>
public string ValueField { get; set; }
/// <summary>
/// 选择Text字段
/// </summary>
public string TextField { get; set; }
/// <summary>
/// 是否多选
/// </summary>
public bool IsMultiple { get; set; }
/// <summary>
/// 窗体高度
/// </summary>
public int WinHeight { get; set; }
/// <summary>
/// 窗体宽度
/// </summary>
public int WinWidth { get; set; }
/// <summary>
/// 返回Value
/// </summary>
public string ReturnValue { get; set; }
/// <summary>
/// 返回Text
/// </summary>
public string ReturnText { get; set; }
/// <summary>
/// 窗体标题
/// </summary>
public string FrmTitle { get; set; }
#endregion
private IList<string> RText = new List<string>();
private IList<string> RValue = new List<string>();
public FrmMain()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (WinHeight > 0)
{
this.Height = WinHeight;
}
if (WinWidth > 0)
{
this.Width = WinWidth;
}
if (!string.IsNullOrEmpty(FrmTitle))
{
this.Text = FrmTitle;
}
if (!string.IsNullOrEmpty(ReturnText))
{
RText = ReturnText.Split(',').ToList();
}
if (!string.IsNullOrEmpty(ReturnValue))
{
RValue = ReturnValue.Split(',').ToList();
}
DataTable dt = SqlHelper.ExecuteDataSet(SQL).Tables[0];
//绑定列z
SetColumns(dt);
//绑定数据源
gridMain.DataSource = dt;
GridColumnCollection gc = new GridColumnCollection(null);
for (int i = 0; i < gvMain.Columns.Count; i++)
{
if (gvMain.Columns[i].Caption == "选择")
continue;
gc.Add(gvMain.Columns[i]);
}
cbSearch.DataSource = gc;
cbSearch.DisplayMember = "Caption";
cbSearch.ValueMember = "FieldName";
gvMain.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(gvMain_CustomDrawRowIndicator);
gvMain.RowCellClick += new RowCellClickEventHandler(gvMain_RowCellClick);
gvMain.IndicatorWidth = 35;
if (!IsMultiple)
{
int result = gvMain.LocateByValue(TextField, ReturnText, null);
if (result >= 0)
{
gvMain.SelectRow(result);
}
}
else
{
for (int i = 0; i < RText.Count; i++)
{
int result = gvMain.LocateByValue(TextField, RText[i], null);
if (result >= 0)
{
DataRow dr = gvMain.GetDataRow(result);
dr["Id"] = true;
dr.AcceptChanges();
}
}
}
}
/// <summary>
/// 生成行号
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void gvMain_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
{
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
if (e.Info.IsRowIndicator)
{
if (e.RowHandle >= 0)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
}
/// <summary>
/// 设置grid 列
/// </summary>
public void SetColumns(DataTable dt)
{
gvMain.Columns.Clear();
//if (IsMultiple)
//{
// DataColumn dc = new DataColumn()
// {
// Caption = "选择",
// DataType = typeof(bool),
// ColumnName = "Id",
// DefaultValue = false
// };
// dt.Columns.Add(dc);
// dt.AcceptChanges();
// GridColumn gridColumnCheckBox = new GridColumn();
// gridColumnCheckBox.FieldName = "Id";
// gridColumnCheckBox.Name = "Id";
// gridColumnCheckBox.Caption = "选择";
// gridColumnCheckBox.Width = 40;
// gridColumnCheckBox.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
// gridColumnCheckBox.Visible = true;
// gvMain.Columns.Add(gridColumnCheckBox);
//}
foreach (var col in Columns.Keys)
{
GridColumn gridColumn = new GridColumn();
gridColumn.FieldName = col;
gridColumn.Name = col;
gridColumn.Caption = Columns[col];
gridColumn.Width = 200;
gridColumn.Visible = true;
gridColumn.OptionsColumn.AllowEdit = false;
gridColumn.OptionsColumn.ReadOnly = false;
gvMain.Columns.Add(gridColumn);
gvMain.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
}
}
/// <summary>
/// 行点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void gvMain_RowCellClick(object sender, RowCellClickEventArgs e)
{
//if (IsMultiple)
//{
// DataRow row = gvMain.GetDataRow(e.RowHandle);
// string id = row["Id"] + "";
// if (id.IndexOf("true", StringComparison.OrdinalIgnoreCase) != -1)
// {
// row["Id"] = false;
// }
// else
// {
// row["Id"] = true;
// }
//}
}
/// <summary>
/// 搜索数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSearch_Click(object sender, EventArgs e)
{
string filedName = cbSearch.SelectedValue + "";
string filedText = txtKey.Text;
if (!string.IsNullOrEmpty(filedName))
{
string mysql = "select * from (" + SQL + ") as tab where " + filedName + " like '%" + filedText + "%' or dbo.p_getpy(" + filedName + ") like '%" + filedText + "%'";
DataTable dt = SqlHelper.ExecuteDataSet(mysql).Tables[0];
//SetColumns(dt);
gridMain.DataSource = dt;
}
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.No;
}
/// <summary>
/// 确定-关闭
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSave_Click(object sender, EventArgs e)
{
if (IsMultiple)
{
ReturnValue = "";
ReturnText = "";
DataTable dt = gridMain.DataSource as DataTable;
foreach (DataRow row in dt.Rows)
{
string msg = row["Id"] + "";
if (msg.IndexOf("true", StringComparison.OrdinalIgnoreCase) != -1)
{
ReturnValue += row[ValueField] + ",";
ReturnText += row[TextField] + ",";
}
}
}
else
{
int[] rows = gvMain.GetSelectedRows();
if (rows.Length > 0)
{
DataRow row = gvMain.GetDataRow(rows[0]);
ReturnValue += "'" + row[ValueField] + "',";
ReturnText += row[TextField] + ",";
}
}
if (!string.IsNullOrEmpty(ReturnValue))
{
ReturnValue = ReturnValue.Trim(',');
}
if (!string.IsNullOrEmpty(ReturnText))
{
ReturnText = ReturnText.Trim(',');
}
this.DialogResult = DialogResult.OK;
}
private void gvMain_RowCellStyle(object sender, RowStyleEventArgs e)
{
}
}
}
+209
View File
@@ -0,0 +1,209 @@
namespace Lskj.MyControl.LookUpAdd
{
partial class FrmMain
{
/// <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.panel1 = new System.Windows.Forms.Panel();
this.btnSearch = new DevExpress.XtraEditors.SimpleButton();
this.txtKey = new System.Windows.Forms.TextBox();
this.cbSearch = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.gridMain = new DevExpress.XtraGrid.GridControl();
this.gvMain = new DevExpress.XtraGrid.Views.Grid.GridView();
this.panel3 = new System.Windows.Forms.Panel();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
this.btnClose = new DevExpress.XtraEditors.SimpleButton();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridMain)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gvMain)).BeginInit();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.btnSearch);
this.panel1.Controls.Add(this.txtKey);
this.panel1.Controls.Add(this.cbSearch);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(549, 35);
this.panel1.TabIndex = 0;
//
// btnSearch
//
this.btnSearch.Location = new System.Drawing.Point(255, 6);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(64, 23);
this.btnSearch.TabIndex = 3;
this.btnSearch.Text = "查询";
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// txtKey
//
this.txtKey.Location = new System.Drawing.Point(125, 7);
this.txtKey.Name = "txtKey";
this.txtKey.Size = new System.Drawing.Size(127, 21);
this.txtKey.TabIndex = 2;
//
// cbSearch
//
this.cbSearch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbSearch.FormattingEnabled = true;
this.cbSearch.Location = new System.Drawing.Point(44, 7);
this.cbSearch.Name = "cbSearch";
this.cbSearch.Size = new System.Drawing.Size(78, 20);
this.cbSearch.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
this.label1.Text = "查询:";
//
// panel2
//
this.panel2.Controls.Add(this.gridMain);
this.panel2.Controls.Add(this.panel3);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 35);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(549, 347);
this.panel2.TabIndex = 1;
//
// gridMain
//
this.gridMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridMain.EmbeddedNavigator.Appearance.Options.UseTextOptions = true;
this.gridMain.EmbeddedNavigator.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.gridMain.EmbeddedNavigator.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
this.gridMain.Location = new System.Drawing.Point(0, 0);
this.gridMain.MainView = this.gvMain;
this.gridMain.Name = "gridMain";
this.gridMain.Size = new System.Drawing.Size(549, 307);
this.gridMain.TabIndex = 14;
this.gridMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.gvMain});
//
// gvMain
//
this.gvMain.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFullFocus;
this.gvMain.GridControl = this.gridMain;
this.gvMain.Name = "gvMain";
this.gvMain.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;
this.gvMain.OptionsFind.AlwaysVisible = true;
this.gvMain.OptionsSelection.EnableAppearanceFocusedCell = false;
this.gvMain.OptionsView.ShowGroupPanel = false;
//
// panel3
//
this.panel3.Controls.Add(this.simpleButton1);
this.panel3.Controls.Add(this.btnSave);
this.panel3.Controls.Add(this.btnClose);
this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel3.Location = new System.Drawing.Point(0, 307);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(549, 40);
this.panel3.TabIndex = 15;
//
// simpleButton1
//
this.simpleButton1.Location = new System.Drawing.Point(9, 8);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(64, 23);
this.simpleButton1.TabIndex = 4;
this.simpleButton1.Text = "添加";
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.Location = new System.Drawing.Point(404, 8);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(64, 24);
this.btnSave.TabIndex = 1;
this.btnSave.Text = "确定";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.Location = new System.Drawing.Point(475, 8);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(64, 24);
this.btnClose.TabIndex = 0;
this.btnClose.Text = "取消";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// FrmMain
//
this.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
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(549, 382);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.LookAndFeel.SkinName = "Office 2010 Blue";
this.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Office2003;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmMain";
this.Text = "选择";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridMain)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gvMain)).EndInit();
this.panel3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbSearch;
private System.Windows.Forms.TextBox txtKey;
private DevExpress.XtraEditors.SimpleButton btnSearch;
private DevExpress.XtraGrid.GridControl gridMain;
private DevExpress.XtraGrid.Views.Grid.GridView gvMain;
private System.Windows.Forms.Panel panel3;
private DevExpress.XtraEditors.SimpleButton btnClose;
private DevExpress.XtraEditors.SimpleButton btnSave;
private DevExpress.XtraEditors.SimpleButton simpleButton1;
}
}
@@ -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>
@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonLib;
namespace Lskj.MyControl.LookUpAdd {
public partial class LabelLookUpAdd : UserControl {
public LabelLookUpAdd() {
InitializeComponent();
}
[Description("是否多选")]
public bool IsMultiple { get; set; }
[Description("SQL语句")]
public string SQL { get; set; }
[Description("设置列")]
public Dictionary<string, string> Columns { get; set; }
[Description("设置Value")]
public string ValueField { get; set; }
[Description("设置TextFiled")]
public string TextField { get; set; }
[Description("设置Value值")]
public string ReturnValue { get; set; }
[Description("设置Text值")]
public string ReturnText { get; set; }
[Description("窗体高度")]
public int WinHeight { get; set; }
[Description("窗体宽度")]
public int WinWidth { get; set; }
private void btnMore_Click(object sender, EventArgs e) {
FrmMain frmMain = new FrmMain();
frmMain.IsMultiple = IsMultiple;
frmMain.SQL = SQL;
frmMain.Columns = Columns;
frmMain.ValueField = ValueField;
frmMain.TextField = TextField;
frmMain.WinHeight = WinHeight;
frmMain.WinWidth = WinWidth;
frmMain.ReturnValue = ReturnValue;
frmMain.ReturnText = ReturnText;
frmMain.ShowDialog();
//接受返回来值
Text = frmMain.ReturnText;
ReturnValue = frmMain.ReturnValue;
ReturnText = frmMain.ReturnText;
}
[Description("设置值")]
public override string Text {
get { return txtBox.Text; }
set {
txtBox.Text = value;
}
}
/// <summary>
/// 设置Value值
/// </summary>
/// <param name="ids"></param>
public void SetValueText(string ids) {
if (string.IsNullOrEmpty(ids))
return;
string sql2 = "select * from (" + SQL + ") as tab where " + ValueField + " in (" + ids + ")";
DataTable dt = SqlHelper.ExecuteDataSet(sql2).Tables[0];
string text = string.Empty;
foreach (DataRow row in dt.Rows) {
text += row[TextField] + ",";
}
this.Text = text.Trim(',');
ReturnText = text;
ReturnValue = ids;
}
public void SetTextValue(string ids)
{
if (string.IsNullOrEmpty(ids))
return;
string tmpIds = ids.Replace(",", "','");
tmpIds = "'" + tmpIds + "'";
string sql2 = "select * from (" + SQL + ") as tab where " + TextField + " in (" + tmpIds + ")";
DataTable dt = SqlHelper.ExecuteDataSet(sql2).Tables[0];
string text = string.Empty;
foreach (DataRow row in dt.Rows)
{
text += row[ValueField] + ",";
}
this.Text = ids;
ReturnText = ids;
ReturnValue = text;
}
private string labelText;
[Description("Label值")]
public string LabelText {
get { return labelText; }
set {
labelText = value;
lbMsg.Text = value;
pl_left.Width = lbMsg.Width + 7;
}
}
}
}
@@ -0,0 +1,140 @@
namespace Lskj.MyControl.LookUpAdd
{
partial class LabelLookUpAdd
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LabelLookUpAdd));
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.txtBox = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.btnMore = new DevExpress.XtraEditors.SimpleButton();
this.pl_left = new System.Windows.Forms.Panel();
this.lbMsg = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
this.panel2.SuspendLayout();
this.pl_left.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.panel3);
this.panel1.Controls.Add(this.panel2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(40, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(142, 21);
this.panel1.TabIndex = 3;
//
// panel3
//
this.panel3.Controls.Add(this.txtBox);
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 0);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(116, 21);
this.panel3.TabIndex = 1;
//
// txtBox
//
this.txtBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtBox.Location = new System.Drawing.Point(0, 0);
this.txtBox.Name = "txtBox";
this.txtBox.Size = new System.Drawing.Size(116, 21);
this.txtBox.TabIndex = 0;
//
// panel2
//
this.panel2.Controls.Add(this.btnMore);
this.panel2.Dock = System.Windows.Forms.DockStyle.Right;
this.panel2.Location = new System.Drawing.Point(116, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(26, 21);
this.panel2.TabIndex = 0;
//
// btnMore
//
this.btnMore.Appearance.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnMore.Appearance.Options.UseFont = true;
this.btnMore.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnMore.Image = ((System.Drawing.Image)(resources.GetObject("btnMore.Image")));
this.btnMore.Location = new System.Drawing.Point(0, 0);
this.btnMore.Name = "btnMore";
this.btnMore.Size = new System.Drawing.Size(26, 21);
this.btnMore.TabIndex = 1;
this.btnMore.Click += new System.EventHandler(this.btnMore_Click);
//
// pl_left
//
this.pl_left.Controls.Add(this.lbMsg);
this.pl_left.Dock = System.Windows.Forms.DockStyle.Left;
this.pl_left.Location = new System.Drawing.Point(0, 0);
this.pl_left.Name = "pl_left";
this.pl_left.Size = new System.Drawing.Size(40, 21);
this.pl_left.TabIndex = 2;
//
// lbMsg
//
this.lbMsg.AutoSize = true;
this.lbMsg.Location = new System.Drawing.Point(5, 4);
this.lbMsg.Name = "lbMsg";
this.lbMsg.Size = new System.Drawing.Size(29, 12);
this.lbMsg.TabIndex = 0;
this.lbMsg.Text = "名称";
//
// LabelLookUpAdd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel1);
this.Controls.Add(this.pl_left);
this.Name = "LabelLookUpAdd";
this.Size = new System.Drawing.Size(182, 21);
this.panel1.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel2.ResumeLayout(false);
this.pl_left.ResumeLayout(false);
this.pl_left.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel pl_left;
private System.Windows.Forms.Label lbMsg;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.TextBox txtBox;
private System.Windows.Forms.Panel panel2;
private DevExpress.XtraEditors.SimpleButton btnMore;
}
}
@@ -0,0 +1,140 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnMore.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAvdJREFUOE+lk2tI
k2EUx5+UZrs430kJ0sS0UEy/ZH3QkiJCCIKIgsAUu4hIqeGH0gIrUdSoNFNRUzQvoWSa19RcKs5r3lA0
r6lN837d1ubmu+3fsxVhffXDj+c8nPf8D+c8/5cAILuBzLUGlY2/d2O/5lpjpOgoK2sMKOvNEJGuNBHp
SGZISxJDmhOsSOMzK1Ifb0VqYoSkKkr4tykZL3Zjt5XfYdCpWa1iDAMFLiwhxGwH5jT+H2PeJEKGcqwB
wxYMmh5AlQvNwmO0vWIgTWTQ+NwKknghamOFqI4WouKJJWpibdiW9MOVxgYmgf4sKqDfAH5mAopYGDYi
oV8OhW4xFHpFFXSreWDnE7A9HQHNaADW286j8J6AVhKOSaA3XQSws9CvREC3cAeszA/aiUvQDntD038S
6m53qNpdoZQ6QdHgCPkne+SHmQS4JoHOFAYGdT8tuoqtoQt4G+aADH8OxWLHaYwp1/9gylng9Q0LkNaX
DHRrdVB1ncJoxWU0ZPjSnWjpWEq62EUajkCvaoZusxDsylNoZ4OxNeWD4XJ3upP9MtL0goF2JhtyiTOq
Yk9gaaIB+s1MOnsc2KUHtCCQFlyEatQDigE6Rp8d5N1ilEUK0JTIBJKaaEuoh2Iw9eE0ahPP0MZV2J69
Ba3MH5rJK1CNeUM5eBzyHkdsdNhgrdUGYyXWKH3IV+Tc5hJSfJ8PRWcIGlM9MdOXDs20D9QjXlANeULZ
fwybXU5Yb7XFSpMIyxIRFmsZ1MQIUPKIl5R3l0dIThAX8/V+qIxzoh5IgrLnIORfxNhot8Vq8wEsf7bE
Yp0A89V8/CjjYyyfj+Jwns5ZbGZXEEYFsgIErDTjLAY/BmO1wwPzdXzM0Y9ny/mQlfIx/Y6HySIuvuVz
MZ7NRW0UF9kh+6T0GYVvgukIpeEOkrSblkj2tUDyNSOcf0j5e/+dS/XjGM65mntRgb3Jvhyjo00+F1Js
KWKKPcWRcoTiRHGmuOzgkNFElD0mI+3mVzbW/gKNhWIUA1FMTwAAAABJRU5ErkJggg==
</value>
</data>
</root>