SVN-Revision: r248
This commit is contained in:
tdx
2025-02-07 01:41:40 +00:00
parent ae64d4a772
commit 28712863d4
+31 -67
View File
@@ -1376,39 +1376,44 @@ namespace Lskj.Control
string condition = cond;
try
{
if (string.IsNullOrWhiteSpace(cond)) return true;//如果值是空格或者空行,默认正确
cond = ReplaceHelper.ReplaceRowParam(dataRow, cond);
if (cond.StartsWith("@") || cond.StartsWith("!"))
if (string.IsNullOrWhiteSpace(cond))
{
result = "1".Equals(BaseImpl.GetDefaultValue(cond));
}
else if (dataRow == null)
{
result = ReplaceHelper.EvalCond(cond);
result = true;//如果值是空格或者空行,默认正确
}
else
{
result = ReplaceHelper.ReplaceRowParamCond(dataRow, cond);
cond = ReplaceHelper.ReplaceRowParam(dataRow, cond);
if (cond.StartsWith("@") || cond.StartsWith("!"))
{
result = "1".Equals(BaseImpl.GetDefaultValue(cond));
}
else if (dataRow == null)
{
result = ReplaceHelper.EvalCond(cond);
}
else
{
result = ReplaceHelper.ReplaceRowParamCond(dataRow, cond);
}
}
return result;
}
catch (Exception ex)
{
string Tips = string.Empty;
if (!string.IsNullOrWhiteSpace(TableName) && !string.IsNullOrWhiteSpace(ColumnName))
{
Tips = string.Format("{0}表中{1}字段{2},判断条件失败\r\n", TableName, ColumnName, condition);
}
else
{
Tips = string.Format("条件为:{0}\r\n", condition);
}
//MessageUtil.Show("条件判断错误:\r\n" + Tips);
Tips = "条件判断错误:\r\n" + Tips;
string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips);
//string Tips = string.Empty;
//if (!string.IsNullOrWhiteSpace(TableName) && !string.IsNullOrWhiteSpace(ColumnName))
//{
// Tips = string.Format("{0}表中{1}字段{2},判断条件失败\r\n", TableName, ColumnName, condition);
//}
//else
//{
// Tips = string.Format("条件为:{0}\r\n", condition);
//}
//Tips = "条件判断错误:\r\n" + Tips;
//string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips);
////MessageUtil.Show("条件判断错误:\r\n" + Tips);
Console.WriteLine(ex.Message);
}
return result;
}
/// <summary>
/// <para>说明:检查按钮是否可用</para>
@@ -1421,7 +1426,7 @@ namespace Lskj.Control
/// </summary>
private void ValidateButtonState(DataRow rowItem, bool isValidation = true)
{
if (rowItem == null&& isValidation)
if (rowItem == null && isValidation)
{
return;
}
@@ -1484,10 +1489,7 @@ namespace Lskj.Control
}
catch (Exception ex)
{
}
}
/// <summary>
/// <para>说明:添加表格数据</para>
@@ -4129,7 +4131,7 @@ namespace Lskj.Control
{
LogUtil.WriteError("基础档案明细保存失败", ex);
}
IsApi: if (isExec)
IsApi: if (isExec)
{
this.SaveGridRecord();
if (OnSaveGridCallBack != null)
@@ -5060,42 +5062,4 @@ namespace Lskj.Control
int focusedRowHandle = this.gcMain.GridView.FocusedRowHandle;
GridColumn[] Columns = this.gcMain.GridView.GetSelectedCells(focusedRowHandle);//当前选中的单元格
//判断是否为最后一行,最后一列
if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.Count - 1 && focusedRowHandle == this.gcMain.GridView.RowCount - 1)
{
this.AddGridViewRecord();
}
//判断表格是否为空
if (this.gcMain.GridView.RowCount == 0)
{
this.AddGridViewRecord();
}
}
}
}
catch (Exception ex)
{
}
}
#endregion
/// <summary>
/// 切换时保存(作为明细页签被切换时)
/// </summary>
/// <returns></returns>
public bool SaveWhenSwitching()
{
this.SaveResults = false;
if (this.pl_buttom.Visible && this.btnSave.Visible && this.btnSave.Enabled)
{
this.SaveGridRecord(false);
}
return SaveResults;
}
}
}
if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.