SVN-Revision: r282
This commit is contained in:
cyf
2025-02-25 01:54:47 +00:00
parent 90e6885779
commit 645ed54877
7 changed files with 594 additions and 408 deletions
+40 -29
View File
@@ -1907,6 +1907,45 @@ namespace Lskj.Control
}
}
}
/// <summary>
/// <para>说明:验证表格列是否有为空的值</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2017-12-08 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public override bool VerifyNull()
{
DataTable table = this.GridControl.DataSourceTable().TrimEmptyRows();
List<GridColumnModel> columns = this.ColumnList.FindAll(x => x.CanNull);
foreach (DataRow item in table.Rows)
{
foreach (GridColumnModel model in columns)
{
BandedGridColumn column = this.bandedGridView.Columns[model.FieldName];
string value = item[model.FieldName] + "";
string displayText = this.bandedGridView.GetDisplayTextByColumnValue(column, item[model.FieldName]);
if (string.IsNullOrWhiteSpace(value) || string.IsNullOrWhiteSpace(displayText))
{
MessageUtil.Show(string.Format(ResourceKeys.NullField, model.FieldText));
this.bandedGridView.Focus();
this.bandedGridView.SelectRowHandler(table.Rows.IndexOf(item));
this.bandedGridView.FocusedColumn = this.bandedGridView.Columns[model.FieldName];
this.bandedGridView.SelectCell(bandedGridView.FocusedRowHandle, this.bandedGridView.Columns[model.FieldName]);
this.bandedGridView.ShowEditorByMouse();
return false;
}
}
}
return true;
}
/// <summary>
/// 冻结
/// </summary>
@@ -2988,32 +3027,4 @@ namespace Lskj.Control
}
}
string tempSql = string.Format(@"insert into {3}(GroupName,GroupAmount,OperAtorId) values('{0}','{1}','{2}');", editValue, groupText, ERPInfo.Instance.UserId, ResourceKeys.SettingGrouprptab);
SqlHelper.ExecuteNonQuery(tempSql);
}
}
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex, Model.ModuleCode);
MessageUtil.Show(Message, ex.Message);
}
}
/// <summary>
/// 点击标题行排序后,默认选中第一行
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BandedGridView_EndSorting(object sender, EventArgs e)
{
this.bandedGridView.MoveFirst(); // 将焦点行移动到第一行
this.bandedGridView.FocusedRowHandle = 0;// 确保第一行被聚焦
}
}
}
string tempSql = string.Format(@"insert i