SVN r458
SVN-Revision: r458
This commit is contained in:
@@ -1378,41 +1378,8 @@ namespace Lskj.Control
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
GridView gridView = this.gridControl.MainView as GridView;
|
||||
DataTable dataTable = this.gridControl.DataSourceTable();
|
||||
if (dataTable != null&&dataTable.Columns.Contains("PrecomputedMaxDate"))
|
||||
{
|
||||
DataRow HandleRow = this.bandedGridView.GetDataRow(e.RowHandle);
|
||||
DateTime? maxDate = null; // 初始化为 null,表示尚未找到有效日期
|
||||
bool isdatefile= DateTime.TryParse(e.Column.FieldName, out DateTime tempDate);//获取改变当前列日期
|
||||
bool isMaxDatefile = rowDateValues.TryGetValue(e.RowHandle, out List<DateTime> currentRowDateColumns);//获取记录日期
|
||||
if (isdatefile)
|
||||
{
|
||||
if (isMaxDatefile&& currentRowDateColumns.Count>0)
|
||||
{
|
||||
List<DateTime> validDateColumns= rowDateValues[e.RowHandle];
|
||||
if (tempDate > currentRowDateColumns.Max()) // 只有在找到更大的日期时才更新
|
||||
{
|
||||
validDateColumns.Add(tempDate);
|
||||
HandleRow["PrecomputedMaxDate"] = tempDate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
else if (tempDate == currentRowDateColumns.Max() && string.IsNullOrEmpty(e.Value + ""))
|
||||
{
|
||||
rowDateValues[e.RowHandle].Remove(tempDate);
|
||||
HandleRow["PrecomputedMaxDate"] = currentRowDateColumns.Max().ToString("yyyy-MM-dd");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!validDateColumns.Contains(tempDate)) validDateColumns.Add(tempDate);
|
||||
}
|
||||
}
|
||||
else {
|
||||
rowDateValues[e.RowHandle].Add(tempDate);
|
||||
HandleRow["PrecomputedMaxDate"] = tempDate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.Column.Tag == null) return;
|
||||
GridColumnModel model = e.Column.Tag as GridColumnModel;
|
||||
if (model == null) return;
|
||||
@@ -3168,4 +3135,32 @@ namespace Lskj.Control
|
||||
|
||||
}
|
||||
}
|
||||
string tempSql = string.Format(@"insert i
|
||||
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;// 确保第一行被聚焦
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user