public bool Submit(ITollHourlyAudit audit) { var builtAudit = EntityBuilder.Build(audit); if (builtAudit != null) { try { var syncAudit = Mapper.Map <ITollHourlyAudit, Audit>(builtAudit); Sync.Client.SyncClient.SubmitAudit(syncAudit, syncAudit.AuditHour); builtAudit.IsSent = true; DataProvider.InsertAudit(builtAudit); return(true); } catch (Exception ex) { Log.LogException(ex); Log.LogTrace(ex.Message + ". Check error log for more details."); } } audit.TimeStamp = DateTime.Now; DataProvider.InsertAudit(audit); return(false); }
public ITollHourlyAudit Build(ITollHourlyAudit entity) { return(entity.WellFormed ? entity : null); }
public void InsertAudit(ITollHourlyAudit newAudit) { context.Audits.Add(Mapper.Map <ITollHourlyAudit, Audit>(newAudit)); }