SVN-Revision: r431
This commit is contained in:
cyf
2025-04-02 08:39:39 +00:00
parent d69b0a7c1e
commit ad17816f5c
10 changed files with 230 additions and 67 deletions
+33 -38
View File
@@ -109,7 +109,7 @@ namespace Lskj.Control
BandedGridView gridView = bandGridControlEx.GridView as BandedGridView;
BandedGridControlEx NewBandedGridControlEx = new BandedGridControlEx();
BandedGridView gridView2 = NewBandedGridControlEx.GridView as BandedGridView;
gridView2.Columns.Clear();//默认有2个列
List<string> boolList = new List<string>();
List<string> datetimeList = new List<string>();
List<string> visibleList = new List<string>();
@@ -364,7 +364,6 @@ namespace Lskj.Control
{
gridView2.OptionsView.ShowFooter = true;
firstColumn.Summary.AddRange(new DevExpress.XtraGrid.GridSummaryItem[] { new DevExpress.XtraGrid.GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Count, firstColumn.FieldName.ToString(), "合计: {0:#,###}行") });
if (SystemInfo.Instance.GroupSpecialMode)
{
//gridView2.GroupSummary.Add(new DevExpress.XtraGrid.GridGroupSummaryItem(DevExpress.Data.SummaryItemType.Count, firstColumn.FieldName.ToString(), firstColumn, "合计: {0:#,###}行"));
@@ -454,7 +453,8 @@ namespace Lskj.Control
hasBoolean = true;
}
GridColumnModel model = col.Tag as GridColumnModel;
if (model != null && (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabTreeLookValue || model.FieldType == ControlType.LabMultiSelectValueParam))
if (model != null && (model.FieldType == ControlType.LabMultiSelectValue || model.FieldType == ControlType.LabTreeLookValue || model.FieldType == ControlType.LabMultiSelectValueParam)|| model.FieldType == ControlType.LabSelectReturnId)
{
StoreValueList.Add(col.FieldName);
}
@@ -515,6 +515,10 @@ namespace Lskj.Control
{
newCol.DataType = typeof(DateTime);
}
if (StoreValueList.Contains(col.ColumnName))
{
newCol.DataType = typeof(String);
}
dtTable.Columns.Add(newCol);
}
}
@@ -610,9 +614,9 @@ namespace Lskj.Control
if (gridColumn.Tag is GridColumnModel)
{
GridColumnModel model = gridColumn.Tag as GridColumnModel;
//|| model.FieldType == ControlType.LabSelectReturnId
if ((model.FieldType == ControlType.LabMultiSelectValue ||
model.FieldType == ControlType.LabMultiSelectValueParam) && row[col.ColumnName].ToString().Contains(","))
model.FieldType == ControlType.LabMultiSelectValueParam ) && row[col.ColumnName].ToString().Contains(","))
{
string[] cellText = row[col.ColumnName].ToString().Split(',');
fieldValue = string.Empty;
@@ -958,6 +962,29 @@ namespace Lskj.Control
ValueGridColumnTable.Add(model, translationDict);
}
}
else if (model.FieldType == ControlType.LabSelectReturnId)
{
string sqlValue = model.SqlSource;
if (model.IsRadio&& !string.IsNullOrWhiteSpace(model.addModuleld))
{
//单选模式数据源为模块sql
DataRow modelRow = Business.Impl.MainImpl.GetSystemdllTab(model.addModuleld);
sqlValue = modelRow["SQL"]+"";
}
DataTable dataTable = Business.Impl.BaseImpl.GetDataTableResult(sqlValue);
Dictionary<string, string> translationDict = new Dictionary<string, string>();
foreach (DataRow item in dataTable.Rows)
{
string key = item[model.ValueMember].ToString();
string value = item[model.TextMember].ToString();
if (!translationDict.ContainsKey(key))
{
translationDict.Add(key, value);
}
}
ValueGridColumnTable.Add(model, translationDict);
}
}
}
@@ -979,36 +1006,4 @@ namespace Lskj.Control
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0.0.3</para>
/// </summary>
/// <param name="control">The control.</param>
/// <returns>DataTable.</returns>
public string GetValueByImportText(GridColumnModel model, string text, bool isBillImport = false)
{
string value = text;
Dictionary<string, string> translationDict = null;
if (ValueGridColumnTable.TryGetValue(model, out translationDict))
{
if (translationDict != null && translationDict.Count > 0)
{
if (translationDict.TryGetValue(text, out string translatedValue))
{
value = translatedValue;
}
else
{
value = text;
}
}
else
{
value = "";
}
}
return value;
}
}
}
/// <para>版