SVN r444
SVN-Revision: r444
This commit is contained in:
@@ -2001,17 +2001,42 @@ namespace Lskj.ProductiSched
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// **6. 解决渲染问题**
|
||||||
|
if (!dataMain.Columns.Contains("PrecomputedMaxDate"))
|
||||||
|
{
|
||||||
|
dataMain.Columns.Add("PrecomputedMaxDate", typeof(string));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (DataRow row in dataMain.Rows)
|
||||||
|
{
|
||||||
|
DateTime? maxDate = null; // 初始化为 null,表示尚未找到有效日期
|
||||||
|
foreach (DataColumn column in row.Table.Columns)
|
||||||
|
{
|
||||||
|
// 检查列是否为日期类型,这里假设您已确保列名适当反映了它们是日期类型
|
||||||
|
if (DateTime.TryParse(column.ToString(), out DateTime tempDate))
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(row[column] + "")) // 只有在找到更大的日期时才更新
|
||||||
|
{
|
||||||
|
if (maxDate == null || tempDate > maxDate)
|
||||||
|
{
|
||||||
|
maxDate = tempDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 赋值操作,确保为字符串格式
|
||||||
|
row["PrecomputedMaxDate"] = maxDate.HasValue ? maxDate.Value.ToString("yyyy-MM-dd") : "";
|
||||||
|
}
|
||||||
return dataMain;
|
return dataMain;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// 构建带日期的数据源
|
||||||
/// 构建带日期的数据源
|
/// </summary>
|
||||||
/// </summary>
|
/// <param name="focusedRow"></param>
|
||||||
/// <param name="focusedRow"></param>
|
/// <param name="dataDayPlan"></param>
|
||||||
/// <param name="dataDayPlan"></param>
|
/// <param name="startDate"></param>
|
||||||
/// <param name="startDate"></param>
|
/// <returns></returns>
|
||||||
/// <returns></returns>
|
private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate)
|
||||||
private void UpdateRowWithDayPlan(DataRow focusedRow, DataTable dataDayPlan, DateTime startDate)
|
|
||||||
{
|
{
|
||||||
string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey;
|
string rightPrimaryKey = DataModel.RightModuleModel.ParmaryKey;
|
||||||
string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey;
|
string topPrimaryKey = DataModel.TopModuleModel.ParmaryKey;
|
||||||
|
|||||||
Reference in New Issue
Block a user