func (VS *Server) editElementInDatabaseWithRegister(c *gin.Context, newObject interface{}, oldObject interface{}, IDboth bson.ObjectId, IDservice bson.ObjectId, class string, method string, operation string) {
	err := VS.DataBase.Upsert(IDboth, newObject)
	VS.checkOperation(c, class, method, operation, err)
	// Here we save the changes
	audit := VS.getAudit(c, newObject, IDboth, IDservice, Modified)
	modified := VS.dynamicAuditChange(c, newObject, oldObject, audit.ID)
	if modified {
		VS.registerAuditAndEvent(c, audit, newObject, IDboth)
	}
}
// This method edit the element into the DB and takes care about all the changes and the audits
// IDservice is the ID where occur the transaction
This method edit the element into the DB and takes care about all the changes and the audits
IDservice is the ID where occur the transaction
// This method edit the element into the DB and takes care about all the changes and the audits // IDservice is the ID where occur the transaction
func (VS *Server) editElementInDatabaseWithRegister(c *gin.Context, newObject interface{}, oldObject interface{}, IDboth bson.ObjectId, IDservice bson.ObjectId, class string, method string, operation string) {
	err := VS.DataBase.Upsert(IDboth, newObject)
	VS.checkOperation(c, class, method, operation, err)
	audit := VS.getAudit(c, newObject, IDboth, IDservice, Modified)
	modified := VS.dynamicAuditChange(c, newObject, oldObject, audit.ID)
	if modified {
		VS.registerAuditAndEvent(c, audit, newObject, IDboth)
	}
}
func ( VS * Server ) editElementInDatabaseWithRegister ( c * gin . Context , newObject interface { } , oldObject interface { } , IDboth bson . ObjectId , IDservice bson . ObjectId , class string , method string , operation string ) { err := VS . DataBase . Upsert ( IDboth , newObject ) VS . checkOperation ( c , class , method , operation , err ) audit := VS . getAudit ( c , newObject , IDboth , IDservice , Modified ) modified := VS . dynamicAuditChange ( c , newObject , oldObject , audit . ID ) if modified { VS . registerAuditAndEvent ( c , audit , newObject , IDboth ) } }
This method edit the element into the DB and takes care about all the changes and the audits
IDservice is the ID where occur the transaction
This method edit the element into the DB and takes care about all the changes and the audits IDservice is the ID where occur the transaction
// Here we save the changes