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);
        }
示例#2
0
 public ITollHourlyAudit Build(ITollHourlyAudit entity)
 {
     return(entity.WellFormed ? entity : null);
 }
示例#3
0
 public void InsertAudit(ITollHourlyAudit newAudit)
 {
     context.Audits.Add(Mapper.Map <ITollHourlyAudit, Audit>(newAudit));
 }