SVN r1230
SVN-Revision: r1230
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -119,6 +119,14 @@ namespace Lskj.Control
|
||||
/// 控件背景颜色
|
||||
/// </summary>
|
||||
public virtual Color BackgroundColor { get; set; }
|
||||
/// <summary>
|
||||
/// 控件前景色
|
||||
/// </summary>
|
||||
public virtual Color ForeColor { get; set; }
|
||||
/// <summary>
|
||||
/// 控件内容是否加粗
|
||||
/// </summary>
|
||||
public virtual bool ContentBold { get; set; }
|
||||
|
||||
|
||||
protected int GetCharWidth()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
public event EventHandler OnRefreshDataCallBack;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtEdit;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "##########" + (formatString == "#" ? "0" : formatString);//#代表位数
|
||||
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
public event EventHandler OnRefreshDataCallBack;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtEdit;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击按钮重新获取数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnMoreClick(object sender, EventArgs e)
|
||||
{
|
||||
if (OnRefreshDataCallBack != null)
|
||||
{
|
||||
OnRefreshDataCallBack(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -823,4 +823,36 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// <para>说明:释放时清理数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-16 </p
|
||||
/// <para>创建日期:2018-03-16 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -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
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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", "
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -275,4 +275,33 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -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
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义网站控件
|
||||
/// </summary>
|
||||
public partial class LabelBrowserEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelBrowserEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
private void picBrowser_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
/******************************
|
||||
* 说明:自定义网站控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期: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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义网站控件
|
||||
/// </summary>
|
||||
public partial class LabelBrowserEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelBrowserEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -152,4 +152,40 @@ namespace Lskj.Control
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelFor
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -167,4 +167,35 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sou
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -150,4 +150,35 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The so
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -124,4 +124,35 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The sou
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选文本控件
|
||||
/// </summary>
|
||||
public partial class LabelCheckEdit : BaseUserControl
|
||||
{
|
||||
public CheckEdit TextEdit { get { return this.checkEdt; } }
|
||||
|
||||
public LabelCheckEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <value>The label text.</value>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkEdt.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.checkEdt.Text = value;
|
||||
this.Width = checkEdt.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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
|
||||
/******************************
|
||||
* 说明:自定义复选文本控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期: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
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选文本控件
|
||||
/// </summary>
|
||||
public partial class LabelCheckEdit : BaseUserControl
|
||||
{
|
||||
public CheckEdit TextEdit { get { return this.checkEdt; } }
|
||||
|
||||
public LabelCheckEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <value>The label text.</value>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
public override string LabelText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checkEdt.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.checkEdt.Text = value;
|
||||
this.Width = checkEdt.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.checkEdt.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -155,4 +155,35 @@ namespace Lskj.Control
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -150,4 +150,35 @@ namespace Lskj.Control
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -269,4 +269,41 @@ namespace Lskj.Control
|
||||
ComboBoxModel model = new ComboBoxModel
|
||||
{
|
||||
ValueMember = ValueField,
|
||||
D
|
||||
DisplayMember = TextField,
|
||||
RowItem = item
|
||||
};
|
||||
this._sources.Add(model);
|
||||
this.txtEdit.Properties.Items.Add(model);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Propert
|
||||
@@ -233,4 +233,40 @@ namespace Lskj.Control
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptEr
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
|
||||
@@ -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
|
||||
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; // 还原字体大小
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -176,4 +176,39 @@ namespace Lskj.Control
|
||||
{
|
||||
this.popupControl.Size = this.specialDatePopup.Size;
|
||||
this.specialDatePopup.OwnerEdit = this.txtEdit;
|
||||
this.specialDatePopup.SetValue(this
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
/// <value>The value.</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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:弹出框</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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 = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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
|
||||
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;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
/// <value>The value.</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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.EditValue = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:弹出框</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-01-10 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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 = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -227,4 +227,40 @@ namespace Lskj.Control
|
||||
{
|
||||
this.txtEdit.Text = (ReturnValue(this.txtEdit.Text) + 10) + "";
|
||||
}
|
||||
catch (E
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -153,4 +153,41 @@ namespace Lskj.Control
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForce
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义Memo控件
|
||||
/// </summary>
|
||||
public partial class LabelMemoSpaceEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoExEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelMemoSpaceEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
// 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题
|
||||
return this.txtEdit.Text.Replace("'", "''");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:内容改变时判断是否存在\r\n存在则替换为逗号</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-06-12 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summa
|
||||
/******************************
|
||||
* 说明:自定义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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义Memo控件
|
||||
/// </summary>
|
||||
public partial class LabelMemoSpaceEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoExEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelMemoSpaceEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
// 替换Memo编辑框中的单引号 避免保存sql语句出现引号丢失问题
|
||||
return this.txtEdit.Text.Replace("'", "''");
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:内容改变时判断是否存在\r\n存在则替换为逗号</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2019-06-12 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -430,4 +430,33 @@ namespace Lskj.Control
|
||||
DialogResult result = _lookUpForm.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string value = Model.FieldType == ControlType.LabMultiSelectValue || Model.FieldType == Cont
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -367,4 +367,36 @@ namespace Lskj.Control
|
||||
}
|
||||
_lookUpForm.InitControls(UnionModuleCodel);
|
||||
DialogResult result = _lookUpForm.ShowDialog();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -249,4 +249,39 @@ namespace Lskj.Control
|
||||
if (this.ControlObj != null)
|
||||
{
|
||||
sqlValue = this.ControlObj.ReplaceControlValue(Model.SourceSql);
|
||||
sqlValue = sqlVal
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义多选搜索框
|
||||
/// </summary>
|
||||
public partial class LabelMultiAutoTextEdit4 : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
public FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField = string.Empty;
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField = string.Empty;
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = string.Empty;
|
||||
/// <summary>
|
||||
/// 数据源SQL
|
||||
/// </summary>
|
||||
public string SourceSQL = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
//public string EditValue = string.Empty;
|
||||
/// <summary>
|
||||
/// The contro object
|
||||
/// </summary>
|
||||
public MyControl ControlObj;
|
||||
/// <summary>
|
||||
/// 文本
|
||||
/// </summary>
|
||||
/// <value>The label.</value>
|
||||
public Label Label { get { return lblText; } }
|
||||
/// <summary>
|
||||
/// 自动搜索框控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 配置的关联ModuleCodel值
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable DataSource;
|
||||
/// <summary>
|
||||
/// 显示text值(保存id,显示text值)
|
||||
/// </summary>
|
||||
public bool ModuleFrameDisplayText;
|
||||
|
||||
|
||||
private string editValue;
|
||||
|
||||
public LabelMultiAutoTextEdit4()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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<DataRow>().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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditValue;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:需要单独验证是否修改</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance is update; otherwise, <c>false</c>.</returns>
|
||||
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();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ClearSelectForm()
|
||||
{
|
||||
// _lookUpForm.ClearSelect();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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)
|
||||
{
|
||||
|
||||
/******************************
|
||||
* 说明:自定义多选搜索框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期: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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义多选搜索框
|
||||
/// </summary>
|
||||
public partial class LabelMultiAutoTextEdit4 : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The _look up form
|
||||
/// </summary>
|
||||
public FrmModelLookUp2 _lookUpForm = null;
|
||||
/// <summary>
|
||||
/// 绑定ValueMember
|
||||
/// </summary>
|
||||
public string ValueMember = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值字段
|
||||
/// </summary>
|
||||
public string ValueField = string.Empty;
|
||||
/// <summary>
|
||||
/// 显示值字段
|
||||
/// </summary>
|
||||
public string TextField = string.Empty;
|
||||
/// <summary>
|
||||
/// 备注字段
|
||||
/// </summary>
|
||||
public string RemarkField = string.Empty;
|
||||
/// <summary>
|
||||
/// 数据源SQL
|
||||
/// </summary>
|
||||
public string SourceSQL = string.Empty;
|
||||
/// <summary>
|
||||
/// 隐藏值
|
||||
/// </summary>
|
||||
//public string EditValue = string.Empty;
|
||||
/// <summary>
|
||||
/// The contro object
|
||||
/// </summary>
|
||||
public MyControl ControlObj;
|
||||
/// <summary>
|
||||
/// 文本
|
||||
/// </summary>
|
||||
/// <value>The label.</value>
|
||||
public Label Label { get { return lblText; } }
|
||||
/// <summary>
|
||||
/// 自动搜索框控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 配置的关联ModuleCodel值
|
||||
/// </summary>
|
||||
/// <value>The Union ModuleCodel.</value>
|
||||
public string UnionModuleCodel;
|
||||
/// <summary>
|
||||
/// 条件
|
||||
/// </summary>
|
||||
public string SplicingConditions;
|
||||
/// <summary>
|
||||
///模块选择返回框,是否单选模式
|
||||
/// </summary>
|
||||
public bool IsRadio { get; set; }
|
||||
/// <summary>
|
||||
///模块选择返回框,配置列加载模式(默认根据sql动态加载列)
|
||||
/// </summary>
|
||||
public bool ConfigureColumnMode { get; set; }
|
||||
/// <summary>
|
||||
/// 数据源
|
||||
/// </summary>
|
||||
public DataTable DataSource;
|
||||
/// <summary>
|
||||
/// 显示text值(保存id,显示text值)
|
||||
/// </summary>
|
||||
public bool ModuleFrameDisplayText;
|
||||
|
||||
|
||||
private string editValue;
|
||||
|
||||
public LabelMultiAutoTextEdit4()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
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<DataRow>().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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public string EditValue;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:需要单独验证是否修改</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance is update; otherwise, <c>false</c>.</returns>
|
||||
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();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置数据源</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-08 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="dataSource">数据源</param>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:清空选中的值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-08-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void ClearSelectForm()
|
||||
{
|
||||
// _lookUpForm.ClearSelect();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:打开界面</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-03-20 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -196,4 +196,34 @@ namespace Lskj.Control
|
||||
MessageUtil.Show(ResourceKeys.QQTip);
|
||||
return;
|
||||
}
|
||||
P
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
|
||||
+286
-249
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义备注框
|
||||
/// </summary>
|
||||
public partial class LabelRemarkEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 当 lasttext 为空(清空)时触发。
|
||||
/// </summary>
|
||||
public event EventHandler LastTextEmpty;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
/// <summary>
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
/// <summary>
|
||||
/// 是否变更新增
|
||||
/// </summary>
|
||||
public bool changeAdd;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void BandAllowDrop()
|
||||
{
|
||||
txtEdit.AllowDrop = true;
|
||||
txtEdit.DragEnter += OnDragEnter;
|
||||
txtEdit.DragDrop += OnDragDrop;
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽完成触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽为空触发回调
|
||||
/// </summary>
|
||||
protected virtual void OnLastTextEmpty()
|
||||
{
|
||||
LastTextEmpty?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
/// <summary>
|
||||
/// 取出最后一次出现 "-S" 之前的部分(不含扩展名)
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:移动到目标表格</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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
|
||||
/******************************
|
||||
* 说明:自定义备注框
|
||||
* 创建人:龚宇超
|
||||
* 创建日期: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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义备注框
|
||||
/// </summary>
|
||||
public partial class LabelRemarkEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 当 lasttext 为空(清空)时触发。
|
||||
/// </summary>
|
||||
public event EventHandler LastTextEmpty;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
/// <summary>
|
||||
/// 存储原文件名
|
||||
/// </summary>
|
||||
public string lasttext;
|
||||
/// <summary>
|
||||
/// 是否变更新增
|
||||
/// </summary>
|
||||
public bool changeAdd;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void BandAllowDrop()
|
||||
{
|
||||
txtEdit.AllowDrop = true;
|
||||
txtEdit.DragEnter += OnDragEnter;
|
||||
txtEdit.DragDrop += OnDragDrop;
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽完成触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽为空触发回调
|
||||
/// </summary>
|
||||
protected virtual void OnLastTextEmpty()
|
||||
{
|
||||
LastTextEmpty?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
/// <summary>
|
||||
/// 取出最后一次出现 "-S" 之前的部分(不含扩展名)
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:移动到目标表格</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
+212
-186
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义文本框控件
|
||||
/// </summary>
|
||||
public partial class LabelTextEdit : BaseUserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelTextEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:
|
||||
/******************************
|
||||
* 说明:自定义文本框控件
|
||||
* 创建人:龚宇超
|
||||
* 创建日期: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
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义文本框控件
|
||||
/// </summary>
|
||||
public partial class LabelTextEdit : BaseUserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
public LabelTextEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
+256
-228
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
public SimpleButton Button { get { return btnRefresh; } }
|
||||
/// <summary>
|
||||
///接口地址
|
||||
/// </summary>
|
||||
public string url;
|
||||
/// <summary>
|
||||
///按钮点击
|
||||
/// </summary>
|
||||
public event EventHandler ButtonClick;
|
||||
public LabelWeigh()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
public void TextFormat(string formatString)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(formatString))
|
||||
{
|
||||
this.txtEdit.Properties.Mask.EditMask = "#
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public TextEdit TextEdit { get { return txtEdit; } }
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
public SimpleButton Button { get { return btnRefresh; } }
|
||||
/// <summary>
|
||||
///接口地址
|
||||
/// </summary>
|
||||
public string url;
|
||||
/// <summary>
|
||||
///按钮点击
|
||||
/// </summary>
|
||||
public event EventHandler ButtonClick;
|
||||
public LabelWeigh()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">显示Lebel文本</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 字体大小
|
||||
/// </summary>
|
||||
/// <value>The size of the control.</value>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public override string EditText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txtEdit.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txtEdit.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件提示文本</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-08-07 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <returns>返回控件值</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:格式化文本控件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2019-10-17</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="formatString">The format string.</param>
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ButtonClick != null) ButtonClick(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 背景颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override Color BackgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return TextEdit.Properties.Appearance.BackColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
TextEdit.Properties.Appearance.BackColor = value;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace Lskj.Control.Model
|
||||
/// <value><c>true</c> if this instance is copy; otherwise, <c>false</c>.</value>
|
||||
public bool CanCopy { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is readonly. 只读
|
||||
/// Gets or sets a value indicating whether this instance is readonly. 是否只读
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is read only; otherwise, <c>false</c>.</value>
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
@@ -6391,4 +6391,42 @@ namespace Lskj.Control.Model
|
||||
/// <param name="controlName"></param>
|
||||
public void SetBackgroundColor(string controlName)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
BaseUserControl baseControl = FindControl(controlName);
|
||||
|
||||
if (baseControl == null) return;
|
||||
baseControl.BackgroundColor = ColorTranslator.FromHtml("#00FF00");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改默认值后,突出显示颜色
|
||||
/// </summary>
|
||||
/// <param name="controlName"></param>
|
||||
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
|
||||
//{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user