public BE.ListingType GetListingTypeByListingTypeGuid(Guid listingTypeGuid) { DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); BE.ListingType result = new BE.ListingType(); result = gateway.GetByPK(listingTypeGuid).ToBusinessEntity(); return result; }
public List<BE.ListingType> GetAllListingTypeWithUndefined() { DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); List<BE.ListingType> result = new List<BE.ListingType>(); result = gateway.GetAllWithUndefined().ToBusinessEntitiesList(); return result; }
//@@NEW public BE.ListingType GetListingTypeByListingTypeName(string listingTypeName) { DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); DA.ListingType result = gateway.GetByListingTypeName(listingTypeName); if (null != result) return result.ToBusinessEntity(); else return null; }
public BE.ListingType InsertListingType(BE.ListingType entity) { //@@NEW // Check if a CityStateZip already exists with this ZipCode. BE.ListingType existingEntity = GetListingTypeByListingTypeName(entity.ListingTypeName); if (null != existingEntity) return existingEntity; //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity. DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); DA.ListingType result = gateway.Insert(entity.ToDataEntity()); return result.ToBusinessEntity(); }
public BE.ListingViewModel GetListingByFacilityGuid(Guid facilityGuid) { DA.FacilityGateway facilityGateway = new DA.FacilityGateway(); DA.Facility facility = facilityGateway.GetByPK(facilityGuid); // Validation of client. if (null == facility) return null; if (Guid.Empty == facility.CityStateZipGuid) return null; if (Guid.Empty == facility.ListingTypeGuid) return null; DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway(); DA.CityStateZip cityStateZip = cityGateway.GetByPK(facility.CityStateZipGuid); // Validation of city state zip. if (null == cityStateZip) return null; DA.ListingTypeGateway listingGateway = new DA.ListingTypeGateway(); DA.ListingType listingType = listingGateway.GetByPK(facility.ListingTypeGuid); // Validation of paymentInfo. if (null == listingType) return null; BE.ListingViewModel listing = EntityConversion.BuildListingViewModel(facility, cityStateZip, listingType); return listing; }
public void UpdateListingType(BE.ListingType entity) { DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); gateway.Update(entity.ToDataEntity()); }
public void DeleteListingType(BE.ListingType entity) { DA.ListingTypeGateway gateway = new DA.ListingTypeGateway(); gateway.Delete(entity.ListingTypeGuid); }