SVN r248
SVN-Revision: r248
This commit is contained in:
@@ -1376,39 +1376,44 @@ namespace Lskj.Control
|
|||||||
string condition = cond;
|
string condition = cond;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(cond)) return true;//如果值是空格或者空行,默认正确
|
if (string.IsNullOrWhiteSpace(cond))
|
||||||
cond = ReplaceHelper.ReplaceRowParam(dataRow, cond);
|
|
||||||
if (cond.StartsWith("@") || cond.StartsWith("!"))
|
|
||||||
{
|
{
|
||||||
result = "1".Equals(BaseImpl.GetDefaultValue(cond));
|
result = true;//如果值是空格或者空行,默认正确
|
||||||
}
|
|
||||||
else if (dataRow == null)
|
|
||||||
{
|
|
||||||
result = ReplaceHelper.EvalCond(cond);
|
|
||||||
}
|
}
|
||||||
else
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
string Tips = string.Empty;
|
//string Tips = string.Empty;
|
||||||
if (!string.IsNullOrWhiteSpace(TableName) && !string.IsNullOrWhiteSpace(ColumnName))
|
//if (!string.IsNullOrWhiteSpace(TableName) && !string.IsNullOrWhiteSpace(ColumnName))
|
||||||
{
|
//{
|
||||||
Tips = string.Format("{0}表中{1}字段{2},判断条件失败\r\n", TableName, ColumnName, condition);
|
// Tips = string.Format("{0}表中{1}字段{2},判断条件失败\r\n", TableName, ColumnName, condition);
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
Tips = string.Format("条件为:{0}\r\n", condition);
|
// Tips = string.Format("条件为:{0}\r\n", condition);
|
||||||
}
|
//}
|
||||||
//MessageUtil.Show("条件判断错误:\r\n" + Tips);
|
//Tips = "条件判断错误:\r\n" + Tips;
|
||||||
Tips = "条件判断错误:\r\n" + Tips;
|
//string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips);
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex, "", Tips);
|
////MessageUtil.Show("条件判断错误:\r\n" + Tips);
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:检查按钮是否可用</para>
|
/// <para>说明:检查按钮是否可用</para>
|
||||||
@@ -1421,7 +1426,7 @@ namespace Lskj.Control
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void ValidateButtonState(DataRow rowItem, bool isValidation = true)
|
private void ValidateButtonState(DataRow rowItem, bool isValidation = true)
|
||||||
{
|
{
|
||||||
if (rowItem == null&& isValidation)
|
if (rowItem == null && isValidation)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1484,10 +1489,7 @@ namespace Lskj.Control
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:添加表格数据</para>
|
/// <para>说明:添加表格数据</para>
|
||||||
@@ -4129,7 +4131,7 @@ namespace Lskj.Control
|
|||||||
{
|
{
|
||||||
LogUtil.WriteError("基础档案明细保存失败", ex);
|
LogUtil.WriteError("基础档案明细保存失败", ex);
|
||||||
}
|
}
|
||||||
IsApi: if (isExec)
|
IsApi: if (isExec)
|
||||||
{
|
{
|
||||||
this.SaveGridRecord();
|
this.SaveGridRecord();
|
||||||
if (OnSaveGridCallBack != null)
|
if (OnSaveGridCallBack != null)
|
||||||
@@ -5060,42 +5062,4 @@ namespace Lskj.Control
|
|||||||
int focusedRowHandle = this.gcMain.GridView.FocusedRowHandle;
|
int focusedRowHandle = this.gcMain.GridView.FocusedRowHandle;
|
||||||
GridColumn[] Columns = this.gcMain.GridView.GetSelectedCells(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)
|
if (Columns.Length > 0 && Columns[0].VisibleIndex == this.gcMain.GridView.Columns.
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user