public List<BE.FacilityAudit> GetFacilityAuditsForListingTypeByListingTypeGuid(Guid listingTypeGuid)
 {
     DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
     List<BE.FacilityAudit> result = new List<BE.FacilityAudit>();
     result = gateway.GetForListingTypeByListingTypeGuid(listingTypeGuid).ToBusinessEntitiesList();
     return result;
 }
 public List<BE.FacilityAudit> GetFacilityAuditsForFacilityByFacilityGuid(Guid facilityGuid)
 {
     DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
     List<BE.FacilityAudit> result = new List<BE.FacilityAudit>();
     result = gateway.GetForFacilityByFacilityGuid(facilityGuid).ToBusinessEntitiesList();
     return result;
 }
 public List<BE.FacilityAudit> GetFacilityAuditsForClientByClientGuid(Guid clientGuid)
 {
     DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
     List<BE.FacilityAudit> result = new List<BE.FacilityAudit>();
     result = gateway.GetForClientByClientGuid(clientGuid).ToBusinessEntitiesList();
     return result;
 }
        public BE.FacilityAudit GetFacilityAuditByFacilityAuditGuid(Guid facilityAuditGuid)
        {
            //@@NEW - removed try/catch. Separated DA call from entity conversion. Renamed "result" to "entity".
            DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
            DA.FacilityAudit result = gateway.GetByPK(facilityAuditGuid);

            BE.FacilityAudit entity = result.ToBusinessEntity();
            return entity;
        }
        public List<BE.FacilityAudit> GetAllFacilityAuditWithUndefined()
        {
            //@@NEW - removed try/catch. Separated DA call from entity conversion. Renamed "result" to "entities".
            DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
            List<DA.FacilityAudit> results =  gateway.GetAllWithUndefined();

            List<BE.FacilityAudit> entities = results.ToBusinessEntitiesList();
            return entities;
        }
        public List<BE.FacilityAudit> GetAllFacilityAudit()
        {
            //@@NEW - removed try/catch. Separated query from entity conversion. Renamed "result" to "entities".
            DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
            IOrderedQueryable<DA.FacilityAudit> query = gateway.GetAll();

            List<BE.FacilityAudit> entities = query.ToBusinessEntitiesList();
            return entities;
        }
Exemple #7
0
        public IEnumerable<BE.FacilityAudit> GetListingsWithDateModifiedByClientGuid(Guid clientGuid)
        {
            var listings = this.GetListingByClientGuid(clientGuid);
            DA.FacilityAuditGateway facilityGateway = new DA.FacilityAuditGateway();
            List<BE.FacilityAudit> facilityAuditVMs = new List<BE.FacilityAudit>();
            foreach (var listing in listings)
            {
                //// find max date record
                var facilityMaxDate = facilityGateway.GetForFacilityByFacilityGuid(listing.FacilityGuid).Max(m => m.DateModified);
                //// get last audit record
                var facilityAuditLast = facilityGateway.GetForFacilityByFacilityGuid(listing.FacilityGuid).First(fa => fa.DateModified == facilityMaxDate);
                facilityAuditVMs.Add(facilityAuditLast.ToBusinessEntity());
            }

            return facilityAuditVMs;
        }
 public BE.FacilityAudit InsertFacilityAudit(BE.FacilityAudit entity)
 {
     //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
     DA.FacilityAuditGateway gateway = new DA.FacilityAuditGateway();
     DA.FacilityAudit result = gateway.Insert(entity.ToDataEntity());
     return result.ToBusinessEntity();
 }