SVN r803
SVN-Revision: r803
This commit is contained in:
@@ -1776,6 +1776,10 @@ namespace Lskj.Control
|
||||
{
|
||||
fieldValue = ReplaceHelper.ReplaceRowParam(Model.GetMaintabFocusedRow(), fieldValue);
|
||||
}
|
||||
//if (ParentControlObj != null)
|
||||
//{
|
||||
// fieldValue = ParentControlObj.ReplaceControlValue(fieldValue);
|
||||
//}
|
||||
//string fieldValue = BaseImpl.GetDefaultValue(model.DefaultValue, "", Model.OtherParams());
|
||||
string parentDefault = (model.DefaultValue + "").Replace("{", "").Replace("}", "");
|
||||
if (this.ParentGridEx != null && this.ParentGridEx.GridView.Columns.ColumnByName(parentDefault) != null)
|
||||
@@ -2691,12 +2695,12 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
// 检查是否保存主键字段
|
||||
if (row.RowState == DataRowState.Added && !insertFields.Contains(_parmaryKey) && !"ID".Equals(_parmaryKey, StringComparison.OrdinalIgnoreCase))
|
||||
if (row.RowState == DataRowState.Added && !insertFields.Contains($"[{(_parmaryKey)}]") && !"ID".Equals($"[{(_parmaryKey)}]", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// 跳过自动增长列处理
|
||||
if (Autogrowcolumn.ToLower() != _parmaryKey.ToLower())
|
||||
{
|
||||
insertFields += _parmaryKey + ",";
|
||||
insertFields += "[" + _parmaryKey + "],";
|
||||
insertValues += "N'" + row[_parmaryKey] + "',";
|
||||
}
|
||||
}
|
||||
@@ -4392,7 +4396,7 @@ namespace Lskj.Control
|
||||
{
|
||||
|
||||
}
|
||||
IsApi: if (isExec)
|
||||
IsApi: if (isExec)
|
||||
{
|
||||
this.SaveTreeRecord();
|
||||
if (OnSaveGridCallBack != null)
|
||||
@@ -4452,7 +4456,7 @@ namespace Lskj.Control
|
||||
{
|
||||
LogUtil.WriteError("基础档案明细保存失败", ex);
|
||||
}
|
||||
IsApi: if (isExec)
|
||||
IsApi: if (isExec)
|
||||
{
|
||||
this.SaveGridRecord();
|
||||
if (OnSaveGridCallBack != null)
|
||||
@@ -5552,4 +5556,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user