SVN-Revision: r823
This commit is contained in:
cyf
2025-07-01 09:39:16 +00:00
parent 6d619955c6
commit ed0b4e5195
7 changed files with 137 additions and 20 deletions
+44 -3
View File
@@ -192,6 +192,10 @@ namespace Lskj.Control
/// 拖拽模式
/// </summary>
public bool isDrag = false;
/// <summary>
/// 是否保存成功(Lskj.PubBillSpecial点击保存后,先执行右上方表格保存)
/// </summary>
public bool isSuccessfullySaved;
#endregion
#region public set property
@@ -214,6 +218,11 @@ namespace Lskj.Control
get { return this.TipsPanel; }
}
public SimpleButton BtnSave
{
get { return this.btnSave; }
}
/// <summary>
/// 搜索界面
/// </summary>
@@ -519,8 +528,8 @@ namespace Lskj.Control
this.SearchObj.InitDefaultSearchControl(table, this.pl_top_fix_search, false);
else
this.SearchObj.InitDefaultSearchControl(table, this.pl_top_fix_search);
//固定条件不显示的话,隐藏上方。(只显示表格)
if (!this.pl_top_fix_search.Visible)
//固定条件不显示,隐藏上方。(只显示表格)
if (SystemInfo.Instance.HideFixedConditions)
{
this.pl_top.Visible = false;
}
@@ -2568,6 +2577,7 @@ namespace Lskj.Control
public void SaveGridRecord(bool isErrorTips = true)
{
this.SaveResults = false;
this.isSuccessfullySaved = false;
string tableName = this.SysModel.MenuTable;
string Autogrowcolumn = BaseImpl.GetResult(string.Format("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{0}' AND COLUMNPROPERTY(OBJECT_ID('{0}'),COLUMN_NAME,'IsIdentity')=1", tableName)) + "";
DataTable DatabasePropertySheet = BaseImpl.GetDataTableResult(string.Format("select COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH from information_schema.columns where table_name = '{0}'", tableName));//数据库属性表
@@ -2769,6 +2779,7 @@ namespace Lskj.Control
else
{
this.SaveResults = true;
this.isSuccessfullySaved = true;
(gcMain.GridControl.DataSource as DataTable).AcceptChanges();
if (this.SearchObj != null)
{
@@ -4351,6 +4362,7 @@ namespace Lskj.Control
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void OnSaveClick(object sender, EventArgs e)
{
this.isSuccessfullySaved = false;
if (this.GridControlObj.CustomGroupBandEx != null)//保存前若存在虚拟多表头则反写修改
{
this.GridControlObj.callbackUpdData();
@@ -4386,6 +4398,7 @@ namespace Lskj.Control
int result = this.GridControlObj.AdapterObj.Update(treeList.TreeListObj.DataSource as DataTable);
if (result > 0)
{
this.isSuccessfullySaved = true;
isExec = false;
MessageUtil.Show(ResourceKeys.SaveSuccess);
if (OnSaveGridCallBack != null)
@@ -4443,6 +4456,7 @@ namespace Lskj.Control
int result = this.GridControlObj.AdapterObj.Update(this.gcMain.GridControl.DataSource as DataTable);
if (result > 0)
{
this.isSuccessfullySaved = true;
isExec = false;
MessageUtil.Show(ResourceKeys.SaveSuccess);
if (this.SearchObj != null)
@@ -5561,4 +5575,31 @@ namespace Lskj.Control
// 获取字体和最大宽度
Document document = richEdit.Document;
Font font = richEdit.Font;
int maxWidth = richEdit.ClientSize.Width - richEdit.Padding.Horizontal;
// 获取前3行文本
string[] lines = richEdit.Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
int lineCount = Math.Min(4, lines.Length);
string firstThreeLines = string.Join(Environment.NewLine, lines.Take(lineCount));
// 创建StringFormat
StringFormat format = new StringFormat(StringFormat.GenericTypographic);
format.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
// 测量文本高度
using (Graphics g = richEdit.CreateGraphics())
{
SizeF textSize = g.MeasureString(
firstThreeLines,
font,
maxWidth,
format
);
return (int)Math.Ceiling(textSize.Height);
}
}
}
}