数据字典BLL.CreateDataBinder方法实现新增记录给主键赋值
数据字典BLL.CreateDataBinder方法实现新增记录给主键赋值 public override void CreateDataBinder(DataRow sourceRow)
{
base.CreateDataBinder(sourceRow);
bool isAdd =
_DataBinder.Rows.Count > 0 && _DataBinder.Rows[0].RowState == DataRowState.Added;
//新增记录给主键赋值
if (isAdd)
{
_DataBinder.Rows[0][dt_SupplierCategory.RowID] = Guid.NewGuid().ToString().ToLower();
}
}