Пример #1
0
 private void SetRules()
 {
     try
     {
         DataFormLoadRequest dataFormLoadRequest = new DataFormLoadRequest();
         dataFormLoadRequest.FormID          = new Guid("c22b08b6-eb30-4026-95da-ef4f010ddeaf");
         dataFormLoadRequest.SecurityContext = this.GetRequestSecurityContext();
         DataFormLoadReply dataFormLoadReply = ServiceMethods.DataFormLoad(dataFormLoadRequest, this.GetRequestContext());
         _customModel.NAMECODE.Value              = (DuplicateResolutionUIModel.NAMECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NAMECODE"].Value);
         _customModel.SIMILARADDRESSCODE.Value    = (DuplicateResolutionUIModel.SIMILARADDRESSCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["SIMILARADDRESSCODE"].Value);
         _customModel.UNSIMILARADDRESSCODE.Value  = (DuplicateResolutionUIModel.UNSIMILARADDRESSCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["UNSIMILARADDRESSCODE"].Value);
         _customModel.NEWADDRESSPRIMARYCODE.Value = (DuplicateResolutionUIModel.NEWADDRESSPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWADDRESSPRIMARYCODE"].Value);
         _customModel.DIFFERENTPHONECODE.Value    = (DuplicateResolutionUIModel.DIFFERENTPHONECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["DIFFERENTPHONECODE"].Value);
         _customModel.NEWPHONEPRIMARYCODE.Value   = (DuplicateResolutionUIModel.NEWPHONEPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWPHONEPRIMARYCODE"].Value);
         _customModel.DIFFERENTEMAILCODE.Value    = (DuplicateResolutionUIModel.DIFFERENTEMAILCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["DIFFERENTEMAILCODE"].Value);
         _customModel.NEWEMAILPRIMARYCODE.Value   = (DuplicateResolutionUIModel.NEWEMAILPRIMARYCODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["NEWEMAILPRIMARYCODE"].Value);
         _customModel.BIRTHDATERULECODE.Value     = (DuplicateResolutionUIModel.BIRTHDATERULECODES)Conversions.ToInteger(dataFormLoadReply.DataFormItem.Values["BIRTHDATERULECODE"].Value);
     }
     catch (Exception expr_1DA)
     {
         ProjectData.SetProjectError(expr_1DA);
         Exception ex = expr_1DA;
         throw new InvalidUIModelException(ex.Message);
     }
 }
Пример #2
0
        //Gets Default CountryID
        private Guid GetDefaultCountryID()
        {
            DataFormLoadRequest request = new DataFormLoadRequest
            {
                FormID          = DEFAULTCOUNTRY_VIEWFORMID,
                IncludeMetaData = false
            };
            DataFormLoadReply reply = default(DataFormLoadReply);
            Guid countryID          = Guid.Empty;

            reply = ServiceMethods.DataFormLoad(request, _model.GetRequestContext());

            if (reply.DataFormItem.TryGetValue("COUNTRYID", ref countryID))
            {
                return(countryID);
            }

            return(Guid.Empty);
        }
Пример #3
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;
                    }
                }
            }
        }
Пример #4
0
        //Function to switch the lookup id and constituent name as per search
        public static void SwitchConstituentMIMED(UMHSDataERBBatchEntryHandler handler, Blackbaud.AppFx.UIModeling.Core.UIModel batchModel, Guid MedConstituentId, string donorinfo)
        {
            DataFormLoadRequest reqlkpid = new DataFormLoadRequest
            {
                FormID   = MIMEDDataViewForm,
                RecordID = MedConstituentId.ToString()
            };

            DataFormLoadReply replylkpid = null;

            try
            {
                replylkpid = ServiceMethods.DataFormLoad(reqlkpid, batchModel.RootUIModel().GetRequestContext());
            }
            catch (Exception ex)
            {
                throw ex; //nom nom nom
            }

            //' Save the current constituent's name and guid and lookupid before we start changing anything
            Guid   currentConstituentId   = Guid.Parse(GetValueFromFieldID(batchModel, "CONSTITUENTID", null).ToString());
            string currentConstituentName = GetValueTranslationFromFieldID(batchModel, "CONSTITUENTID", null);
            string currentLookupId        = GetValueTranslationFromFieldID(batchModel, "CONSTITUENTLOOKUPID", null);

            if (donorinfo.Length > 0)
            {
                if (donorinfo.Contains("N:"))
                {
                    string[] s = donorinfo.Split(char.Parse("|"));
                    foreach (string i in s)
                    {
                        if ((i.Contains("N:")))
                        {
                            donorinfo = i.Substring(4);
                        }
                    }
                }
            }

            //AndAlso replyname IsNot Nothing AndAlso replyname.PageData IsNot Nothing Then
            if (replylkpid != null && replylkpid.DataFormItem != null)
            {
                DataFormFieldValue dfv = null;
                //Dim dfn As DataFormFieldValue = Nothing
                string name     = string.Empty;
                string lookupid = string.Empty;
                //If replyname.PageData.TryGetValue("NAME", dfn) AndAlso dfn IsNot Nothing AndAlso dfn.Value IsNot Nothing Then
                if ((donorinfo != null) || !string.IsNullOrEmpty(donorinfo))
                {
                    name = donorinfo;
                }
                //End If
                if (replylkpid.DataFormItem.TryGetValue("LOOKUPID", ref dfv) && dfv != null && dfv.Value != null)
                {
                    lookupid = dfv.Value.ToString();
                }

                //SET Constituent Name
                //' UIModel allows us to easily move values from the related constituent form to the batch row
                TrySetValueForFieldID(batchModel, "CONSTITUENTID", MedConstituentId, name);
                TrySetValueForFieldID(batchModel, "CONSTITUENTLOOKUPID", MedConstituentId, lookupid);
            }
            handler.UpdateContextWindow();
        }