SVN r290
SVN-Revision: r290
This commit is contained in:
@@ -51,6 +51,7 @@ using DevExpress.XtraPrinting.BarCode.Native;
|
||||
using Spire.Barcode;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
@@ -1073,7 +1074,7 @@ namespace Lskj.Control
|
||||
foreach (GridColumnModel item in mControlList)
|
||||
{
|
||||
if (this.DisableFieldSources && item.isVislble) continue;
|
||||
if(ControlType.IsNotLoadData(item.FieldType)) continue;
|
||||
if (ControlType.IsNotLoadData(item.FieldType)) continue;
|
||||
if (!string.IsNullOrWhiteSpace(item.SqlSource))
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
@@ -1795,8 +1796,8 @@ namespace Lskj.Control
|
||||
calcExpr = ReplaceHelper.ReplaceRowParam(rowItem, calcExpr);
|
||||
//EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + ""
|
||||
|
||||
|
||||
result = EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr)) + "";
|
||||
object evalResult = EvalHelper.Eval2(ReplaceHelper.ReplaceEvalCond(calcExpr));
|
||||
result = JsonConvert.SerializeObject(evalResult);
|
||||
|
||||
|
||||
if (result.Contains("E") || result.Contains("e"))
|
||||
@@ -1940,17 +1941,22 @@ namespace Lskj.Control
|
||||
public void UpperChange(GridColumnModel model, GridColumnModel gridModel, int RowHandle)
|
||||
{
|
||||
DataTable Table = this.gridControl.DataSourceTable();
|
||||
DataRow rowItem = Table.Rows[RowHandle];
|
||||
DataRow rowItem = this.GridView.GetDataRow(RowHandle);
|
||||
string UpperFieldName = ReplaceHelper.GetParamFields(gridModel.DefaultValue)[0];
|
||||
UpperFieldName = UpperFieldName.Replace("}", "").Replace("{", "");
|
||||
UpperFieldName = UpperFieldName.Substring(UpperFieldName.IndexOf('_') + 1);
|
||||
if (string.IsNullOrWhiteSpace(rowItem[gridModel.FieldName] + "") || this.gridView.FocusedRowHandle != RowHandle)
|
||||
{
|
||||
if (RowHandle != 0 && Table.Columns.Contains(ERPInfo.Instance.isAddRows))
|
||||
if (Table.Rows.Count > 0 && Table.Columns.Contains(ERPInfo.Instance.isAddRows))
|
||||
{
|
||||
DataRow lastRow = Table.Rows[Table.Rows.Count - 1];
|
||||
if (RowHandle > 0)
|
||||
{
|
||||
lastRow = Table.Rows[RowHandle - 1];
|
||||
}
|
||||
if (rowItem[ERPInfo.Instance.isAddRows] + "" != "1")
|
||||
{
|
||||
rowItem[gridModel.FieldName] = gridModel.DefaultValue.StartsWith("@") ? BaseImpl.GetDefaultValue(ReplaceHelper.ReplaceParamToValue(gridModel.DefaultValue, Table.Rows[RowHandle - 1][UpperFieldName] + "")) : rowItem[gridModel.FieldName] = Table.Rows[RowHandle - 1][UpperFieldName] + "";
|
||||
rowItem[gridModel.FieldName] = gridModel.DefaultValue.StartsWith("@") ? BaseImpl.GetDefaultValue(ReplaceHelper.ReplaceParamToValue(gridModel.DefaultValue, lastRow[UpperFieldName] + "")) : rowItem[gridModel.FieldName] = lastRow[UpperFieldName] + "";
|
||||
}
|
||||
rowItem[ERPInfo.Instance.isAddRows] = "1";
|
||||
}
|
||||
@@ -1963,7 +1969,7 @@ namespace Lskj.Control
|
||||
this.SetCalcValue(model, rowItem[gridModel.FieldName] + "", RowHandle);
|
||||
}
|
||||
string[] fields = !string.IsNullOrEmpty(gridModel.UnionFields) ? gridModel.UnionFields.Trim(',').Split(',') : new string[] { };
|
||||
if (RowHandle < Table.Rows.Count - 1 && ((fields.Contains(model.FieldName)) || model.FieldName == UpperFieldName || model.FieldName == gridModel.FieldName))
|
||||
if (RowHandle >= 0 && RowHandle < Table.Rows.Count - 1 && ((fields.Contains(model.FieldName)) || model.FieldName == UpperFieldName || model.FieldName == gridModel.FieldName))
|
||||
{
|
||||
if (Table.Columns.Contains(ERPInfo.Instance.isAddRows))
|
||||
{
|
||||
@@ -2053,7 +2059,7 @@ namespace Lskj.Control
|
||||
int.TryParse(rowItem["fieldWidth"] + "", out int fieldWidth);
|
||||
//int.TryParse(rowItem["orderid"] + "", out int index);
|
||||
//2025-02-20 依米康把orderid字段类型改成了decimal(18, 2),不能int.TryParse直接转换
|
||||
int index =Convert.ToInt32(Math.Round(double.Parse(rowItem["orderid"] + "")));
|
||||
int index = Convert.ToInt32(Math.Round(double.Parse(rowItem["orderid"] + "")));
|
||||
bool visible = "1".Equals(rowItem["isVisible"] + "") && fieldWidth > 0;
|
||||
bool isFix = "True".Equals(rowItem["IfFixColumn"] + "", StringComparison.OrdinalIgnoreCase);
|
||||
string FilterInfo = rowItem.Table.Columns.Contains("FilterInfo") ? rowItem["FilterInfo"] + "" : "";//列筛选条件
|
||||
@@ -5456,7 +5462,7 @@ namespace Lskj.Control
|
||||
{
|
||||
if (e.Column.Tag == null) return;
|
||||
GridColumnModel model = e.Column.Tag as GridColumnModel;
|
||||
|
||||
DataRow rowHandleRow = this.GridView.GetDataRow(e.RowHandle);
|
||||
|
||||
//值改变时,如果是验证是否重复的列报错就清除
|
||||
if (RepeatedVerificationNames.Count > 0)
|
||||
@@ -5464,9 +5470,9 @@ namespace Lskj.Control
|
||||
DataColumn[] datas = this.GridView.GetDataRow(e.RowHandle).GetColumnsInError();
|
||||
foreach (DataColumn item in datas)
|
||||
{
|
||||
if (this.GridView.GetDataRow(e.RowHandle).GetColumnError(item.ColumnName).Equals("数据重复"))
|
||||
if (rowHandleRow.GetColumnError(item.ColumnName).Equals("数据重复"))
|
||||
{
|
||||
this.GridView.GetDataRow(e.RowHandle).ClearErrors();
|
||||
rowHandleRow.ClearErrors();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5480,7 +5486,6 @@ namespace Lskj.Control
|
||||
|
||||
|
||||
GridView gridView = this.gridControl.MainView as GridView;
|
||||
int rowHandle = gridView.GetDataSourceRowIndex(e.RowHandle);
|
||||
DataTable dataTable = this.gridControl.DataSourceTable();
|
||||
//根据某一列的值自动填充对应值
|
||||
if (this.AutoPadDataReleColList.Count > 0)
|
||||
@@ -5489,7 +5494,7 @@ namespace Lskj.Control
|
||||
{
|
||||
if (!string.IsNullOrEmpty(selectColumnModel.AutoPadDataReleColName))
|
||||
{
|
||||
string value = dataTable.Rows[rowHandle][selectColumnModel.FieldName] + "";
|
||||
string value = rowHandleRow[selectColumnModel.FieldName] + "";
|
||||
string[] dataReleColNames = selectColumnModel.AutoPadDataReleColName.TrimEnd(',').Split(',');
|
||||
if (dataReleColNames.Contains(e.Column.FieldName))
|
||||
{
|
||||
@@ -5517,18 +5522,17 @@ namespace Lskj.Control
|
||||
this.SetUnionValue(model, e.Value + "", e.RowHandle);
|
||||
}
|
||||
//计算规则配置在结果字段上,所以无需验证当前操作控件
|
||||
this.SetCalcValue(model, e.Value + "", rowHandle);
|
||||
this.SetCalcValue(model, e.Value + "", e.RowHandle);
|
||||
this.SetUpperValue(model, e.RowHandle, e.Value + "");
|
||||
this.SetDisableColumn(model, e.RowHandle, e.Value + "");
|
||||
//验证数据长度
|
||||
if (model.LimitLength > 0 && e.Value != null)
|
||||
{
|
||||
DataRow HandleRow = this.gridView.GetDataRow(e.RowHandle);
|
||||
int MaxInputLength = System.Text.Encoding.Default.GetBytes(e.Value.ToString()).Length;
|
||||
if (model.LimitLength < MaxInputLength)
|
||||
HandleRow.SetColumnError(HandleRow.Table.Columns[e.Column.ColumnHandle], "当前输入文本超过设定长度!");//满足条件设置错误信息
|
||||
rowHandleRow.SetColumnError(rowHandleRow.Table.Columns[e.Column.ColumnHandle], "当前输入文本超过设定长度!");//满足条件设置错误信息
|
||||
else
|
||||
HandleRow.ClearErrors();//清除错误信息
|
||||
rowHandleRow.ClearErrors();//清除错误信息
|
||||
}
|
||||
|
||||
//var rows = this.gridControl.DataSourceTable().Select().ToList().Where(n => n[e.Column.FieldName].Equals(Convert.ChangeType(e.Value, e.Column.ColumnType)));
|
||||
|
||||
Reference in New Issue
Block a user