// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public static bool EndWriteDB(DBSQLViewModel dBSQLViewModel, Int64 parent, ErrorLevel errorLevel, string message, string dataOutType, string dataOut) { long Ticks = DateTime.Now.Ticks; var at = DB_SQL.QueryFirst <AuditTrail>(dBSQLViewModel, "select * from AuditTrail where PK=" + parent); if (at != null) { at.Level = errorLevel; at.Ticks = Ticks - at.Ticks; at.DataOutType = dataOutType; at.DataOut = dataOut; at.Parent = -1; // ChM 20180514 pour simplifier requetes exploitations begin sans end var endAT = new AuditTrail(); endAT.Application = at.Application; endAT.TerminalID = at.TerminalID; endAT.TerminalIP = at.TerminalIP; endAT.FKUser = at.FKUser; endAT.ItemID = at.ItemID; endAT.ItemType = at.ItemType; endAT.IsBusiness = at.IsBusiness; endAT.Tag = at.Tag; endAT.Parent = parent; endAT.Message = message; endAT.Level = errorLevel; endAT.DataOutType = dataOutType; endAT.DataOut = dataOut; DB_SQL.Insert(dBSQLViewModel, endAT); return(DB_SQL.Update(dBSQLViewModel, at)); } else { return(false); }; }