From 2b2d109132690feaf63f227aa4cc2b33e416ae75 Mon Sep 17 00:00:00 2001 From: cyf Date: Tue, 23 Jun 2026 09:17:23 +0000 Subject: [PATCH] SVN r1230 SVN-Revision: r1230 --- 插件库/Lskj.Control/AuditPanel2.cs | 8 +- 插件库/Lskj.Control/BaseUserControl.cs | 8 + 插件库/Lskj.Control/LabApiButtonEdit.cs | 419 ++++----- 插件库/Lskj.Control/LabelAutoGridLook.cs | 34 +- 插件库/Lskj.Control/LabelAutoTextEdit.cs | 33 +- 插件库/Lskj.Control/LabelAutoTextRevEdit.cs | 29 +- 插件库/Lskj.Control/LabelAutoTreeEdit.cs | 31 +- .../Lskj.Control/LabelBillSourceComboxEdit.cs | 35 +- 插件库/Lskj.Control/LabelBrowserEdit.cs | 416 ++++----- 插件库/Lskj.Control/LabelCalcEdit.cs | 38 +- 插件库/Lskj.Control/LabelCheckAutoTextEdit.cs | 33 +- 插件库/Lskj.Control/LabelCheckComboxEdit.cs | 33 +- 插件库/Lskj.Control/LabelCheckDateEdit.cs | 33 +- 插件库/Lskj.Control/LabelCheckEdit.cs | 220 +++-- .../LabelCheckMultiAutoTextEdit.cs | 33 +- 插件库/Lskj.Control/LabelCheckText.cs | 33 +- 插件库/Lskj.Control/LabelComboxEdit.cs | 39 +- .../Lskj.Control/LabelComboxMutilPopupEdit.cs | 38 +- 插件库/Lskj.Control/LabelComboxPopupEdit.cs | 35 + 插件库/Lskj.Control/LabelDateEdit.cs | 33 +- 插件库/Lskj.Control/LabelDateHalfDayEdit.cs | 37 +- 插件库/Lskj.Control/LabelGridSelectEdit.cs | 725 ++++++++-------- 插件库/Lskj.Control/LabelIntExtendEdit.cs | 38 +- 插件库/Lskj.Control/LabelMemoEdit.cs | 39 +- 插件库/Lskj.Control/LabelMemoSpaceEdit.cs | 406 +++++---- 插件库/Lskj.Control/LabelMultiAutoTextEdit.cs | 31 +- .../Lskj.Control/LabelMultiAutoTextEdit2.cs | 34 +- .../Lskj.Control/LabelMultiAutoTextEdit3.cs | 37 +- .../Lskj.Control/LabelMultiAutoTextEdit4.cs | 808 +++++++++--------- 插件库/Lskj.Control/LabelQQEdit.cs | 32 +- 插件库/Lskj.Control/LabelRemarkEdit.cs | 535 ++++++------ 插件库/Lskj.Control/LabelTextEdit.cs | 398 +++++---- 插件库/Lskj.Control/LabelWeigh.cs | 484 ++++++----- 插件库/Lskj.Control/Model/ControlModel.cs | 2 +- 插件库/Lskj.Control/Model/MyControl.cs | 40 +- 插件库/Lskj.Control/ModuleGridEx.cs | 6 + 36 files changed, 3147 insertions(+), 2086 deletions(-) diff --git a/插件库/Lskj.Control/AuditPanel2.cs b/插件库/Lskj.Control/AuditPanel2.cs index 0d7c7db..72242ac 100644 --- a/插件库/Lskj.Control/AuditPanel2.cs +++ b/插件库/Lskj.Control/AuditPanel2.cs @@ -1461,9 +1461,13 @@ namespace Lskj.Control { this.ControlObj.CanExecControl = false; this.ControlObj.SetAllControlValue(this._drBillInfoMsg); - this.SetColor(); + + this.ControlObj.CanExecControl = true; + + + // 必填字段 string RequiredFields = this.AuditModelObj.RequiredFields.Trim(','); if (!string.IsNullOrEmpty(RequiredFields)) @@ -1509,6 +1513,8 @@ namespace Lskj.Control string fieldName = dr["fieldName"] + ""; this.ControlObj.SetReadOnlyControl(fieldName, !billFields.Split(',').Contains(fieldName), false); } + this.SetColor(); + if (this.BillModelObj.HighlightChangeControl) this.ControlObj.ModifiedDefaultValueHighlight(this._drBillInfoMsg); } } #endregion diff --git a/插件库/Lskj.Control/BaseUserControl.cs b/插件库/Lskj.Control/BaseUserControl.cs index 30fee9d..205bff7 100644 --- a/插件库/Lskj.Control/BaseUserControl.cs +++ b/插件库/Lskj.Control/BaseUserControl.cs @@ -119,6 +119,14 @@ namespace Lskj.Control /// 控件背景颜色 /// public virtual Color BackgroundColor { get; set; } + /// + /// 控件前景色 + /// + public virtual Color ForeColor { get; set; } + /// + /// 控件内容是否加粗 + /// + public virtual bool ContentBold { get; set; } protected int GetCharWidth() diff --git a/插件库/Lskj.Control/LabApiButtonEdit.cs b/插件库/Lskj.Control/LabApiButtonEdit.cs index a32254c..c56e92c 100644 --- a/插件库/Lskj.Control/LabApiButtonEdit.cs +++ b/插件库/Lskj.Control/LabApiButtonEdit.cs @@ -1,194 +1,225 @@ -using DevExpress.XtraEditors; -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; - -namespace Lskj.Control -{ - public partial class LabApiButtonEdit : BaseUserControl - { - public LabApiButtonEdit() - { - InitializeComponent(); - txtEdit.ReadOnly = true; - btnMore.Click += OnBtnMoreClick; - } - /// - /// 获取数据 - /// - public event EventHandler OnRefreshDataCallBack; - /// - /// 文本控件 - /// - public TextEdit TextEdit - { - get - { - return txtEdit; - } - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - - this.plLeft.AutoSize = true; - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - - - - /// - /// 说明:格式化文本控件 - /// 创建人:王一帆 - /// 创建日期:2019-10-17 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The format string. - public void TextFormat(string formatString) - { - if (!string.IsNullOrWhiteSpace(formatString)) - { - this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数 - \ No newline at end of file +using DevExpress.XtraEditors; +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; + +namespace Lskj.Control +{ + public partial class LabApiButtonEdit : BaseUserControl + { + public LabApiButtonEdit() + { + InitializeComponent(); + txtEdit.ReadOnly = true; + btnMore.Click += OnBtnMoreClick; + } + /// + /// 获取数据 + /// + public event EventHandler OnRefreshDataCallBack; + /// + /// 文本控件 + /// + public TextEdit TextEdit + { + get + { + return txtEdit; + } + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + + this.plLeft.AutoSize = true; + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + + + + /// + /// 说明:格式化文本控件 + /// 创建人:王一帆 + /// 创建日期:2019-10-17 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The format string. + public void TextFormat(string formatString) + { + if (!string.IsNullOrWhiteSpace(formatString)) + { + this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数 + this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; + this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true; + } + } + /// + /// 点击按钮重新获取数据 + /// + /// + /// + private void OnBtnMoreClick(object sender, EventArgs e) + { + if (OnRefreshDataCallBack != null) + { + OnRefreshDataCallBack(this, e); + } + } + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelAutoGridLook.cs b/插件库/Lskj.Control/LabelAutoGridLook.cs index f0f6ba2..15f93e6 100644 --- a/插件库/Lskj.Control/LabelAutoGridLook.cs +++ b/插件库/Lskj.Control/LabelAutoGridLook.cs @@ -823,4 +823,36 @@ namespace Lskj.Control /// /// 说明:释放时清理数据源 /// 创建人:龚宇超 - /// 创建日期:2018-03-16

创建日期:2018-03-16
+ /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + private void OnLabelAutoGridLook_Disposed(object sender, EventArgs e) + { + if (this.DataSourceTable != null) + { + this.DataSourceTable.Clear(); + this.DataSourceTable.Dispose(); + } + if (this.DataSource != null) + { + this.DataSource = null; + } + GC.Collect(); + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelAutoTextEdit.cs b/插件库/Lskj.Control/LabelAutoTextEdit.cs index 43834a6..67fbcb7 100644 --- a/插件库/Lskj.Control/LabelAutoTextEdit.cs +++ b/插件库/Lskj.Control/LabelAutoTextEdit.cs @@ -366,4 +366,35 @@ namespace Lskj.Control string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.LabelText + "-添加", ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, "0", this.Model.AddModuleId).Split('~'); string[] menuArgs = { string.Format(ModuleArgs.PubAddArgs, ""), "0", "", AddModuleSpec, "默认分类", "", "", "", "", "" }; - string[] args = defaultArgs.C \ No newline at end of file + string[] args = defaultArgs.Concat(menuArgs).ToArray(); + + IForm form = FormHelper.LoadDllForm(ResourceDynamic.PubAdd, args); + DialogResult result = form.SubForm.ShowDialog(); + + //if (result == DialogResult.OK) + //{ + this.SetDataSource(MainImpl.GetDataTableResult(Model.SourceSql)); + //} + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelAutoTextRevEdit.cs b/插件库/Lskj.Control/LabelAutoTextRevEdit.cs index 05604a5..3d24c5d 100644 --- a/插件库/Lskj.Control/LabelAutoTextRevEdit.cs +++ b/插件库/Lskj.Control/LabelAutoTextRevEdit.cs @@ -311,4 +311,31 @@ namespace Lskj.Control if (!string.IsNullOrEmpty(this.Model.AddModuleSpec)) AddModuleSpec = this.Model.AddModuleSpec; // 固定传入参数(窗口标题、操作员ID、操作员名称、权限、模版编号) string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.LabelText + "-添加", ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, "0", this.Model.AddModuleId).Split('~'); - string[] menuArgs = { string.Format(ModuleArgs.PubAddArgs, ""), "0", " \ No newline at end of file + string[] menuArgs = { string.Format(ModuleArgs.PubAddArgs, ""), "0", "", AddModuleSpec, "默认分类", "", "", "", "", "" }; + string[] args = defaultArgs.Concat(menuArgs).ToArray(); + IForm form = FormHelper.LoadDllForm(ResourceDynamic.PubAdd, args); + DialogResult result = form.SubForm.ShowDialog(); + this.SetDataSource(MainImpl.GetDataTableResult(Model.SourceSql)); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + } + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelAutoTreeEdit.cs b/插件库/Lskj.Control/LabelAutoTreeEdit.cs index a6b6fbf..74e7000 100644 --- a/插件库/Lskj.Control/LabelAutoTreeEdit.cs +++ b/插件库/Lskj.Control/LabelAutoTreeEdit.cs @@ -275,4 +275,33 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 ///
- \ No newline at end of file + /// The source of the event. + /// The instance containing the event data. + protected void Popup_OnAddMouseClick(object sender, EventArgs e) + { + try + { + this.TextEdit.SetValue(); + this.TextEdit.HidePopup(); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelBillSourceComboxEdit.cs b/插件库/Lskj.Control/LabelBillSourceComboxEdit.cs index 05e73f4..1d299d3 100644 --- a/插件库/Lskj.Control/LabelBillSourceComboxEdit.cs +++ b/插件库/Lskj.Control/LabelBillSourceComboxEdit.cs @@ -354,4 +354,37 @@ namespace Lskj.Control string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.LabelText + "-添加", ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, "0", this.Model.AddModuleId).Split('~'); string[] menuArgs = { string.Format(ModuleArgs.PubAddArgs, ""), "0", "", AddModuleSpec, "默认分类", "", "", "", "", "" }; - string[] args = defaultArgs \ No newline at end of file + string[] args = defaultArgs.Concat(menuArgs).ToArray(); + + IForm form = FormHelper.LoadDllForm(ResourceDynamic.PubAdd, args); + DialogResult result = form.SubForm.ShowDialog(); + + //if (result == DialogResult.OK) + //{ + this.SetDataSource(MainImpl.GetDataTableResult(Model.SourceSql)); + //} + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelBrowserEdit.cs b/插件库/Lskj.Control/LabelBrowserEdit.cs index 6a7fe14..084bff8 100644 --- a/插件库/Lskj.Control/LabelBrowserEdit.cs +++ b/插件库/Lskj.Control/LabelBrowserEdit.cs @@ -1,192 +1,224 @@ -/****************************** -* 说明:自定义网站控件 -* 创建人:龚宇超 -* 创建日期:2017-08-07 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -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 DevExpress.XtraEditors; -using Lskj.Data; -using System.Diagnostics; -using Lskj.Business.Impl; - -namespace Lskj.Control -{ - /// - /// 自定义网站控件 - /// - public partial class LabelBrowserEdit : BaseUserControl - { - /// - /// 文本控件 - /// - public TextEdit TextEdit { get { return txtEdit; } } - - public LabelBrowserEdit() - { - InitializeComponent(); - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - /// - /// 说明: - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The source of the event. - /// The instance containing the event data. - private void picBrowser_Click(object sender, EventArgs e) - { - \ No newline at end of file +/****************************** +* 说明:自定义网站控件 +* 创建人:龚宇超 +* 创建日期:2017-08-07 +* 修改人: +* 修改日期: +* 修改备注: +* 版本:1.0.0.0 +******************************/ +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 DevExpress.XtraEditors; +using Lskj.Data; +using System.Diagnostics; +using Lskj.Business.Impl; + +namespace Lskj.Control +{ + /// + /// 自定义网站控件 + /// + public partial class LabelBrowserEdit : BaseUserControl + { + /// + /// 文本控件 + /// + public TextEdit TextEdit { get { return txtEdit; } } + + public LabelBrowserEdit() + { + InitializeComponent(); + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + /// + /// 说明: + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + private void picBrowser_Click(object sender, EventArgs e) + { + try + { + PictureBox pic = (PictureBox)sender; + string url = EditText; + if (string.IsNullOrEmpty(url)) + { + MessageUtil.Show(ResourceKeys.BrowserTip); + return; + } + Process.Start("iexplore.exe", url); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCalcEdit.cs b/插件库/Lskj.Control/LabelCalcEdit.cs index 77d88c8..3e08a06 100644 --- a/插件库/Lskj.Control/LabelCalcEdit.cs +++ b/插件库/Lskj.Control/LabelCalcEdit.cs @@ -152,4 +152,40 @@ namespace Lskj.Control { base.ReadOnly = value; this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelFor \ No newline at end of file + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckAutoTextEdit.cs b/插件库/Lskj.Control/LabelCheckAutoTextEdit.cs index 0210118..ba328f3 100644 --- a/插件库/Lskj.Control/LabelCheckAutoTextEdit.cs +++ b/插件库/Lskj.Control/LabelCheckAutoTextEdit.cs @@ -167,4 +167,35 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 /// - /// The sou \ No newline at end of file + /// The source of the event. + /// The instance containing the event data. + private void ckCheck_CheckedChanged(object sender, EventArgs e) + { + try + { + CheckEdit check = sender as CheckEdit; + TextEdit.Enabled = check.Checked; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckComboxEdit.cs b/插件库/Lskj.Control/LabelCheckComboxEdit.cs index f693f91..36cf0f8 100644 --- a/插件库/Lskj.Control/LabelCheckComboxEdit.cs +++ b/插件库/Lskj.Control/LabelCheckComboxEdit.cs @@ -150,4 +150,35 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 /// - /// The so \ No newline at end of file + /// The source of the event. + /// The instance containing the event data. + private void ckCheck_CheckedChanged(object sender, EventArgs e) + { + try + { + CheckEdit check = sender as CheckEdit; + TextEdit.Enabled = check.Checked; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckDateEdit.cs b/插件库/Lskj.Control/LabelCheckDateEdit.cs index 0d0586f..945b423 100644 --- a/插件库/Lskj.Control/LabelCheckDateEdit.cs +++ b/插件库/Lskj.Control/LabelCheckDateEdit.cs @@ -124,4 +124,35 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 /// - /// The sou \ No newline at end of file + /// The source of the event. + /// The instance containing the event data. + private void ckCheck_CheckedChanged(object sender, EventArgs e) + { + try + { + CheckEdit check = sender as CheckEdit; + TextEdit.Enabled = check.Checked; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckEdit.cs b/插件库/Lskj.Control/LabelCheckEdit.cs index c9471e8..19fa91d 100644 --- a/插件库/Lskj.Control/LabelCheckEdit.cs +++ b/插件库/Lskj.Control/LabelCheckEdit.cs @@ -1,92 +1,128 @@ -/****************************** -* 说明:自定义复选文本控件 -* 创建人:龚宇超 -* 创建日期:2017-08-07 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -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 DevExpress.XtraEditors; - -namespace Lskj.Control -{ - /// - /// 复选文本控件 - /// - public partial class LabelCheckEdit : BaseUserControl - { - public CheckEdit TextEdit { get { return this.checkEdt; } } - - public LabelCheckEdit() - { - InitializeComponent(); - } - - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The label text. - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.checkEdt.Text; - } - set - { - this.checkEdt.Text = value; - this.Width = checkEdt.Width + PaddingLeft; - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return string.IsNullOrWhiteSpace(checkEdt.EditValue + "") ? "0" : checkEdt.EditValue.ToString().ToLower() == "true" ? "1" : "0"; - } - set - { - string val = string.IsNullOrWhiteSpace(value) || "0".Equals(value) || "false".Equals(value, StringComparison.OrdinalIgnoreCase) ? "0" : "1"; - this.checkEdt.EditValue = Convert.ToBoolean(Convert.ToInt32(val)); - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.checkEdt.Properties.ReadOnly = value; - this.checkEdt.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.Defa \ No newline at end of file +/****************************** +* 说明:自定义复选文本控件 +* 创建人:龚宇超 +* 创建日期:2017-08-07 +* 修改人: +* 修改日期: +* 修改备注: +* 版本:1.0.0.0 +******************************/ +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 DevExpress.XtraEditors; + +namespace Lskj.Control +{ + /// + /// 复选文本控件 + /// + public partial class LabelCheckEdit : BaseUserControl + { + public CheckEdit TextEdit { get { return this.checkEdt; } } + + public LabelCheckEdit() + { + InitializeComponent(); + } + + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The label text. + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.checkEdt.Text; + } + set + { + this.checkEdt.Text = value; + this.Width = checkEdt.Width + PaddingLeft; + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return string.IsNullOrWhiteSpace(checkEdt.EditValue + "") ? "0" : checkEdt.EditValue.ToString().ToLower() == "true" ? "1" : "0"; + } + set + { + string val = string.IsNullOrWhiteSpace(value) || "0".Equals(value) || "false".Equals(value, StringComparison.OrdinalIgnoreCase) ? "0" : "1"; + this.checkEdt.EditValue = Convert.ToBoolean(Convert.ToInt32(val)); + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.checkEdt.Properties.ReadOnly = value; + this.checkEdt.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.checkEdt.ForeColor = base.RequiredLabelForceColor; + } + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckMultiAutoTextEdit.cs b/插件库/Lskj.Control/LabelCheckMultiAutoTextEdit.cs index fe9970a..6b1463a 100644 --- a/插件库/Lskj.Control/LabelCheckMultiAutoTextEdit.cs +++ b/插件库/Lskj.Control/LabelCheckMultiAutoTextEdit.cs @@ -155,4 +155,35 @@ namespace Lskj.Control /// 修改备注: /// 版本:1.0 /// - /// The source \ No newline at end of file + /// The source of the event. + /// The instance containing the event data. + private void ckCheck_CheckedChanged(object sender, EventArgs e) + { + try + { + CheckEdit check = sender as CheckEdit; + MultiAutoEdit.Enabled = check.Checked; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelCheckText.cs b/插件库/Lskj.Control/LabelCheckText.cs index f8fd18f..99e235a 100644 --- a/插件库/Lskj.Control/LabelCheckText.cs +++ b/插件库/Lskj.Control/LabelCheckText.cs @@ -150,4 +150,35 @@ namespace Lskj.Control /// 修改日期: /// 修改备注: /// 版本:1.0 - \ No newline at end of file + /// + /// The source of the event. + /// The instance containing the event data. + private void ckCheck_CheckedChanged(object sender, EventArgs e) + { + try + { + CheckEdit check = sender as CheckEdit; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelComboxEdit.cs b/插件库/Lskj.Control/LabelComboxEdit.cs index d9bd0c2..08fa06b 100644 --- a/插件库/Lskj.Control/LabelComboxEdit.cs +++ b/插件库/Lskj.Control/LabelComboxEdit.cs @@ -269,4 +269,41 @@ namespace Lskj.Control ComboBoxModel model = new ComboBoxModel { ValueMember = ValueField, - D \ No newline at end of file + DisplayMember = TextField, + RowItem = item + }; + this._sources.Add(model); + this.txtEdit.Properties.Items.Add(model); + } + } + catch (Exception) + { + + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + } + + /// + /// 前景颜色 + /// + /// The color of the required label. + public override Color ForeColor + { + get + { + return TextEdit.Propert \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelComboxMutilPopupEdit.cs b/插件库/Lskj.Control/LabelComboxMutilPopupEdit.cs index e7fe836..d273e32 100644 --- a/插件库/Lskj.Control/LabelComboxMutilPopupEdit.cs +++ b/插件库/Lskj.Control/LabelComboxMutilPopupEdit.cs @@ -233,4 +233,40 @@ namespace Lskj.Control } catch (Exception ex) { - string Message = ErrorMessage.PromptEr \ No newline at end of file + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + private void simpleButton4_Click(object sender, EventArgs e) + { + try + { + this.editValue = this.EditText = ""; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + public Control.Model.MyControl ControlObj { get; set; } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelComboxPopupEdit.cs b/插件库/Lskj.Control/LabelComboxPopupEdit.cs index 57461cb..6c97f4f 100644 --- a/插件库/Lskj.Control/LabelComboxPopupEdit.cs +++ b/插件库/Lskj.Control/LabelComboxPopupEdit.cs @@ -278,3 +278,38 @@ namespace Lskj.Control this.ShowPopup(); } catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + private void simpleButton4_Click(object sender, EventArgs e) + { + try + { + this.editValue = this.EditText = ""; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelDateEdit.cs b/插件库/Lskj.Control/LabelDateEdit.cs index db993e4..2b4dd32 100644 --- a/插件库/Lskj.Control/LabelDateEdit.cs +++ b/插件库/Lskj.Control/LabelDateEdit.cs @@ -212,4 +212,35 @@ namespace Lskj.Control if (!string.IsNullOrWhiteSpace(formatString)) { this.txtEdit.Properties.DisplayFormat.FormatString = this.txtEdit.Properties.EditFormat.FormatString = this.txtEdit.Properties.Mask.EditMask = formatString; - this.txtEdit.Properties.DisplayFormat.FormatType = this.txtEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatT \ No newline at end of file + this.txtEdit.Properties.DisplayFormat.FormatType = this.txtEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Custom; + } + + this.TextEdit.QueryPopUp += TextEdit_QueryPopUp; + + } + + private void TextEdit_QueryPopUp(object sender, CancelEventArgs e) + { + // 更改一个不相关的属性来触发更新(字体大小),刷新可以解决下拉框切换到年,月时,控件失去焦点后。再次打开布局错误的问题 + Font oldFont = TextEdit.Font; + TextEdit.Font = new Font(oldFont.Name, oldFont.Size + 1); + TextEdit.Font = oldFont; // 还原字体大小 + } + + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelDateHalfDayEdit.cs b/插件库/Lskj.Control/LabelDateHalfDayEdit.cs index c8f03f2..08bfed7 100644 --- a/插件库/Lskj.Control/LabelDateHalfDayEdit.cs +++ b/插件库/Lskj.Control/LabelDateHalfDayEdit.cs @@ -176,4 +176,39 @@ namespace Lskj.Control { this.popupControl.Size = this.specialDatePopup.Size; this.specialDatePopup.OwnerEdit = this.txtEdit; - this.specialDatePopup.SetValue(this \ No newline at end of file + this.specialDatePopup.SetValue(this.txtEdit.EditValue + ""); + } + + private void SpecialDatePopup_ConfirmClick(object sender, System.EventArgs e) + { + this.txtEdit.EditValue = this.specialDatePopup.SelectedValue; + this.txtEdit.ClosePopup(); + } + + private void SpecialDatePopup_ClearClick(object sender, System.EventArgs e) + { + this.txtEdit.EditValue = string.Empty; + this.txtEdit.ClosePopup(); + } + + private void SpecialDatePopup_CancelClick(object sender, System.EventArgs e) + { + this.txtEdit.ClosePopup(); + } + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelGridSelectEdit.cs b/插件库/Lskj.Control/LabelGridSelectEdit.cs index 0163c82..028ced4 100644 --- a/插件库/Lskj.Control/LabelGridSelectEdit.cs +++ b/插件库/Lskj.Control/LabelGridSelectEdit.cs @@ -1,345 +1,380 @@ -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 DevExpress.XtraEditors; -using Lskj.Control.Model; -using Lskj.Business.Impl; - -namespace Lskj.Control -{ - public partial class LabelGridSelectEdit : BaseUserControl - { - private string editValue; - /// - /// 文本控件 - /// - public TextEdit TextEdit { get { return txtEdit; } } - /// - /// 数据源 - /// - public DataTable table = new DataTable(); - public LabelGridSelectEdit() - { - InitializeComponent(); - - if (Business.Impl.LanguageTranslation.Translatable) - { - simpleButton1.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton1.Text); - simpleButton4.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton4.Text); - } - - } - /// - /// 隐藏值 - /// - /// The value. - public string EditValue - { - get - { - BaseUserControl control = null; - if (this.Model != null) control = ControlObj.FindControl(this.Model.FieldName); - if (this.Model != null && (this.Model.FieldType == ControlType.LabGridPopupValue || this.Model.FieldType == ControlType.LabGridPopupMutilValue)) - { - this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql)); - if (!string.IsNullOrEmpty(editValue)) - { - return editValue; - } - else - { - // 存在名称并且没有value值则 - if (control != null && !string.IsNullOrEmpty(control.EditText)) - { - if (table != null && table is DataTable) - { - String[] strRating = control.EditText.Split(','); - string textEditValue = string.Empty; - string textEditText = string.Empty; - foreach (string strrating in strRating) - { - DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + ""); - DataRow rowValueItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + ""); - if (rowItem != null) - { - textEditText += rowItem[this.Model.TextMember] + ""; - textEditValue += rowItem[this.Model.ValueMember] + ""; - } - else if (rowValueItem != null) - { - textEditText += rowItem[this.Model.TextMember] + ""; - textEditValue += rowItem[this.Model.ValueMember] + ""; - } - } - this.TextEdit.Text = textEditText.TrimEnd(','); - return textEditValue; - } - } - } - } - return null; - } - set - { - // this.Model.SourceSql = "select cltm as 编码,cltm 原纸条码 from WMS_BillOutUsedByPlanTab where #planlistid={planlistid}# and issn=1"; - this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql)); - if (this.table != null && this.table is DataTable) - { - if (!string.IsNullOrWhiteSpace(value)) - { - String[] strRating = value.Split(','); - string textEditValue = string.Empty; - string textEditText = string.Empty; - if (strRating.Length > 0) - { - foreach (string strrating in strRating) - { - if (!string.IsNullOrWhiteSpace(strrating)) - { - DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + ""); - if (rowItem != null) - { - textEditValue += rowItem[this.Model.ValueMember] + ","; - textEditText += rowItem[this.Model.TextMember] + ","; - - } - else - { - rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + ""); - if (rowItem != null) - { - textEditValue += rowItem[this.Model.ValueMember] + ","; - textEditText += rowItem[this.Model.TextMember] + ","; - } - else - { - - this.TextEdit.EditValue = string.Empty; - } - } - } - } - //if (!string.IsNullOrWhiteSpace(textEditText)) textEditText = textEditText.Remove(textEditText.LastIndexOf(","), 1); - //if (!string.IsNullOrWhiteSpace(editValue)) editValue = editValue.Remove(editValue.LastIndexOf(","), 1); - - this.TextEdit.Text = textEditText.TrimEnd(','); - this.editValue = textEditValue.TrimEnd(','); - this.TextEdit.SelectionStart = this.Text.Length; - } - } - else - { - this.TextEdit.EditValue = string.Empty; - } - } - else - { - this.TextEdit.EditValue = string.Empty; - } - } - - - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - this.simpleButton4.Width = this.simpleButton1.Width = this.Model.Size.Height + 10; - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.EditValue = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = true; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - /// - /// 说明:弹出框 - /// 创建人:龚宇超 - /// 创建日期:2019-01-10 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public void ShowPopup() - { - FrmGridSelectPopup popup = new FrmGridSelectPopup(this.Model, ControlObj,this.editValue,this.EditText); - DialogResult result = popup.ShowDialog(); - if (result == DialogResult.OK) - { - this.editValue = popup.ShowValue; - this.EditText = popup.ShowText; - } - else - { - this.editValue = this.EditText = ""; - } - } - /// - /// 说明: - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The source of the event. - /// The instance containing the event data. - private void txtEdit_Click(object sender, EventArgs e) - { - try - { - this.ShowPopup(); - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErrorMessage(ex); - MessageUtil.Show(Message,ex.Message); - } - - } - - private void simpleButton1_Click(object sender, EventArgs e) - { - try - { - this.ShowPopup(); - } - catch (Exception ex) - { - string Message = ErrorMessage.PromptErr \ No newline at end of file +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 DevExpress.XtraEditors; +using Lskj.Control.Model; +using Lskj.Business.Impl; + +namespace Lskj.Control +{ + public partial class LabelGridSelectEdit : BaseUserControl + { + private string editValue; + /// + /// 文本控件 + /// + public TextEdit TextEdit { get { return txtEdit; } } + /// + /// 数据源 + /// + public DataTable table = new DataTable(); + public LabelGridSelectEdit() + { + InitializeComponent(); + + if (Business.Impl.LanguageTranslation.Translatable) + { + simpleButton1.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton1.Text); + simpleButton4.Text = Business.Impl.LanguageTranslation.GetTranslatedText(simpleButton4.Text); + } + + } + /// + /// 隐藏值 + /// + /// The value. + public string EditValue + { + get + { + BaseUserControl control = null; + if (this.Model != null) control = ControlObj.FindControl(this.Model.FieldName); + if (this.Model != null && (this.Model.FieldType == ControlType.LabGridPopupValue || this.Model.FieldType == ControlType.LabGridPopupMutilValue)) + { + this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql)); + if (!string.IsNullOrEmpty(editValue)) + { + return editValue; + } + else + { + // 存在名称并且没有value值则 + if (control != null && !string.IsNullOrEmpty(control.EditText)) + { + if (table != null && table is DataTable) + { + String[] strRating = control.EditText.Split(','); + string textEditValue = string.Empty; + string textEditText = string.Empty; + foreach (string strrating in strRating) + { + DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + ""); + DataRow rowValueItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + ""); + if (rowItem != null) + { + textEditText += rowItem[this.Model.TextMember] + ""; + textEditValue += rowItem[this.Model.ValueMember] + ""; + } + else if (rowValueItem != null) + { + textEditText += rowItem[this.Model.TextMember] + ""; + textEditValue += rowItem[this.Model.ValueMember] + ""; + } + } + this.TextEdit.Text = textEditText.TrimEnd(','); + return textEditValue; + } + } + } + } + return null; + } + set + { + // this.Model.SourceSql = "select cltm as 编码,cltm 原纸条码 from WMS_BillOutUsedByPlanTab where #planlistid={planlistid}# and issn=1"; + this.table = BaseImpl.GetDataTableResult(ControlObj.ReplaceControlValue(this.Model.SourceSql)); + if (this.table != null && this.table is DataTable) + { + if (!string.IsNullOrWhiteSpace(value)) + { + String[] strRating = value.Split(','); + string textEditValue = string.Empty; + string textEditText = string.Empty; + if (strRating.Length > 0) + { + foreach (string strrating in strRating) + { + if (!string.IsNullOrWhiteSpace(strrating)) + { + DataRow rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.ValueMember] + ""); + if (rowItem != null) + { + textEditValue += rowItem[this.Model.ValueMember] + ","; + textEditText += rowItem[this.Model.TextMember] + ","; + + } + else + { + rowItem = table.Select("1=1").FirstOrDefault(x => strrating == x[this.Model.TextMember] + ""); + if (rowItem != null) + { + textEditValue += rowItem[this.Model.ValueMember] + ","; + textEditText += rowItem[this.Model.TextMember] + ","; + } + else + { + + this.TextEdit.EditValue = string.Empty; + } + } + } + } + //if (!string.IsNullOrWhiteSpace(textEditText)) textEditText = textEditText.Remove(textEditText.LastIndexOf(","), 1); + //if (!string.IsNullOrWhiteSpace(editValue)) editValue = editValue.Remove(editValue.LastIndexOf(","), 1); + + this.TextEdit.Text = textEditText.TrimEnd(','); + this.editValue = textEditValue.TrimEnd(','); + this.TextEdit.SelectionStart = this.Text.Length; + } + } + else + { + this.TextEdit.EditValue = string.Empty; + } + } + else + { + this.TextEdit.EditValue = string.Empty; + } + } + + + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + this.simpleButton4.Width = this.simpleButton1.Width = this.Model.Size.Height + 10; + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.EditValue = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = true; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + /// + /// 说明:弹出框 + /// 创建人:龚宇超 + /// 创建日期:2019-01-10 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public void ShowPopup() + { + FrmGridSelectPopup popup = new FrmGridSelectPopup(this.Model, ControlObj,this.editValue,this.EditText); + DialogResult result = popup.ShowDialog(); + if (result == DialogResult.OK) + { + this.editValue = popup.ShowValue; + this.EditText = popup.ShowText; + } + else + { + this.editValue = this.EditText = ""; + } + } + /// + /// 说明: + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + private void txtEdit_Click(object sender, EventArgs e) + { + try + { + this.ShowPopup(); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + private void simpleButton1_Click(object sender, EventArgs e) + { + try + { + this.ShowPopup(); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + private void simpleButton4_Click(object sender, EventArgs e) + { + try + { + this.EditText = this.editValue = ""; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + public Control.Model.MyControl ControlObj { get; set; } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelIntExtendEdit.cs b/插件库/Lskj.Control/LabelIntExtendEdit.cs index 97a89cb..1167291 100644 --- a/插件库/Lskj.Control/LabelIntExtendEdit.cs +++ b/插件库/Lskj.Control/LabelIntExtendEdit.cs @@ -227,4 +227,40 @@ namespace Lskj.Control { this.txtEdit.Text = (ReturnValue(this.txtEdit.Text) + 10) + ""; } - catch (E \ No newline at end of file + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + private void simpleButton6_Click(object sender, EventArgs e) + { + + try + { + this.txtEdit.Text = "0"; + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMemoEdit.cs b/插件库/Lskj.Control/LabelMemoEdit.cs index 335e44c..9cdd756 100644 --- a/插件库/Lskj.Control/LabelMemoEdit.cs +++ b/插件库/Lskj.Control/LabelMemoEdit.cs @@ -153,4 +153,41 @@ namespace Lskj.Control { base.ReadOnly = value; this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForce \ No newline at end of file + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMemoSpaceEdit.cs b/插件库/Lskj.Control/LabelMemoSpaceEdit.cs index f0b773d..bfd511e 100644 --- a/插件库/Lskj.Control/LabelMemoSpaceEdit.cs +++ b/插件库/Lskj.Control/LabelMemoSpaceEdit.cs @@ -1,188 +1,218 @@ -/****************************** -* 说明:自定义Memo控件(类似于dev [A] 控件) -* 创建人:龚宇超 -* 创建日期:2017-08-07 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -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 DevExpress.XtraEditors; -using Lskj.Business.Impl; - -namespace Lskj.Control -{ - /// - /// 自定义Memo控件 - /// - public partial class LabelMemoSpaceEdit : BaseUserControl - { - /// - /// 文本控件 - /// - public MemoExEdit TextEdit { get { return txtEdit; } } - - public LabelMemoSpaceEdit() - { - InitializeComponent(); - } - - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - // 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题 - return this.txtEdit.Text.Replace("'", "''"); - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - - /// - /// 说明:内容改变时判断是否存在\r\n存在则替换为逗号 - /// 创建人:龚宇超 - /// 创建日期:2019-06-12 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// + /// 自定义Memo控件 + /// + public partial class LabelMemoSpaceEdit : BaseUserControl + { + /// + /// 文本控件 + /// + public MemoExEdit TextEdit { get { return txtEdit; } } + + public LabelMemoSpaceEdit() + { + InitializeComponent(); + } + + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + // 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题 + return this.txtEdit.Text.Replace("'", "''"); + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + + /// + /// 说明:内容改变时判断是否存在\r\n存在则替换为逗号 + /// 创建人:龚宇超 + /// 创建日期:2019-06-12 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + void OnTxtEditEditValueChanged(object sender, EventArgs e) + { + try + { + this.EditText = txtEdit.Text.Replace("\r\n", ","); + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMultiAutoTextEdit.cs b/插件库/Lskj.Control/LabelMultiAutoTextEdit.cs index e3ea9d9..78d1ce3 100644 --- a/插件库/Lskj.Control/LabelMultiAutoTextEdit.cs +++ b/插件库/Lskj.Control/LabelMultiAutoTextEdit.cs @@ -430,4 +430,33 @@ namespace Lskj.Control DialogResult result = _lookUpForm.ShowDialog(); if (result == DialogResult.OK) { - string value = Model.FieldType == ControlType.LabMultiSelectValue || Model.FieldType == Cont \ No newline at end of file + string value = Model.FieldType == ControlType.LabMultiSelectValue || Model.FieldType == ControlType.LabMultiSelectValueNew || Model.FieldType == ControlType.LabCheckMultiSelectValue || Model.FieldType == ControlType.LabMultiSelectValueParam ? _lookUpForm.EditValue : _lookUpForm.EditText; + + this.EditValue = value; + this.TextEdit.Text = _lookUpForm.EditText; + } + } + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMultiAutoTextEdit2.cs b/插件库/Lskj.Control/LabelMultiAutoTextEdit2.cs index a424f6e..3da54ce 100644 --- a/插件库/Lskj.Control/LabelMultiAutoTextEdit2.cs +++ b/插件库/Lskj.Control/LabelMultiAutoTextEdit2.cs @@ -367,4 +367,36 @@ namespace Lskj.Control } _lookUpForm.InitControls(UnionModuleCodel); DialogResult result = _lookUpForm.ShowDialog(); - \ No newline at end of file + if (result == DialogResult.OK) + { + string value = Model.FieldType == ControlType.LabSelectReturnId ? _lookUpForm.EditValue : _lookUpForm.EditText; + + this.EditValue = value; + this.TextEdit.Text = _lookUpForm.EditText; + } + } + + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMultiAutoTextEdit3.cs b/插件库/Lskj.Control/LabelMultiAutoTextEdit3.cs index 726396b..39aeeae 100644 --- a/插件库/Lskj.Control/LabelMultiAutoTextEdit3.cs +++ b/插件库/Lskj.Control/LabelMultiAutoTextEdit3.cs @@ -249,4 +249,39 @@ namespace Lskj.Control if (this.ControlObj != null) { sqlValue = this.ControlObj.ReplaceControlValue(Model.SourceSql); - sqlValue = sqlVal \ No newline at end of file + sqlValue = sqlValue.Replace("#", ""); + + } + + DialogResult result = _lookUpForm.ShowDialog(); + if (result == DialogResult.OK) + { + this.TextEdit.Text = _lookUpForm.EditText; + } + + + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message,ex.Message); + } + + } + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelMultiAutoTextEdit4.cs b/插件库/Lskj.Control/LabelMultiAutoTextEdit4.cs index 841b2a3..6565c0e 100644 --- a/插件库/Lskj.Control/LabelMultiAutoTextEdit4.cs +++ b/插件库/Lskj.Control/LabelMultiAutoTextEdit4.cs @@ -1,388 +1,420 @@ -/****************************** -* 说明:自定义多选搜索框 -* 创建人:龚宇超 -* 创建日期:2017-08-08 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -using DevExpress.XtraEditors; -using Lskj.Business.Impl; -using Lskj.Control.Model; -using Lskj.Control.MultiModelLookUp; -using System; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Windows.Forms; - -namespace Lskj.Control -{ - /// - /// 自定义多选搜索框 - /// - public partial class LabelMultiAutoTextEdit4 : BaseUserControl - { - /// - /// The _look up form - /// - public FrmModelLookUp2 _lookUpForm = null; - /// - /// 绑定ValueMember - /// - public string ValueMember = string.Empty; - /// - /// 隐藏值字段 - /// - public string ValueField = string.Empty; - /// - /// 显示值字段 - /// - public string TextField = string.Empty; - /// - /// 备注字段 - /// - public string RemarkField = string.Empty; - /// - /// 数据源SQL - /// - public string SourceSQL = string.Empty; - /// - /// 隐藏值 - /// - //public string EditValue = string.Empty; - /// - /// The contro object - /// - public MyControl ControlObj; - /// - /// 文本 - /// - /// The label. - public Label Label { get { return lblText; } } - /// - /// 自动搜索框控件 - /// - public TextEdit TextEdit { get { return txtEdit; } } - /// - /// 配置的关联ModuleCodel值 - /// - /// The Union ModuleCodel. - public string UnionModuleCodel; - /// - /// 条件 - /// - public string SplicingConditions; - /// - ///模块选择返回框,是否单选模式 - /// - public bool IsRadio { get; set; } - /// - ///模块选择返回框,配置列加载模式(默认根据sql动态加载列) - /// - public bool ConfigureColumnMode { get; set; } - /// - /// 数据源 - /// - public DataTable DataSource; - /// - /// 显示text值(保存id,显示text值) - /// - public bool ModuleFrameDisplayText; - - - private string editValue; - - public LabelMultiAutoTextEdit4() - { - InitializeComponent(); - } - - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-08 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.EditValue = value; - if (ModuleFrameDisplayText) - { - if (!string.IsNullOrEmpty(value) && this.DataSource != null) - { - string[] values = value.Trim(',').Split(','); - string text = string.Empty; - foreach (string item in values) - { - DataRow rowItem = this.DataSource.Rows.Cast().FirstOrDefault(x => x[ValueMember] + "" == item); - if (rowItem != null) - { - text += rowItem[TextField] + ","; - } - } - this.txtEdit.Text = text.TrimEnd(','); - } - else - { - this.txtEdit.Text = ""; - } - } - else - { - this.TextEdit.Text = value.TrimEnd(','); - } - } - } - - - - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-08 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public string EditValue; - - - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-08 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - /// - /// 说明:需要单独验证是否修改 - /// 创建人:龚宇超 - /// 创建日期:2017-11-08 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// true if this instance is update; otherwise, false. - public override bool IsUpdate() - { - if (Model.FieldType == ControlType.LabMultiSelectValue || - Model.FieldType == ControlType.LabMultiSelectValueNew || - Model.FieldType == ControlType.LabMultiSelectValueParam) - { - return !this.Model.Text.Equals(this.EditValue, StringComparison.OrdinalIgnoreCase); - } - else - { - return base.IsUpdate(); - } - } - /// - /// 说明:设置数据源 - /// 创建人:龚宇超 - /// 创建日期:2017-08-08 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 数据源 - public void InitialFrame() - { - _lookUpForm = new FrmModelLookUp2(UnionModuleCodel, IsRadio); - _lookUpForm.ConfigureColumnMode = ConfigureColumnMode; - _lookUpForm.ValueField = ValueField; - _lookUpForm.ValueMember = ValueMember; - _lookUpForm.TextField = TextField; - //_lookUpForm.SourceSQL = SourceSQL; - //_lookUpForm.DataSource = dataSource; - } - /// - /// 说明:清空选中的值 - /// 创建人:龚宇超 - /// 创建日期:2018-08-24 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public void ClearSelectForm() - { - // _lookUpForm.ClearSelect(); - } - /// - /// 说明:打开界面 - /// 创建人:龚宇超 - /// 创建日期:2018-03-20 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The source of the event. - /// The instance containing the event data. - private void btnMore_Click(object sender, EventArgs e) - { - try - { - if (_lookUpForm != null) - { - if (_lookUpForm != null) - { - _lookUpForm.EditValue = this.EditValue; - _lookUpForm.IsType = Model.FieldType; - _lookUpForm.EditText = this.TextEdit.Text; - } - - string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions; - //sqlValue = _lookUpForm.SysModel.MenuSql.Replace("#", ""); - if (this.ControlObj != null) - { - sqlValue = this.ControlObj.ReplaceControlValue(sqlValue); - sqlValue = sqlValue.Replace("#", ""); - - //_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue); - } - _lookUpForm.NewSourceSQL = sqlValue; - _lookUpForm.AddModuleResult = Model.AddModuleResult; - _lookUpForm.InitControls(UnionModuleCodel); - DialogResult result = _lookUpForm.ShowDialog(); - if (result == DialogResult.OK) - { - string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText; - this.EditText = value; - //this.EditValue = value; - //this.TextEdit.Text = value; - ControlObj.ModuleResultDic.Clear(); - foreach (string resultKey in _lookUpForm.ModuleResultDic.Keys) - { - string resultValue = _lookUpForm.ModuleResultDic[resultKey]; - if (ControlObj.FindControl(resultKey) == null) - { - \ No newline at end of file +/****************************** +* 说明:自定义多选搜索框 +* 创建人:龚宇超 +* 创建日期:2017-08-08 +* 修改人: +* 修改日期: +* 修改备注: +* 版本:1.0.0.0 +******************************/ +using DevExpress.XtraEditors; +using Lskj.Business.Impl; +using Lskj.Control.Model; +using Lskj.Control.MultiModelLookUp; +using System; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; + +namespace Lskj.Control +{ + /// + /// 自定义多选搜索框 + /// + public partial class LabelMultiAutoTextEdit4 : BaseUserControl + { + /// + /// The _look up form + /// + public FrmModelLookUp2 _lookUpForm = null; + /// + /// 绑定ValueMember + /// + public string ValueMember = string.Empty; + /// + /// 隐藏值字段 + /// + public string ValueField = string.Empty; + /// + /// 显示值字段 + /// + public string TextField = string.Empty; + /// + /// 备注字段 + /// + public string RemarkField = string.Empty; + /// + /// 数据源SQL + /// + public string SourceSQL = string.Empty; + /// + /// 隐藏值 + /// + //public string EditValue = string.Empty; + /// + /// The contro object + /// + public MyControl ControlObj; + /// + /// 文本 + /// + /// The label. + public Label Label { get { return lblText; } } + /// + /// 自动搜索框控件 + /// + public TextEdit TextEdit { get { return txtEdit; } } + /// + /// 配置的关联ModuleCodel值 + /// + /// The Union ModuleCodel. + public string UnionModuleCodel; + /// + /// 条件 + /// + public string SplicingConditions; + /// + ///模块选择返回框,是否单选模式 + /// + public bool IsRadio { get; set; } + /// + ///模块选择返回框,配置列加载模式(默认根据sql动态加载列) + /// + public bool ConfigureColumnMode { get; set; } + /// + /// 数据源 + /// + public DataTable DataSource; + /// + /// 显示text值(保存id,显示text值) + /// + public bool ModuleFrameDisplayText; + + + private string editValue; + + public LabelMultiAutoTextEdit4() + { + InitializeComponent(); + } + + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-08 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.EditValue = value; + if (ModuleFrameDisplayText) + { + if (!string.IsNullOrEmpty(value) && this.DataSource != null) + { + string[] values = value.Trim(',').Split(','); + string text = string.Empty; + foreach (string item in values) + { + DataRow rowItem = this.DataSource.Rows.Cast().FirstOrDefault(x => x[ValueMember] + "" == item); + if (rowItem != null) + { + text += rowItem[TextField] + ","; + } + } + this.txtEdit.Text = text.TrimEnd(','); + } + else + { + this.txtEdit.Text = ""; + } + } + else + { + this.TextEdit.Text = value.TrimEnd(','); + } + } + } + + + + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-08 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public string EditValue; + + + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-08 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + /// + /// 说明:需要单独验证是否修改 + /// 创建人:龚宇超 + /// 创建日期:2017-11-08 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// true if this instance is update; otherwise, false. + public override bool IsUpdate() + { + if (Model.FieldType == ControlType.LabMultiSelectValue || + Model.FieldType == ControlType.LabMultiSelectValueNew || + Model.FieldType == ControlType.LabMultiSelectValueParam) + { + return !this.Model.Text.Equals(this.EditValue, StringComparison.OrdinalIgnoreCase); + } + else + { + return base.IsUpdate(); + } + } + /// + /// 说明:设置数据源 + /// 创建人:龚宇超 + /// 创建日期:2017-08-08 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 数据源 + public void InitialFrame() + { + _lookUpForm = new FrmModelLookUp2(UnionModuleCodel, IsRadio); + _lookUpForm.ConfigureColumnMode = ConfigureColumnMode; + _lookUpForm.ValueField = ValueField; + _lookUpForm.ValueMember = ValueMember; + _lookUpForm.TextField = TextField; + //_lookUpForm.SourceSQL = SourceSQL; + //_lookUpForm.DataSource = dataSource; + } + /// + /// 说明:清空选中的值 + /// 创建人:龚宇超 + /// 创建日期:2018-08-24 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public void ClearSelectForm() + { + // _lookUpForm.ClearSelect(); + } + /// + /// 说明:打开界面 + /// 创建人:龚宇超 + /// 创建日期:2018-03-20 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + private void btnMore_Click(object sender, EventArgs e) + { + try + { + if (_lookUpForm != null) + { + if (_lookUpForm != null) + { + _lookUpForm.EditValue = this.EditValue; + _lookUpForm.IsType = Model.FieldType; + _lookUpForm.EditText = this.TextEdit.Text; + } + + string sqlValue = _lookUpForm.SysModel.MenuSql + Model.SplicingConditions; + //sqlValue = _lookUpForm.SysModel.MenuSql.Replace("#", ""); + if (this.ControlObj != null) + { + sqlValue = this.ControlObj.ReplaceControlValue(sqlValue); + sqlValue = sqlValue.Replace("#", ""); + + //_lookUpForm.DataSource = MainImpl.GetDataTableResult(sqlValue); + } + _lookUpForm.NewSourceSQL = sqlValue; + _lookUpForm.AddModuleResult = Model.AddModuleResult; + _lookUpForm.InitControls(UnionModuleCodel); + DialogResult result = _lookUpForm.ShowDialog(); + if (result == DialogResult.OK) + { + string value = Model.FieldType == ControlType.LabSelectReturnIdNew ? _lookUpForm.EditValue : _lookUpForm.EditText; + this.EditText = value; + //this.EditValue = value; + //this.TextEdit.Text = value; + ControlObj.ModuleResultDic.Clear(); + foreach (string resultKey in _lookUpForm.ModuleResultDic.Keys) + { + string resultValue = _lookUpForm.ModuleResultDic[resultKey]; + if (ControlObj.FindControl(resultKey) == null) + { + ControlObj.ModuleResultDic.Add(resultKey, resultValue); + } + else + { + ControlObj.SetControlValue(resultKey, resultValue); + } + } + } + } + + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelQQEdit.cs b/插件库/Lskj.Control/LabelQQEdit.cs index 6803206..378f38d 100644 --- a/插件库/Lskj.Control/LabelQQEdit.cs +++ b/插件库/Lskj.Control/LabelQQEdit.cs @@ -196,4 +196,34 @@ namespace Lskj.Control MessageUtil.Show(ResourceKeys.QQTip); return; } - P \ No newline at end of file + Process p = new Process(); + ProcessStartInfo ps = new ProcessStartInfo(); + string Url = string.Format(@"tencent://message/?Menu=yes&uin={0}", EditText); + ps.FileName = @"iexplore.exe"; + ps.Arguments = Url; + ps.UseShellExecute = true; + ps.RedirectStandardInput = false; + p.StartInfo = ps; + p.Start(); + } + catch (Exception ex) + { + XtraMessageBox.Show(ResourceKeys.OpenQQError); + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } + \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelRemarkEdit.cs b/插件库/Lskj.Control/LabelRemarkEdit.cs index a2f7f54..a637e9b 100644 --- a/插件库/Lskj.Control/LabelRemarkEdit.cs +++ b/插件库/Lskj.Control/LabelRemarkEdit.cs @@ -1,249 +1,286 @@ -/****************************** -* 说明:自定义备注框 -* 创建人:龚宇超 -* 创建日期:2017-08-07 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -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 DevExpress.XtraEditors; -using System.IO; - -namespace Lskj.Control -{ - /// - /// 自定义备注框 - /// - public partial class LabelRemarkEdit : BaseUserControl - { - /// - /// 当 lasttext 为空(清空)时触发。 - /// - public event EventHandler LastTextEmpty; - /// - /// 文本控件 - /// - public MemoEdit TextEdit { get { return txtEdit; } } - /// - /// 存储文件地址(用于保存上传) - /// - public string filepath; - /// - /// 存储原文件名 - /// - public string lasttext; - /// - /// 是否变更新增 - /// - public bool changeAdd; - public LabelRemarkEdit() - { - InitializeComponent(); - } - public void BandAllowDrop() - { - txtEdit.AllowDrop = true; - txtEdit.DragEnter += OnDragEnter; - txtEdit.DragDrop += OnDragDrop; - } - /// - /// 拖拽完成触发 - /// - /// - /// - private void OnDragDrop(object sender, DragEventArgs e) - { - var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0]; - string filename = Path.GetFileName(file); - if (!string.IsNullOrEmpty(lasttext) && string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase)) - { - MessageUtil.Show("检测到更改文件和原文件完全一样!"); - } - else - { - string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase); - string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase); - if (!string.IsNullOrEmpty(lasttext) && !string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase)) - { - MessageUtil.Show("检测到更改文件和原文件不匹配!"); - } - else - { - txtEdit.Text = filename; - this.filepath = file; - OnLastTextEmpty(); - } - } - } - /// - /// 拖拽为空触发回调 - /// - protected virtual void OnLastTextEmpty() - { - LastTextEmpty?.Invoke(this, EventArgs.Empty); - } - /// - /// 取出最后一次出现 "-S" 之前的部分(不含扩展名) - /// - private static string GetPrefixBeforeLastS(string fileName, StringComparison comp) - { - if (string.IsNullOrEmpty(fileName)) return string.Empty; - - // 1) 去掉扩展名 - int dot = fileName.LastIndexOf('.'); - string noExt = dot >= 0 ? fileName.Substring(0, dot) : fileName; - - // 2) 找最后一次出现 "-S" - int pos = noExt.LastIndexOf("-S", comp); - return pos >= 0 ? noExt.Substring(0, pos) : noExt; - } - /// - /// 说明:移动到目标表格 - /// 创建人:龚宇超 - /// 创建日期:2017-11-13 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The source of the event. - /// The instance containing the event data. - protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop) && - ((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1) - e.Effect = DragDropEffects.Copy; - else - e.Effect = DragDropEffects.None; - } - - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - Graphics g = this.lblText.CreateGraphics(); - SizeF sizeF = g.MeasureString(value, this.lblText.Font); - this.plLeft.Width = (int)sizeF.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceCo \ No newline at end of file +/****************************** +* 说明:自定义备注框 +* 创建人:龚宇超 +* 创建日期:2017-08-07 +* 修改人: +* 修改日期: +* 修改备注: +* 版本:1.0.0.0 +******************************/ +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 DevExpress.XtraEditors; +using System.IO; + +namespace Lskj.Control +{ + /// + /// 自定义备注框 + /// + public partial class LabelRemarkEdit : BaseUserControl + { + /// + /// 当 lasttext 为空(清空)时触发。 + /// + public event EventHandler LastTextEmpty; + /// + /// 文本控件 + /// + public MemoEdit TextEdit { get { return txtEdit; } } + /// + /// 存储文件地址(用于保存上传) + /// + public string filepath; + /// + /// 存储原文件名 + /// + public string lasttext; + /// + /// 是否变更新增 + /// + public bool changeAdd; + public LabelRemarkEdit() + { + InitializeComponent(); + } + public void BandAllowDrop() + { + txtEdit.AllowDrop = true; + txtEdit.DragEnter += OnDragEnter; + txtEdit.DragDrop += OnDragDrop; + } + /// + /// 拖拽完成触发 + /// + /// + /// + private void OnDragDrop(object sender, DragEventArgs e) + { + var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0]; + string filename = Path.GetFileName(file); + if (!string.IsNullOrEmpty(lasttext) && string.Equals(lasttext, filename, StringComparison.OrdinalIgnoreCase)) + { + MessageUtil.Show("检测到更改文件和原文件完全一样!"); + } + else + { + string prefix1 = GetPrefixBeforeLastS(filename, StringComparison.OrdinalIgnoreCase); + string prefix2 = GetPrefixBeforeLastS(lasttext, StringComparison.OrdinalIgnoreCase); + if (!string.IsNullOrEmpty(lasttext) && !string.Equals(prefix1, prefix2, StringComparison.OrdinalIgnoreCase)) + { + MessageUtil.Show("检测到更改文件和原文件不匹配!"); + } + else + { + txtEdit.Text = filename; + this.filepath = file; + OnLastTextEmpty(); + } + } + } + /// + /// 拖拽为空触发回调 + /// + protected virtual void OnLastTextEmpty() + { + LastTextEmpty?.Invoke(this, EventArgs.Empty); + } + /// + /// 取出最后一次出现 "-S" 之前的部分(不含扩展名) + /// + private static string GetPrefixBeforeLastS(string fileName, StringComparison comp) + { + if (string.IsNullOrEmpty(fileName)) return string.Empty; + + // 1) 去掉扩展名 + int dot = fileName.LastIndexOf('.'); + string noExt = dot >= 0 ? fileName.Substring(0, dot) : fileName; + + // 2) 找最后一次出现 "-S" + int pos = noExt.LastIndexOf("-S", comp); + return pos >= 0 ? noExt.Substring(0, pos) : noExt; + } + /// + /// 说明:移动到目标表格 + /// 创建人:龚宇超 + /// 创建日期:2017-11-13 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The source of the event. + /// The instance containing the event data. + protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop) && + ((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1) + e.Effect = DragDropEffects.Copy; + else + e.Effect = DragDropEffects.None; + } + + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + Graphics g = this.lblText.CreateGraphics(); + SizeF sizeF = g.MeasureString(value, this.lblText.Font); + this.plLeft.Width = (int)sizeF.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelTextEdit.cs b/插件库/Lskj.Control/LabelTextEdit.cs index d439233..2c2fd44 100644 --- a/插件库/Lskj.Control/LabelTextEdit.cs +++ b/插件库/Lskj.Control/LabelTextEdit.cs @@ -1,186 +1,212 @@ -/****************************** -* 说明:自定义文本框控件 -* 创建人:龚宇超 -* 创建日期:2017-08-07 -* 修改人: -* 修改日期: -* 修改备注: -* 版本:1.0.0.0 -******************************/ -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 DevExpress.XtraEditors; -using DevExpress.XtraPrinting.Native; - -namespace Lskj.Control -{ - /// - /// 自定义文本框控件 - /// - public partial class LabelTextEdit : BaseUserControl - { - - /// - /// 文本控件 - /// - public TextEdit TextEdit { get { return txtEdit; } } - - public LabelTextEdit() - { - InitializeComponent(); - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - - this.plLeft.AutoSize = true; - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - /// - /// 说明:格式化文本控件 - /// 创建人:王一帆 - /// 创建日期:2019-10-17 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本: \ No newline at end of file +/****************************** +* 说明:自定义文本框控件 +* 创建人:龚宇超 +* 创建日期:2017-08-07 +* 修改人: +* 修改日期: +* 修改备注: +* 版本:1.0.0.0 +******************************/ +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 DevExpress.XtraEditors; +using DevExpress.XtraPrinting.Native; + +namespace Lskj.Control +{ + /// + /// 自定义文本框控件 + /// + public partial class LabelTextEdit : BaseUserControl + { + + /// + /// 文本控件 + /// + public TextEdit TextEdit { get { return txtEdit; } } + + public LabelTextEdit() + { + InitializeComponent(); + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + + this.plLeft.AutoSize = true; + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + /// + /// 说明:格式化文本控件 + /// 创建人:王一帆 + /// 创建日期:2019-10-17 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The format string. + public void TextFormat(string formatString) + { + if (!string.IsNullOrWhiteSpace(formatString)) + { + this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数 + this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; + this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true; + } + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/LabelWeigh.cs b/插件库/Lskj.Control/LabelWeigh.cs index 97ab015..e80dd1f 100644 --- a/插件库/Lskj.Control/LabelWeigh.cs +++ b/插件库/Lskj.Control/LabelWeigh.cs @@ -1,228 +1,256 @@ -using DevExpress.XtraEditors; -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; - -namespace Lskj.Control -{ - public partial class LabelWeigh : BaseUserControl - { - /// - /// 文本控件 - /// - public TextEdit TextEdit { get { return txtEdit; } } - /// - /// 按钮 - /// - public SimpleButton Button { get { return btnRefresh; } } - /// - ///接口地址 - /// - public string url; - /// - ///按钮点击 - /// - public event EventHandler ButtonClick; - public LabelWeigh() - { - InitializeComponent(); - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public override string LabelText - { - get - { - return this.lblText.Text; - } - set - { - this.lblText.Text = value; - if (FontSize > 0) - { - this.plLeft.Dock = DockStyle.Left; - this.plLeft.AutoSize = false; - this.lblText.AutoSize = false; - this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblText.Location = new System.Drawing.Point(0, 0); - this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txtEdit.Properties.AutoHeight = false; - this.plLeft.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plLeft.AutoSize = true; - this.plLeft.Width = this.lblText.Width + PaddingLeft; - } - } - } - /// - /// 说明:设置控件显示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 显示Lebel文本 - public string ButtonText - { - get - { - return this.btnRefresh.Text; - } - set - { - this.btnRefresh.Text = value; - if (FontSize > 0) - { - this.plRight.Dock = DockStyle.Right; - this.plRight.AutoSize = false; - this.btnRefresh.AutoSize = false; - this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnRefresh.Location = new System.Drawing.Point(0, 0); - this.txtEdit.Properties.AutoHeight = false; - this.plRight.Width = value.Length * GetCharWidth(); - - GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); - } - else - { - this.plRight.AutoSize = true; - this.plRight.Width = this.btnRefresh.Width; - } - } - } - /// - /// 字体大小 - /// - /// The size of the control. - public override float FontSize - { - get - { - return base.FontSize; - } - set - { - base.FontSize = value; - if (value > 0) - { - this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); - this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); - } - } - } - /// - /// 说明:设置控件值 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - public override string EditText - { - get - { - return this.txtEdit.Text; - } - set - { - this.txtEdit.Text = value; - } - } - /// - /// 说明:设置控件提示文本 - /// 创建人:龚宇超 - /// 创建日期:2017-08-07 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// 返回控件值 - public override string NullText - { - get - { - return this.txtEdit.Properties.NullValuePrompt; - } - set - { - if (!string.IsNullOrEmpty(value)) - { - this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; - this.TextEdit.Properties.NullValuePrompt = value; - } - base.NullText = value; - } - } - /// - /// 只读文本颜色 - /// - /// The color of the read only label. - public override bool ReadOnly - { - get - { - return base.ReadOnly; - } - set - { - base.ReadOnly = value; - this.txtEdit.Properties.ReadOnly = value; - this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; - } - } - /// - /// 必填文本颜色 - /// - /// The color of the required label. - public override bool Required - { - get - { - return base.Required; - } - set - { - base.Required = value; - if (value) - { - this.lblText.ForeColor = base.RequiredLabelForceColor; - } - } - } - /// - /// 说明:格式化文本控件 - /// 创建人:王一帆 - /// 创建日期:2019-10-17 - /// 修改人: - /// 修改日期: - /// 修改备注: - /// 版本:1.0 - /// - /// The format string. - public void TextFormat(string formatString) - { - if (!string.IsNullOrWhiteSpace(formatString)) - { - this.txtEdit.Properties.Mask.EditMask = "# \ No newline at end of file +using DevExpress.XtraEditors; +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; + +namespace Lskj.Control +{ + public partial class LabelWeigh : BaseUserControl + { + /// + /// 文本控件 + /// + public TextEdit TextEdit { get { return txtEdit; } } + /// + /// 按钮 + /// + public SimpleButton Button { get { return btnRefresh; } } + /// + ///接口地址 + /// + public string url; + /// + ///按钮点击 + /// + public event EventHandler ButtonClick; + public LabelWeigh() + { + InitializeComponent(); + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public override string LabelText + { + get + { + return this.lblText.Text; + } + set + { + this.lblText.Text = value; + if (FontSize > 0) + { + this.plLeft.Dock = DockStyle.Left; + this.plLeft.AutoSize = false; + this.lblText.AutoSize = false; + this.lblText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblText.Location = new System.Drawing.Point(0, 0); + this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txtEdit.Properties.AutoHeight = false; + this.plLeft.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plLeft.AutoSize = true; + this.plLeft.Width = this.lblText.Width + PaddingLeft; + } + } + } + /// + /// 说明:设置控件显示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 显示Lebel文本 + public string ButtonText + { + get + { + return this.btnRefresh.Text; + } + set + { + this.btnRefresh.Text = value; + if (FontSize > 0) + { + this.plRight.Dock = DockStyle.Right; + this.plRight.AutoSize = false; + this.btnRefresh.AutoSize = false; + this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnRefresh.Location = new System.Drawing.Point(0, 0); + this.txtEdit.Properties.AutoHeight = false; + this.plRight.Width = value.Length * GetCharWidth(); + + GetCharWidthMultilingual(this.lblText, this.lblText.Text, this.plLeft); + } + else + { + this.plRight.AutoSize = true; + this.plRight.Width = this.btnRefresh.Width; + } + } + } + /// + /// 字体大小 + /// + /// The size of the control. + public override float FontSize + { + get + { + return base.FontSize; + } + set + { + base.FontSize = value; + if (value > 0) + { + this.lblText.Font = new Font(this.lblText.Font.FontFamily, value); + this.TextEdit.Font = new Font(this.TextEdit.Font.FontFamily, value); + } + } + } + /// + /// 说明:设置控件值 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + public override string EditText + { + get + { + return this.txtEdit.Text; + } + set + { + this.txtEdit.Text = value; + } + } + /// + /// 说明:设置控件提示文本 + /// 创建人:龚宇超 + /// 创建日期:2017-08-07 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// 返回控件值 + public override string NullText + { + get + { + return this.txtEdit.Properties.NullValuePrompt; + } + set + { + if (!string.IsNullOrEmpty(value)) + { + this.TextEdit.Properties.NullValuePromptShowForEmptyValue = true; + this.TextEdit.Properties.NullValuePrompt = value; + } + base.NullText = value; + } + } + /// + /// 只读文本颜色 + /// + /// The color of the read only label. + public override bool ReadOnly + { + get + { + return base.ReadOnly; + } + set + { + base.ReadOnly = value; + this.txtEdit.Properties.ReadOnly = value; + this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor; + } + } + /// + /// 必填文本颜色 + /// + /// The color of the required label. + public override bool Required + { + get + { + return base.Required; + } + set + { + base.Required = value; + if (value) + { + this.lblText.ForeColor = base.RequiredLabelForceColor; + } + } + } + /// + /// 说明:格式化文本控件 + /// 创建人:王一帆 + /// 创建日期:2019-10-17 + /// 修改人: + /// 修改日期: + /// 修改备注: + /// 版本:1.0 + /// + /// The format string. + public void TextFormat(string formatString) + { + if (!string.IsNullOrWhiteSpace(formatString)) + { + this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数 + this.txtEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; + this.txtEdit.Properties.Mask.UseMaskAsDisplayFormat = true; + } + } + /// + /// 按钮点击 + /// + /// + /// + private void btnRefresh_Click(object sender, EventArgs e) + { + if (ButtonClick != null) ButtonClick(this, e); + } + + /// + /// 背景颜色 + /// + /// The color of the required label. + public override Color BackgroundColor + { + get + { + return TextEdit.Properties.Appearance.BackColor; + } + set + { + TextEdit.Properties.Appearance.BackColor = value; + } \ No newline at end of file diff --git a/插件库/Lskj.Control/Model/ControlModel.cs b/插件库/Lskj.Control/Model/ControlModel.cs index b4bd073..2183585 100644 --- a/插件库/Lskj.Control/Model/ControlModel.cs +++ b/插件库/Lskj.Control/Model/ControlModel.cs @@ -70,7 +70,7 @@ namespace Lskj.Control.Model /// true if this instance is copy; otherwise, false. public bool CanCopy { get; set; } /// - /// Gets or sets a value indicating whether this instance is readonly. 只读 + /// Gets or sets a value indicating whether this instance is readonly. 是否只读 /// /// true if this instance is read only; otherwise, false. public bool ReadOnly { get; set; } diff --git a/插件库/Lskj.Control/Model/MyControl.cs b/插件库/Lskj.Control/Model/MyControl.cs index 1ee826a..c935b0d 100644 --- a/插件库/Lskj.Control/Model/MyControl.cs +++ b/插件库/Lskj.Control/Model/MyControl.cs @@ -6391,4 +6391,42 @@ namespace Lskj.Control.Model /// public void SetBackgroundColor(string controlName) { - \ No newline at end of file + try + { + BaseUserControl baseControl = FindControl(controlName); + + if (baseControl == null) return; + baseControl.BackgroundColor = ColorTranslator.FromHtml("#00FF00"); + } + catch (Exception ex) + { + + } + } + + /// + /// 修改默认值后,突出显示颜色 + /// + /// + public void ModifiedDefaultValueHighlight(DataRow rowItem) + { + try + { + if (rowItem == null) return; + foreach (ControlModel model in this.ControlModels) + { + if (rowItem.Table.Columns.Contains(model.FieldName)&&!string.IsNullOrWhiteSpace(model.DefaultValue)) + { + string DefaultValue = ReplaceHelper.ReplaceUserInfo(model.DefaultValue); + if (!DefaultValue.Equals(rowItem[model.FieldName] + "")) + { + BaseUserControl baseControl = FindControl(model.FieldName); + if (baseControl == null) continue; + if (!model.ReadOnly) + { + baseControl.ForeColor = ColorTranslator.FromHtml("#FF0000"); + baseControl.ContentBold = true; + } + //else + //{ + \ No newline at end of file diff --git a/插件库/Lskj.Control/ModuleGridEx.cs b/插件库/Lskj.Control/ModuleGridEx.cs index 4da7e8a..5c29eca 100644 --- a/插件库/Lskj.Control/ModuleGridEx.cs +++ b/插件库/Lskj.Control/ModuleGridEx.cs @@ -3812,6 +3812,12 @@ namespace Lskj.Control this.gcMain.MultiplePrimary = parmaryKey; //合计是否只显示行数 this.gcMain.TotalQuantity = this.SysModel.TotalQuantity; + //判断是否禁用排序 + if (!string.IsNullOrWhiteSpace(this.SysModel.HeaderSortCriteria)) + { + this.gcMain.GridView.OptionsCustomization.AllowSort = ValidateCond(this.SysModel.HeaderSortCriteria, null); + } + // 常用工具 this.InitializeCommonTool(); if (SysModel.isLeftRightMode) this.pl_top_right.Visible = false;