Beispiel #1
0
 public List<BE.Facility> GetAllFacilityFilter(BE.CityStateZip csz, IEnumerable<BE.Offering> offerings, bool wideSearch, int page, int pageSize, out int totalCount)
 {
     DA.FacilityGateway gateway = new DA.FacilityGateway();
     return gateway.GetAllFilter(
         csz.ToDataEntity(), offerings.ToDataEntitiesList(), wideSearch, page, pageSize, out totalCount)
         .ToBusinessEntitiesList();
 }
 public BE.FacilityLocationCriteria InsertFacilityLocationCriteria(BE.FacilityLocationCriteria entity)
 {
     //@@NEW - remove try/catch. insert returns DA entity (with new data). this method now returns an entity.
     DA.FacilityLocationCriteriaGateway gateway = new DA.FacilityLocationCriteriaGateway();
     DA.FacilityLocationCriteria result = gateway.Insert(entity.ToDataEntity());
     return result.ToBusinessEntity();
 }
 public BE.FacilityPhoto InsertFacilityPhoto(BE.FacilityPhoto entity)
 {
     //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
     DA.FacilityPhotoGateway gateway = new DA.FacilityPhotoGateway();
     DA.FacilityPhoto result = gateway.Insert(entity.ToDataEntity());
     return result.ToBusinessEntity();
 }
Beispiel #4
0
 public BE.ClientAudit InsertClientAudit(BE.ClientAudit entity)
 {
     //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
     DA.ClientAuditGateway gateway = new DA.ClientAuditGateway();
     DA.ClientAudit result = gateway.Insert(entity.ToDataEntity());
     return result.ToBusinessEntity();
 }
Beispiel #5
0
 public List<BE.Facility> GetAllFacilityByDistance(BE.DistanceParameters parameters, int page, int pageSize, out int totalCount)
 {
     DA.FacilityGateway gateway = new DA.FacilityGateway();
     return gateway.GetAllByDistance(
         new DA.DAEntities.LatLng(parameters.Latitude, parameters.Longitude),
         parameters.DistanceRadius, page, pageSize, out totalCount).ToBusinessEntitiesList();
 }
Beispiel #6
0
 public List<BE.Facility> GetAllFacilityByDistanceFilter(BE.DistanceParameters parameters, IEnumerable<BE.Offering> offerings, bool wideSearch, int page, int pageSize, out int totalCount)
 {
     DA.FacilityGateway gateway = new DA.FacilityGateway();
     return gateway.GetAllByDistanceFilter(offerings.ToDataEntitiesList(),
         new DA.DAEntities.LatLng(parameters.Latitude, parameters.Longitude),
         parameters.DistanceRadius, wideSearch, page, pageSize, out totalCount).ToBusinessEntitiesList();
 }
Beispiel #7
0
 public BE.Offering InsertOffering(BE.Offering entity)
 {
     //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
     DA.OfferingGateway gateway = new DA.OfferingGateway();
     DA.Offering result = gateway.Insert(entity.ToDataEntity());
     return result.ToBusinessEntity();
 }
 public void UpdateFacilityWithOffering(BE.FacilityWithOffering request)
 {
     DA.FacilityWithOfferingGateway gateway = new DA.FacilityWithOfferingGateway();
     try
     {
         gateway.Update(request);
     }
     catch (Exception ex) { throw ex; }
 }
Beispiel #9
0
 public void DeleteClick(BE.Click entity)
 {
     try
     {
         DA.ClickGateway gateway = new DA.ClickGateway();
         gateway.Delete(entity.ClickGuid);
     }
     catch (Exception ex) { throw ex; }
 }
 public void UpdateFacilityWithCityStateZip(BE.FacilityWithCityStateZip request)
 {
     DA.FacilityWithCityStateZipGateway gateway = new DA.FacilityWithCityStateZipGateway();
     try
     {
         gateway.Update(request);
     }
     catch (Exception ex) { throw ex; }
 }
 public void UpdateOfferingWithFacility(BE.OfferingWithFacility request)
 {
     DA.OfferingWithFacilityGateway gateway = new DA.OfferingWithFacilityGateway();
     try
     {
         gateway.Update(request);
     }
     catch (Exception ex) { throw ex; }
 }
 public void UpdateCityStateZipWithFacility(BE.CityStateZipWithFacility request)
 {
     DA.CityStateZipWithFacilityGateway gateway = new DA.CityStateZipWithFacilityGateway();
     try
     {
         gateway.Update(request);
     }
     catch (Exception ex) { throw ex; }
 }
Beispiel #13
0
        public void UpdatePaymentInfo(BE.PaymentInfo entity)
        {
            //@@NEW
            // Update the main record.
            DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway();
            gateway.Update(entity.ToDataEntity());

            // Create the audit record.
            PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic();
            auditLogic.InsertPaymentInfoAudit(entity);
        }
Beispiel #14
0
        public void DeletePaymentInfo(BE.PaymentInfo entity)
        {
            //@@NEW
            // Delete the main record.
            DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway();
            gateway.Delete(entity.PaymentInfoGuid);

            // Create the audit record.
            PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic();
            auditLogic.InsertPaymentInfoAudit(entity);
        }
Beispiel #15
0
        public void DeleteClient(BE.Client entity)
        {
            // Delete the main record.
            DA.ClientGateway gateway = new DA.ClientGateway();
            gateway.Delete(entity.ClientGuid);

            //@@NEW
            // Create the audit record.
            ClientAuditLogic auditLogic = new ClientAuditLogic();
            auditLogic.InsertClientAudit(entity);
        }
Beispiel #16
0
        public void DeleteFacility(BE.Facility entity)
        {
            // Delete the main record.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            gateway.Delete(entity.FacilityGuid);

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(entity);
        }
Beispiel #17
0
        public BE.PaymentInfo InsertPaymentInfo(BE.PaymentInfo entity)
        {
            //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
            DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway();
            DA.PaymentInfo result = gateway.Insert(entity.ToDataEntity());

            // Create the audit record.
            PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic();
            auditLogic.InsertPaymentInfoAudit(result.ToBusinessEntity());

            return result.ToBusinessEntity();
        }
        //@@NEW - new method.
        public BE.PaymentInfoAudit InsertPaymentInfoAudit(BE.PaymentInfo entity)
        {
            // Create the audit record.
            BE.PaymentInfoAudit audit = new BE.PaymentInfoAudit(entity);
            // Insert the audit record.
            BE.PaymentInfoAudit result = InsertPaymentInfoAudit(audit);

            if (Guid.Empty == result.PaymentInfoAuditGuid)
                throw new BE.PaymentInfoAuditException("PaymentInfo Audit record was not inserted.", audit);

            return result;
        }
Beispiel #19
0
        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();
        }
Beispiel #20
0
        //@@NEW - new method.
        public BE.ClientAudit InsertClientAudit(BE.Client entity)
        {
            // Create the audit record.
            BE.ClientAudit audit = new BE.ClientAudit(entity);
            audit.AccountPaused = entity.AccountPaused;
            // Insert the audit record.
            BE.ClientAudit result = InsertClientAudit(audit);

            if (Guid.Empty == result.ClientAuditGuid)
                throw new BE.ClientAuditException("Client Audit record was not inserted.", audit);

            return result;
        }
Beispiel #21
0
        public BE.CityStateZip InsertCityStateZip(BE.CityStateZip entity)
        {
            //@@NEW
            // Check if a CityStateZip already exists with this ZipCode.
            BE.CityStateZip existingEntity = GetCityStateZipCodeByZipCode(entity.ZipCode);
            DA.CityStateZipGateway gateway = new DA.CityStateZipGateway();
            if (null != existingEntity)
            {// existing entity - problematic if first entry contains wrong city/state
                if (!existingEntity.Equals(entity))
                {// argument entity contains different city/state => update with these values
                    //// entity comes without guid from UI
                    entity.CityStateZipGuid = existingEntity.CityStateZipGuid;
                    gateway.Update(entity.ToDataEntity());
                    // should return new value
                    existingEntity = this.GetCityStateZipCodeByZipCode(entity.ZipCode);
                }

                return existingEntity;
            }

            //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
            DA.CityStateZip result = gateway.Insert(entity.ToDataEntity());
            return result.ToBusinessEntity();
        }
Beispiel #22
0
 public void UpdateCityStateZip(BE.CityStateZip entity)
 {
     DA.CityStateZipGateway gateway = new DA.CityStateZipGateway();
     gateway.Update(entity.ToDataEntity());
 }
Beispiel #23
0
        public void UpdateClient(BE.Client entity)
        {
            StripPhoneNumber(entity);
            // Update the main record.
            DA.ClientGateway gateway = new DA.ClientGateway();
            gateway.Update(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            ClientAuditLogic auditLogic = new ClientAuditLogic();
            auditLogic.InsertClientAudit(entity);
        }
Beispiel #24
0
        private void StripPhoneNumber(BE.Client entity)
        {
            if (null == entity)
            {
                entity.PhoneNumber = string.Empty;
                return;
            }

            System.Text.StringBuilder result = new System.Text.StringBuilder();
            foreach (char c in entity.PhoneNumber)
            {
                if (char.IsNumber(c))
                    result.Append(c);
            }
            entity.PhoneNumber = result.ToString().Substring(0, 10).PadLeft(10);
        }
Beispiel #25
0
 public void DeleteCityStateZip(BE.CityStateZip entity)
 {
     DA.CityStateZipGateway gateway = new DA.CityStateZipGateway();
     gateway.Delete(entity.CityStateZipGuid);
 }
Beispiel #26
0
 private void StripPhoneNumber(BE.Facility entity)
 {
     System.Text.StringBuilder result = new System.Text.StringBuilder();
     foreach (char c in entity.PhoneNumber)
     {
         if (char.IsNumber(c))
             result.Append(c);
     }
     entity.PhoneNumber = result.ToString().Substring(0, 10).PadLeft(10);
 }
Beispiel #27
0
        public void UpdateFacility(BE.Facility entity)
        {
            StripPhoneNumber(entity);
            // Update the main record.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            gateway.Update(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(entity);
        }
Beispiel #28
0
        public BE.Facility InsertFacility(BE.Facility entity)
        {
            StripPhoneNumber(entity);
            //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity.
            DA.FacilityGateway gateway = new DA.FacilityGateway();
            DA.Facility result = gateway.Insert(entity.ToDataEntity());

            //@@NEW
            // Create the audit record.
            FacilityAuditLogic auditLogic = new FacilityAuditLogic();
            auditLogic.InsertFacilityAudit(result.ToBusinessEntity());

            return result.ToBusinessEntity();
        }
Beispiel #29
0
 public void DeleteFacilityPhoto(BE.FacilityPhoto entity)
 {
     DA.FacilityPhotoGateway gateway = new DA.FacilityPhotoGateway();
     gateway.Delete(entity.FacilityPhotoGuid);
 }
Beispiel #30
0
 public void UpdateFacilityPhoto(BE.FacilityPhoto entity)
 {
     DA.FacilityPhotoGateway gateway = new DA.FacilityPhotoGateway();
     gateway.Update(entity.ToDataEntity());
 }