Example #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);
     }
 }
Example #2
0
        private IEnumerable <string> GetPackageDependencies(AppFxWebService appFxService, ClientAppInfoHeader header, ItemInfo itemToLoad)
        {
            Log.LogMessage("Reading package spec '{0}' (ID: {1})", itemToLoad.ItemName, itemToLoad.ItemId);

            DataFormLoadRequest dfLoadReq = new DataFormLoadRequest();

            dfLoadReq.ClientAppInfo = header;
            dfLoadReq.FormID        = new Guid("8dcaab58-3b6a-405a-9430-5d07cb000d22"); // Catalog Item Xml View Form
            dfLoadReq.RecordID      = string.Format("5|{0}", itemToLoad.ItemId);        // Record ID is "[item type code]|[item ID]"

            DataFormLoadReply dfLoadReply = appFxService.DataFormLoad(dfLoadReq);

            if (dfLoadReply == null)
            {
                throw new Exception("Null reply from DataFormLoad.");
            }

            // Get item XML
            string      itemXml = dfLoadReply.DataFormItem.Values.Where(x => x.ID == "ITEMXML").Select(x => x.Value.ToString()).FirstOrDefault();
            XmlDocument xmlDoc  = new XmlDocument();

            xmlDoc.LoadXml(itemXml);

            // Load <Dependency> nodes, add items to load to list
            XmlNamespaceManager nsMgr = new XmlNamespaceManager(xmlDoc.NameTable);

            nsMgr.AddNamespace("c", "bb_appfx_commontypes");

            XmlNodeList nodeList = xmlDoc.SelectNodes("//c:Dependency", nsMgr);

            if (nodeList.Count <= 0)
            {
                Log.LogWarning("Failed to find any Dependency nodes in package spec.");
            }

            List <string> itemsFromPackageSpec = new List <string>();

            foreach (XmlNode dependencyNode in nodeList)
            {
                itemsFromPackageSpec.Add(dependencyNode.Attributes["CatalogItem"].Value);
            }

            return(itemsFromPackageSpec);
        }
Example #3
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);
        }
Example #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();
        }