Exemplo n.º 1
0
        public List <ViolationsDetailsByLocationDTO> GetViolationsDetailsForLocation(string LocationCode, DateTime?StartDateTime, int?ViolationTypeId)
        {
            try
            {
                var lstViolationsDetails = operationalDataContext.fn_GetViolationsDetailsByLocation(StartDateTime, ViolationTypeId, LocationCode)
                                           .Select(Violation => new ViolationsDetailsByLocationDTO
                {
                    Altitude          = Violation.Altitude,
                    Latitude          = Violation.Latitude.Value,
                    Longitude         = Violation.Longitude.Value,
                    AssetCode         = Violation.AssetCode,
                    AssetId           = Violation.AssetId,
                    ViolationTypeId   = Violation.ViolationTypeId,
                    ViolationTypeName = Violation.ViolationTypeName,
                    ViolationsCount   = Violation.ViolationsCount,
                    LocationCode      = Violation.LocationCode
                }).ToList();

                return(lstViolationsDetails);
            }
            catch (Exception ex)
            {
            }

            return(null);
        }