Ejemplo n.º 1
0
        public ITollIncident Submit(ITollIncident incident)
        {
            var builtIncident = EntityBuilder.Build(incident);

            if (builtIncident != null)
            {
                try
                {
                    var syncIncident = Mapper.Map <ITollIncident, Data.Incident>(builtIncident);
                    Sync.Client.SyncClient.SubmitIncident(syncIncident);

                    incident.IsSent = true;
                    return(builtIncident);
                }
                catch (Exception ex)
                {
                    Log.LogException(ex);
                    Log.LogTrace(ex.Message + ". Check error log for more details.");
                }
            }

            return(incident);
        }
Ejemplo n.º 2
0
 public void InsertIncident(ITollIncident newIncident)
 {
     context.Incidents.Add(Mapper.Map <ITollIncident, Incident>(newIncident));
 }
Ejemplo n.º 3
0
 public ITollIncident Build(ITollIncident entity)
 {
     return(entity.StaffLoginGUID.HasValue && entity.IncidentTypeGUID != new Guid("B6AB99E8-5DA4-4C33-9EDD-08298A1A2104") ? entity : null);
 }