コード例 #1
0
        public override async Task Initialize()
        {
            FirstName        = Prospect.FirstName;
            LastName         = Prospect.LastName;
            MiddleName       = Prospect.MiddleName;
            NickName         = Prospect.NickName;
            StreetAddress    = Prospect.StreetAddress == null ? new StreetAddress() : Prospect.StreetAddress.ShallowCopy();
            FollowUpSettings = Prospect.FollowUpSettings.ShallowCopy();
            MobilePhone      = Prospect.MobilePhoneNumber == null ? new PhoneNumber() : Prospect.MobilePhoneNumber.ShallowCopy();
            WorkPhone        = Prospect.WorkPhoneNumber == null ? new PhoneNumber() : Prospect.WorkPhoneNumber.ShallowCopy();
            HomePhone        = Prospect.HomePhoneNumber == null ? new PhoneNumber() : Prospect.HomePhoneNumber.ShallowCopy();
            Email            = Prospect.Email == null ? new Email() : Prospect.Email.ShallowCopy();

            _originalProspect = Prospect.ShallowCopy();
            _originalProspect.FollowUpSettings  = FollowUpSettings.ShallowCopy();
            _originalProspect.StreetAddress     = StreetAddress.ShallowCopy();
            _originalProspect.MobilePhoneNumber = MobilePhone.ShallowCopy();
            _originalProspect.WorkPhoneNumber   = WorkPhone.ShallowCopy();
            _originalProspect.HomePhoneNumber   = HomePhone.ShallowCopy();
            _originalProspect.Email             = Email.ShallowCopy();

            Prefixes     = (await _userDefinedCodeService.GetPrefixUserDefinedCodes()).ToObservableCollection();
            ActivePrefix = Prefixes.FirstOrDefault(p => p.Description1 == Prospect.NamePrefix);

            Suffixes     = (await _userDefinedCodeService.GetSuffixUserDefinedCodes()).ToObservableCollection();
            ActiveSuffix = Suffixes.FirstOrDefault(p => p.Description1 == Prospect.NameSuffix);

            ContactPreferences      = (await _userDefinedCodeService.GetContactPreferenceUserDefinedCodes()).ToObservableCollection();
            ActiveContactPreference = ContactPreferences.FirstOrDefault(p => p.Description1 == Prospect.FollowUpSettings.PreferredContactMethod);

            ExcludeReasons      = (await _userDefinedCodeService.GetExcludeReasonUserDefinedCodes()).ToObservableCollection();
            ActiveExcludeReason = ExcludeReasons.FirstOrDefault(p => p.Code == Prospect.FollowUpSettings.ExcludeReason);

            States      = (await _userDefinedCodeService.GetStateUserDefinedCodes()).ToObservableCollection();
            ActiveState = Prospect.StreetAddress != null?States.FirstOrDefault(p => p.Code == Prospect.StreetAddress.State) : null;

            Countries     = (await _userDefinedCodeService.GetCountryUserDefinedCodes()).ToObservableCollection();
            ActiveCountry = Prospect.StreetAddress != null?Countries.FirstOrDefault(p => p.Code == Prospect.StreetAddress.Country) : null;

            TrafficSources      = (await _trafficSourceService.GetTrafficSourcesByDivision(Prospect.ProspectCommunity.Division)).ToObservableCollection();
            ActiveTrafficSource = TrafficSources.FirstOrDefault(t => t.TrafficSourceDetails.Any(td => td.CodeId == Prospect.TrafficSourceCodeId));
            if (ActiveTrafficSource != null)
            {
                ActiveTrafficSourceDetail = ActiveTrafficSource.TrafficSourceDetails.First(td => td.CodeId == Prospect.TrafficSourceCodeId);
            }
        }
コード例 #2
0
        public override async Task Initialize()
        {
            _user = await _userService.GetLoggedInUser();

            _originalCobuyer = Cobuyer.ShallowCopy();
            _originalCobuyer.StreetAddress     = StreetAddress.ShallowCopy();
            _originalCobuyer.MobilePhoneNumber = MobilePhone.ShallowCopy();
            _originalCobuyer.WorkPhoneNumber   = WorkPhone.ShallowCopy();
            _originalCobuyer.HomePhoneNumber   = HomePhone.ShallowCopy();
            _originalCobuyer.Email             = Email.ShallowCopy();

            Prefixes     = (await _userDefinedCodeService.GetPrefixUserDefinedCodes()).ToObservableCollection();
            ActivePrefix = Prefixes.FirstOrDefault(p => p.Description1 == Cobuyer.NamePrefix);

            Suffixes     = (await _userDefinedCodeService.GetSuffixUserDefinedCodes()).ToObservableCollection();
            ActiveSuffix = Suffixes.FirstOrDefault(p => p.Description1 == Cobuyer.NameSuffix);

            States      = (await _userDefinedCodeService.GetStateUserDefinedCodes()).ToObservableCollection();
            ActiveState = Cobuyer.StreetAddress != null?States.FirstOrDefault(p => p.Code == Cobuyer.StreetAddress.State) : null;

            Countries     = (await _userDefinedCodeService.GetCountryUserDefinedCodes()).ToObservableCollection();
            ActiveCountry = Cobuyer.StreetAddress != null?Countries.FirstOrDefault(p => p.Code == Cobuyer.StreetAddress.Country) : null;
        }