Exemplo n.º 1
0
        public void UpdateAgency(EditAgencyViewData viewData)
        {
            if (viewData == null)
            {
                throw new ArgumentNullException("viewData");
            }

            Data.UpdateAgency(Mapper.Map <EditAgencyViewData, Agency>(viewData));
        }
Exemplo n.º 2
0
        public static AgencyLocation ToAgencyLocation(this EditAgencyViewData viewData)
        {
            if (viewData == null)
            {
                return(null);
            }

            var agencyLocation = new AgencyLocation
            {
                ActiveInactiveDate = viewData.ActiveInactiveDate,
                Comments           = viewData.Comments,
                ContactFirstName   = viewData.SponsorFirstName,
                ContactMiddleName  = viewData.SponsorMiddleName,
                ContactLastName    = viewData.SponsorLastName,
                ContactTitle       = viewData.SponsorTitle,
                CreatedBy          = viewData.CreatedBy,
                CreatedDate        = viewData.CreatedDate,
                Fax = viewData.Fax,
                HoursOfOperation = viewData.HoursOfOperation,
                IsActive         = viewData.IsActive,
                IsMainOffice     = true,
                LastUpdatedBy    = viewData.LastUpdatedBy,
                LastUpdatedDate  = viewData.LastUpdatedDate,
                LocationName     = viewData.Name,
                PrimaryEmail     = viewData.PrimaryEmail,
                PrimaryPhone     = viewData.PrimaryPhone,
                SecondaryEmail   = viewData.SecondaryEmail,
                SecondaryPhone   = viewData.SecondaryPhone,
                TDD           = viewData.TDD,
                TollFreePhone = viewData.TollFreePhone,
                TollFreeTDD   = viewData.TollFreeTDD,
                //Added by Lavanya
                AvailableLanguages   = viewData.AvailableLanguages,
                HideAgencyFromSearch = viewData.HideAgencyFromSearch,
                //end
                PhysicalAddress = new AgencyAddress
                {
                    Address1 = viewData.PhysicalAddress1,
                    Address2 = viewData.PhysicalAddress2,
                    City     = viewData.PhysicalCity,
                    County   = new County {
                        Code = viewData.PhysicalCountyFIPS
                    },
                    CreatedBy       = viewData.CreatedBy,
                    CreatedDate     = viewData.CreatedDate,
                    LastUpdatedBy   = viewData.LastUpdatedBy,
                    LastUpdatedDate = viewData.LastUpdatedDate,
                    State           = viewData.State,
                    Zip             = viewData.PhysicalZip,
                    //Added by Lavanya
                    Longitude = viewData.Longitude,
                    Latitude  = viewData.Latitude
                                //end
                },
                MailingAddress = new AgencyAddress
                {
                    Address1        = viewData.MailingAddress1,
                    Address2        = viewData.MailingAddress2,
                    City            = viewData.MailingCity,
                    CreatedBy       = viewData.CreatedBy,
                    CreatedDate     = viewData.CreatedDate,
                    LastUpdatedBy   = viewData.LastUpdatedBy,
                    LastUpdatedDate = viewData.LastUpdatedDate,
                    State           = viewData.MailingState,
                    Zip             = viewData.MailingZip
                },
            };

            return(agencyLocation);
        }