private void GetSelectionArea(FormType formType, SubStateReportType subStateType)
        {
            if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) &&
                (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                Agencies = AgencyLogic.GetAgencies(DefaultState.Code);
                var _agencies = new List <KeyValuePair <string, string> >();
                _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value)))));
                DynamicSubStateRegions = _agencies;
            }

            else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) &&
                     (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code);
            }


            else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) &&
                     (formType == FormType.ClientContact))
            {
                IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code);
                var _zips = new List <KeyValuePair <string, string> >();
                _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode)))));
                DynamicSubStateRegions = _zips;
            }
        }
Exemple #2
0
        /// <summary>
        /// Binds the dependent data for the form.
        /// </summary>
        protected void BindDependentData()
        {
            DynamicSubStateRegions = null;
            States = AgencyLogic.GetStates();

            DropDownList ctrlForm  = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListFormType");
            int          _formType = Convert.ToInt32(ctrlForm.SelectedValue);


            DropDownList ctrlGroup  = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListGroupype");
            int          _groupType = Convert.ToInt32(ctrlGroup.SelectedValue);

            if (_groupType > 0 && _formType > 0)
            {
                FormType           formType     = (FormType)_formType;
                SubStateReportType subStateType = (SubStateReportType)_groupType;


                if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) &&
                    (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
                {
                    Agencies = AgencyLogic.GetAgencies(DefaultState.Code);
                    var _agencies = new List <KeyValuePair <string, string> >();
                    _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value)))));
                    DynamicSubStateRegions = _agencies;
                }

                else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) &&
                         (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
                {
                    DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code);
                }


                else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) &&
                         (formType == FormType.ClientContact))
                {
                    IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code);
                    var _zips = new List <KeyValuePair <string, string> >();
                    _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode)))));
                    DynamicSubStateRegions = _zips;
                }
            }
        }