Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DataBase : DataBaseModelDataContext
- {
- internal DataBase()
- {
- }
- public DataBase(CommonObjects.BaseParameters param) {
- #If (DEBUG)
- Log = new DataBaseLoger();
- #endIf //(DEBUG)
- }
- public override void SubmitChanges(System.Data.Linq.ConflictMode failureMode)
- {
- System.Data.Linq.ChangeSet cs = GetChangeSet();
- // update audit fields for each insert
- foreach (object entity in cs.Inserts)
- {
- UpdateAuditFields(entity);
- }
- // update audit fields for each update
- foreach (object entity in cs.Updates)
- {
- UpdateAuditFields(entity);
- }
- base.SubmitChanges(failureMode);
- }
- }
- public override void WriteLine(string value)
- {
- System.Diagnostics.Trace.WriteLine(System.DateTime.Now.ToString("hh:mm:ss") + " " + value, "Information");
- }
- public override void WriteLine()
- {
- System.Diagnostics.Trace.WriteLine("", "Information");
- }
- public override void WriteLine(string format, params object[] arg)
- {
- WriteLine(string.Format(format, arg));
- }
- }
Add Comment
Please, Sign In to add comment