diff --git a/插件库/Lskj.Control/ModuleGridEx.cs b/插件库/Lskj.Control/ModuleGridEx.cs index a789e4f..ee7b79f 100644 --- a/插件库/Lskj.Control/ModuleGridEx.cs +++ b/插件库/Lskj.Control/ModuleGridEx.cs @@ -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; - } /// /// 说明:检查按钮是否可用 @@ -1421,7 +1426,7 @@ namespace Lskj.Control /// 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) { - - } - } /// /// 说明:添加表格数据 @@ -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 - - /// - /// 切换时保存(作为明细页签被切换时) - /// - /// - 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. \ No newline at end of file