Esempio n. 1
0
        private void _countryid_ValueChanged(object sender, ValueChangedEventArgs e)
        {
            if (!_countryId.Model.RootUIModel().Loading)
            {
                _stateid.Value = Guid.Empty;
            }

            _stateid.ResetDataSource();

            CountryGetFormatsReply     _countryFormats = GetCountryFormats(_model.GetRequestContext());
            CountryGetFormatsFormatRow labelRow        = GetCountryFormatRow(_countryFormats, _countryId.Value);

            if (labelRow != null)
            {
                _city.Caption     = labelRow.City;
                _stateid.Caption  = labelRow.State;
                _postcode.Caption = labelRow.PostCode;
            }
        }
Esempio n. 2
0
        internal void Init()
        {
            List <string> keyNameCaptionTypes = new List <string>(3);

            if (_includeindividuals.Value)
            {
                _numConstituentTypesAllowed += 1;
            }
            if (_includeorganizations.Value)
            {
                _numConstituentTypesAllowed += 1;
            }
            if (_includegroups.Value)
            {
                _numConstituentTypesAllowed += 1;
            }

            if (!_includeorganizations.Enabled)
            {
                _includeOrgIsEnabled = false;
            }

            if (_includeindividuals.Value)
            {
                keyNameCaptionTypes.Add("Last");
            }

            if (_includeorganizations.Value)
            {
                if (_numConstituentTypesAllowed == 1)
                {
                    keyNameCaptionTypes.Add("Organization");
                }
                else
                {
                    keyNameCaptionTypes.Add("Org");
                }
            }

            if (_includegroups.Value)
            {
                if (_excludecustomgroups.Value)
                {
                    keyNameCaptionTypes.Add("Household");
                }
                else if (_numConstituentTypesAllowed == 1)
                {
                    keyNameCaptionTypes.Add("Group/Household");
                }
                else
                {
                    keyNameCaptionTypes.Add("Group");
                }
            }

            EnableConstituentTypeOptions();

            _keyname.Caption = string.Format("{0} name", Strings.Join(keyNameCaptionTypes.ToArray(), "/"));

            if (_excludecustomgroups.Value)
            {
                _includegroups.Caption = "Households";
            }
            else if (_excludehouseholds.Value)
            {
                _includegroups.Caption = "Groups";
            }

            DataFormLoadRequest req = new DataFormLoadRequest {
                FormID = new Guid("12c490b6-5f6b-4eab-85a7-3c38ee492b44")
            };
            dynamic reply = ServiceMethods.DataFormLoad(req, _model.GetRequestContext());


            //BVS-SOTEY commented out

            //bool AVAILABLEZIPSEARCH = false;
            //if (reply.DataFormItem.TryGetValue("AVAILABLEZIPSEARCH", AVAILABLEZIPSEARCH))
            //{
            //    //Searching Postcodes is enabled based on whether there are available Zip codes to search.
            //    //Otherwise, it is just a text box to enter.
            //    _postcode.SearchEnabled = AVAILABLEZIPSEARCH;
            //}

            if (_ssn.Visible)
            {
                if (!_model.GetRequestContext().UserIsGrantedPrivilege(new Guid("d908668e-210f-47a8-bd45-ef9517e4894f")))
                {
                    _ssn.Visible = false;
                }
            }

            //Setting Labels based on Default Country
            CountryGetFormatsReply     _countryFormats = GetCountryFormats(_model.GetRequestContext());
            CountryGetFormatsFormatRow labelRow        = GetCountryFormatRow(_countryFormats, GetDefaultCountryID());

            if (labelRow != null)
            {
                _city.Caption     = labelRow.City;
                _stateid.Caption  = labelRow.State;
                _postcode.Caption = labelRow.PostCode;

                //Updating Grid Columns Header
                foreach (SearchListOutputFieldType outputField in _outputDefinition.OutputFields)
                {
                    switch (outputField.FieldID)
                    {
                    case "City":
                        outputField.Caption = labelRow.City;
                        break;

                    case "State":
                        outputField.Caption = labelRow.State;
                        break;

                    case "Postcode":
                        outputField.Caption = labelRow.PostCode;
                        break;
                    }
                }
            }
        }