SVN-Revision: r325
This commit is contained in:
cyf
2025-03-14 07:41:52 +00:00
parent 65cec51eca
commit c8fbb3eca9
6 changed files with 101 additions and 56 deletions
+10 -39
View File
@@ -298,10 +298,10 @@ namespace Lskj.Control
{
return BaseModuleImpl.GetBaseGridRowColors(key);
}));
Task<DataTable> dataSourceTableTask = cachesDic.AddTask(gridControlEx, "DataSourceTable", new Task<DataTable>(() =>
{
return BaseImpl.GetDataTableResult(accraditationModelTask.Result.StepSql);
}));
//Task<DataTable> dataSourceTableTask = cachesDic.AddTask(gridControlEx, "DataSourceTable", new Task<DataTable>(() =>
//{
// return BaseImpl.GetDataTableResult(accraditationModelTask.Result.StepSql);
//}));
string modelkeyName = isBill ? GridCustomColumnStruct.AuditMainGridView : GridCustomColumnStruct.BaseAuditMainGridView;
string customColumKey = modelkeyName + key;
cachesDic.AddTask(gridControlEx, "DynamicModel", dynamicModelTask);
@@ -709,10 +709,11 @@ namespace Lskj.Control
foreach (TabPageItemObj item in tab.TabPageItemObjs)
{
int oldRowHandle = item.GridControlObj.GridView.FocusedRowHandle;
if (!dataCaches.GetValue(item.GridControlObj, "DataSourceTable", out DataTable dataSourceTable))
{
dataSourceTable = BaseImpl.GetDataTableResult(item.AuditModel.StepSql);
}
//if (!dataCaches.GetValue(item.GridControlObj, "DataSourceTable", out DataTable dataSourceTable))
//{
// dataSourceTable = BaseImpl.GetDataTableResult(item.AuditModel.StepSql);
//}
DataTable dataSourceTable = BaseImpl.GetDataTableResult(item.AuditModel.StepSql);
item.GridControlObj.SetGridViewDataSource(dataSourceTable);
item.LabelObj.Text = item.AuditModel.CurstepName + " (" + string.Format(ResourceKeys.RowCountRecond, item.GridControlObj.GridView.RowCount) + " )";
item.GridControlObj.GridView.SelectRowHandler(oldRowHandle);
@@ -1754,34 +1755,4 @@ namespace Lskj.Control
/// <summary>
/// <para>说明:设置分割条位置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期2018-02-01 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
protected void InitlizeSpiltLocation()
{
try
{
if (splitBelow.PanelVisibility == SplitPanelVisibility.Both)
{
string width = IniHelper.Read(string.Format("BelowDetai_width_{0}", this.SysModel.ModuleCode));//通过Key获取Value值
if (!string.IsNullOrEmpty(width))
{
this.splitBelow.SplitterPosition = Convert.ToInt32(width);
}
}
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
}
}
/// <para>创建日期
+1 -1
View File
@@ -4747,7 +4747,7 @@ namespace Lskj.Control.Model
}
}
/// <summary>
/// <para>说明:</para>
/// <para>说明:设置控件禁编或隐藏</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2019-01-22 </para>
/// <para>修改人:</para>
+8 -8
View File
@@ -535,7 +535,13 @@ namespace Lskj.Control
}
}
if (!string.IsNullOrWhiteSpace(this.ControlSql))
{
DataRow rowItem = BaseImpl.GetDataRowResult(this.ControlSql);
this.ControlObj.CurrentData = rowItem;
this.ControlObj.SetAllControlValue(rowItem);
this.ControlObj.SyncLocalModel();
}
if (!string.IsNullOrWhiteSpace(this.PrimaryValue))
{
// 修改默认赋值
@@ -558,13 +564,7 @@ namespace Lskj.Control
{
this.ControlObj.SetControlValue(UnionKey, UnionValue);
}
if (!string.IsNullOrWhiteSpace(this.ControlSql))
{
DataRow rowItem = BaseImpl.GetDataRowResult(this.ControlSql);
this.ControlObj.CurrentData = rowItem;
this.ControlObj.SetAllControlValue(rowItem);
this.ControlObj.SyncLocalModel();
}
this.ControlObj.CanExecControl = true;
}
/// <summary>
@@ -379,7 +379,7 @@ namespace Lskj.Control.MultiModelLookUp
/// </summary>
private void SetReadOnlyColumns()
{
if ( SingleChoiceMode) //this.ConfigureColumnMode &&
if (this.ConfigureColumnMode && SingleChoiceMode) //this.ConfigureColumnMode &&
{
DataTable _gridColumns = BaseModuleImpl.GetBaseGridColumns(this.UnionModuleCodel);
this.gcMain.SetReadOnlyColumns(_gridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);
@@ -209,6 +209,19 @@ namespace Lskj.Control.MultiModelLookUp
this.splitMain_Right.SplitterMoved += new EventHandler(PositionChange);
}
//右键
DataTable dt = BaseModuleImpl.GetBaseGridRightMenus(this.UnionModuleCodel);
string[] obj = new string[]{
"",
ERPInfo.Instance.UserId,
ERPInfo.Instance.UserName,
"3",
this.UnionModuleCodel,
}; ;
DynamicModel dynamicModel = new DynamicModel(obj);
this.gcMain.SetGridRightMenus(dt, dynamicModel, this.OnGridViewRightCallBack, this.SearchObj, null);
this.SourceSQL = this.SysModel.MenuSql;
this.gcDetail.GridView.OptionsSelection.EnableAppearanceFocusedCell = false;
@@ -554,7 +567,7 @@ namespace Lskj.Control.MultiModelLookUp
ReplaceHelper.ReplaceTreeViewParentKeyCond(NewSourceSQL, treeLeft.GetSelectNodeValue()) :
ReplaceHelper.ReplaceWhereCond(this.NewSourceSQL) + where;
this.DataSource = MainImpl.GetDataTableResult(sqlValue);
this.SetSelectionBox();
//this.SetSelectionBox();
//this.SetDefaultValue();
}
@@ -1087,4 +1100,47 @@ namespace Lskj.Control.MultiModelLookUp
case 2: // 左侧为表格
this.gridLeft.Visible = true;
this.treeLeft.Visible = false;
this.InitlizeSpiltL
this.InitlizeSpiltLocation();
this.SetLeftGridView();
//this.ModuleGridObj.SaveEvent += new Lskj.Control.ModuleGridEx.SaveEventHander(SetDetailGridView);
this.LeftGridEx = this.gridLeft;
break;
case 3: // 左侧为空
default:
this.splitMain.PanelVisibility = SplitPanelVisibility.Panel2;
break;
}
}
else
{
this.splitMain.PanelVisibility = SplitPanelVisibility.Panel2;
}
return true;
}
return false;
}
#endregion
//设置选中框的值
private void SetSelectionBox()
{
this.gcDetail.GridControl.DataSource = this.gcMain.gridControl.DataSourceTable().Clone();
}
#endregion
/// <summary>
/// <para>说明:右键菜单执行后刷新数据,刷新规则按照上一次查询条件刷新</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-11-02 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected void OnGridViewRightCallBack(object sender, EventAr
+23 -5
View File
@@ -1371,8 +1371,8 @@ namespace Lskj.Control
{
foreach (GridColumnModel item in mControlList)
{
string ColId = string.Format("{0}^{1}", item.Id + "", this.CustomColumKey);// item.Id + "";
DataTable dataTable = BaseImpl.GetDataTableResult(item.SqlSource);
if (ControlType.IsNotLoadData(item.FieldType)) continue;
DataTable dataTable = BaseImpl.GetDataTableResult(item.SqlSource);
Application.DoEvents();
if (!item.Visible) continue;
@@ -2173,7 +2173,7 @@ namespace Lskj.Control
public override void SetGridViewDataSource(DataTable table, bool selectRowHandler = true)
{
lastNodeIndex = 0;
if(selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
if (selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
GetTreeExpanded();
this.gcMain.ClearNodes();
this.gcMain.DataSource = table;
@@ -2192,7 +2192,7 @@ namespace Lskj.Control
GetTreeExpanded();
this.gcMain.DataSource = dataSet.Tables[0];
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
}
/// <summary>
@@ -2614,7 +2614,9 @@ namespace Lskj.Control
DialogResult result = modelLookUp.ShowDialog();
if (result == DialogResult.OK)
{
TreeListObj.ShowEditor();
btnEdit.EditValue = modelLookUp.EditValue;
TreeListObj.PostEditor();
}
}
@@ -2654,12 +2656,28 @@ namespace Lskj.Control
}
modelLookUp.NewSourceSQL = ReplaceHelper.ReplaceRowParam(this.GetViewFocusedDataRow(), SourceSQL);
//modelLookUp.DataSource = BaseImpl.GetDataTableResult(modelLookUp.SourceSQL);
modelLookUp.AddModuleResult = model.addModuleResult;
modelLookUp.InitControls(modelLookUp.UnionModuleCodel);
DialogResult result = modelLookUp.ShowDialog();
if (result == DialogResult.OK)
{
TreeListObj.ShowEditor();
btnEdit.EditValue = modelLookUp.EditValue;
TreeListObj.PostEditor();
string[] resultFields = model.addModuleResult.Trim().Split(',');
DataRow focusedRow = this.GetViewFocusedDataRow();
if (focusedRow != null)
{
foreach (string resultKey in modelLookUp.ModuleResultDic.Keys)
{
string resultValue = modelLookUp.ModuleResultDic[resultKey];
if (focusedRow.Table.Columns.Contains(resultKey))
{
focusedRow[resultKey] = resultValue;
}
}
}
}
}