/// <summary> /// After Save /// </summary> /// <param name="newRecord">newRecord new</param> /// <param name="success">success</param> /// <returns>success</returns> protected override bool AfterSave(bool newRecord, bool success) { if (!success) { return(false); } // Sync Table ID if (newRecord) { MSequence.CreateTableSequence(GetCtx(), GetTableName(), Get_TrxName()); } else { MSequence seq = MSequence.Get(GetCtx(), GetTableName(), Get_TrxName()); if (seq == null || seq.Get_ID() == 0) { MSequence.CreateTableSequence(GetCtx(), GetTableName(), Get_TrxName()); } else if (!seq.GetName().Equals(GetTableName())) { seq.SetName(GetTableName()); seq.Save(); } } // checked if value is changed in Maintain Version if (Is_ValueChanged("IsMaintainVersions")) { if (!newRecord && IsMaintainVersions()) { int ColID = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT AD_Column_ID FROM AD_Column WHERE IsActive = 'Y' AND AD_Table_ID = " + GetAD_Table_ID() + " ORDER BY ColumnName", null, Get_Trx())); if (ColID > 0) { MColumn column = new MColumn(GetCtx(), ColID, Get_Trx()); MasterVersions mv = new MasterVersions(); string versionMsg = mv.CreateVersionInfo(column.GetAD_Column_ID(), column.GetAD_Table_ID(), Get_Trx()); } } } return(success); } // afterSave
/// <summary> /// After Save /// </summary> /// <param name="newRecord">newRecord new</param> /// <param name="success">success</param> /// <returns>success</returns> protected override bool AfterSave(bool newRecord, bool success) { // Sync Table ID if (newRecord) { MSequence.CreateTableSequence(GetCtx(), GetTableName(), Get_TrxName()); } else { MSequence seq = MSequence.Get(GetCtx(), GetTableName(), Get_TrxName()); if (seq == null || seq.Get_ID() == 0) { MSequence.CreateTableSequence(GetCtx(), GetTableName(), Get_TrxName()); } else if (!seq.GetName().Equals(GetTableName())) { seq.SetName(GetTableName()); seq.Save(); } } return(success); } // afterSave