Esempio n. 1
0
        protected virtual SimilarSearchXmlMatch GetLeadXmlMatchingg()
        {
            var matching = new SimilarSearchXmlMatch();

            matching.SourceSchemaName      = "Lead";
            matching.DestinationSchemaName = "Lead";
            var entityColumns = new Dictionary <string, SimilarSearchXmlMatch.Rule>();

            entityColumns["Contact"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Contact",
                SchemaName = "Lead"
            };
            entityColumns["Account"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Account",
                SchemaName = "Lead"
            };
            entityColumns["Email"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Email",
                SchemaName = "Lead"
            };
            entityColumns["BusinesPhone"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "BusinesPhone",
                SchemaName = "Lead"
            };
            entityColumns["MobilePhone"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "MobilePhone",
                SchemaName = "Lead"
            };
            entityColumns["Website"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Website",
                SchemaName = "Lead"
            };
            entityColumns["City"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "CityId",
                SchemaName = "Lead"
            };
            entityColumns["Country"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "CountryId",
                SchemaName = "Lead"
            };
            entityColumns["LeadType"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "LeadTypeId",
                SchemaName = "Lead"
            };
            matching.EntityColumns = entityColumns;
            return(matching);
        }
Esempio n. 2
0
        /// <summary>
        /// Create XML used for search similar records.
        /// </summary>
        /// <param name="entity">Entity.</param>
        /// <param name="xmlMatch">Columns matching for create search values.</param>
        /// <returns>XML for search similar records.</returns>
        public virtual XmlDocument CreateXmlSimilarSearchValue(Entity entity, SimilarSearchXmlMatch xmlMatch)
        {
            XmlDocument xmlConfig = new XmlDocument();
            XmlElement  columns   = xmlConfig.CreateElement("columns");

            xmlConfig.AppendChild(columns);
            foreach (var configItem in xmlMatch.EntityColumns)
            {
                SimilarSearchXmlMatch.Rule rule = configItem.Value;
                string     leadColumnName       = entity.Schema.Columns.GetByName(configItem.Key).ColumnValueName;
                object     columnValue          = entity.GetColumnValue(leadColumnName);
                XmlElement column = CreateSimilarSearchXmlItem(rule.SchemaName, xmlMatch.DestinationSchemaName,
                                                               rule.TypeId, rule.ColumnName, columnValue, xmlConfig);
                columns.AppendChild(column);
            }
            return(xmlConfig);
        }
Esempio n. 3
0
        protected virtual SimilarSearchXmlMatch GetLeadToAccountXmlMatching()
        {
            var matching = new SimilarSearchXmlMatch();

            matching.SourceSchemaName      = "Lead";
            matching.DestinationSchemaName = "Account";
            var entityColumns = new Dictionary <string, SimilarSearchXmlMatch.Rule>();

            entityColumns["Account"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Name",
                SchemaName = "Account"
            };
            entityColumns["Email"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Number",
                SchemaName = "AccountCommunication",
                TypeId     = Guid.Parse(CommunicationTypeConsts.EmailId)
            };
            entityColumns["BusinesPhone"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "SearchNumber",
                SchemaName = "AccountCommunication",
                TypeId     = Guid.Parse(CommunicationTypeConsts.WorkPhoneId)
            };
            entityColumns["MobilePhone"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "SearchNumber",
                SchemaName = "AccountCommunication",
                TypeId     = Guid.Parse(CommunicationTypeConsts.MobilePhoneId)
            };
            entityColumns["Website"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "Number",
                SchemaName = "AccountCommunication",
                TypeId     = Guid.Parse(CommunicationTypeConsts.WebId)
            };
            entityColumns["City"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "CityId",
                SchemaName = "AccountAddress"
            };
            entityColumns["Country"] = new SimilarSearchXmlMatch.Rule {
                ColumnName = "CountryId",
                SchemaName = "AccountAddress"
            };
            matching.EntityColumns = entityColumns;
            return(matching);
        }