SVN r709
SVN-Revision: r709
This commit is contained in:
@@ -25,6 +25,10 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
public partial class LabelRemarkEdit : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 当 lasttext 为空(清空)时触发。
|
||||
/// </summary>
|
||||
public event EventHandler LastTextEmpty;
|
||||
/// <summary>
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
@@ -78,9 +82,22 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
|
||||
@@ -4237,6 +4237,12 @@ namespace Lskj.Control.Model
|
||||
if (model.FileUploadControl)
|
||||
{
|
||||
remarkEdit.BandAllowDrop();
|
||||
// 订阅事件:当 lasttext 被清空时做后续数据操作
|
||||
remarkEdit.LastTextEmpty += (s, e) =>
|
||||
{
|
||||
// TODO:执行你的数据库更新 / UI 刷新等
|
||||
HandleRemarkCleared(remarkEdit);
|
||||
};
|
||||
}
|
||||
break;
|
||||
case ControlType.LabMemoEdit:
|
||||
@@ -4558,7 +4564,33 @@ namespace Lskj.Control.Model
|
||||
this.mControlList.Add(model);
|
||||
return baseControl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 触发空值回调关联相关的列
|
||||
/// </summary>
|
||||
private void HandleRemarkCleared(LabelRemarkEdit labelRemarkEdit)
|
||||
{
|
||||
ControlModel modle = this.ControlModels.Where(n => n.LabelText.Equals("原文件名")).FirstOrDefault();
|
||||
ControlModel productidmodle = this.ControlModels.Where(n => n.LabelText.Equals("物料编码")).FirstOrDefault();
|
||||
ControlModel Vermodle = this.ControlModels.Where(n => n.LabelText.Equals("改前版次")).FirstOrDefault();
|
||||
ControlModel fileidmodle = this.ControlModels.Where(n => n.LabelText.Equals("原文件ID")).FirstOrDefault();
|
||||
if (modle != null && productidmodle!=null)
|
||||
{
|
||||
string updatename = labelRemarkEdit.EditText;
|
||||
BaseUserControl baseControl = FindControl(modle.FieldName);
|
||||
BaseUserControl productControl = FindControl(productidmodle.FieldName);
|
||||
BaseUserControl VerControl = FindControl(Vermodle.FieldName);
|
||||
BaseUserControl fileidControl = FindControl(fileidmodle.FieldName);
|
||||
DataRow dataRow = BaseImpl.GetDataRowResult($"EXEC dbo.p_GetMaxVersionByFileName N'{updatename}'");
|
||||
if (dataRow != null)
|
||||
{
|
||||
baseControl.EditText = dataRow["sname"] +"";
|
||||
VerControl.EditText = dataRow["Ver"] + "";
|
||||
fileidControl.EditText = dataRow["fileid"] + "";
|
||||
}
|
||||
// 手动触发关联,有可能单据打开后直接点击新增按钮此时文本框值未改变,不会触发关联和计算
|
||||
this.SetUnionAncCalcControl(labelRemarkEdit);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 限制數值框粘貼不能粘貼中文
|
||||
|
||||
Reference in New Issue
Block a user