protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && Session.IsNewObject(this)) { Code = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType(), true, Code); } base.OnSaving(); }
protected override void OnSaving() { if (!(Session is NestedUnitOfWork) && Session.IsNewObject(this)) { //int nextSequence = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType().FullName, "TEST", true); //Code = string.Format("N{0:D6}", nextSequence); Code = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType(), true, Code); } base.OnSaving(); }
public override void AfterConstruction() { base.AfterConstruction(); // Place your initialization code here (http://documentation.devexpress.com/#Xaf/CustomDocument2834). if (!(Session is NestedUnitOfWork) && Session.IsNewObject(this)) { //string nextSequence = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType(), false,Code);//string.Empty //Code = string.Format("N{0:D6}", nextSequence); Code = CustomDistributedIdGeneratorHelper.Generate(this.Session.DataLayer, this.GetType(), false, Code);//string.Empty } }