Esempio n. 1
0
        private void SetOldSetting(MappingFields field, string value)
        {
            if (LdapMapping == null)
            {
                LdapMapping = new Dictionary <MappingFields, string>();
            }

            if (string.IsNullOrEmpty(value))
            {
                if (LdapMapping.ContainsKey(field))
                {
                    LdapMapping.Remove(field);
                }
                return;
            }

            if (LdapMapping.ContainsKey(field))
            {
                LdapMapping[field] = value;
            }
            else
            {
                LdapMapping.Add(field, value);
            }
        }
Esempio n. 2
0
        public bool Execute(ContactRoot value, List <MappingFields> mapping, int index = 0)
        {
            Func <MappingFields, string, bool> filter = (e, f) => FilterEntity(e.Entity) && e.Id == index && e.Field.Equals(f);

            if (!mapping.Exists(e => filter(e, "First Name")))
            {
                MappingFields field = mapping.Where(w => filter(w, "Last Name")).First();
                mapping.Add(new MappingFields {
                    Entity = ENTITY, Field = "First Name", Id = index, Value = field.Value.Split(' ').First()
                });
                mapping.Where(w => filter(w, "Last Name")).First().Value = field.Value.Split(' ').Last();
            }
            return(SendRequestSave(value, mapping.Where(w => FilterEntity(w.Entity) && w.Id == index).ToList(), GetResponse));
        }
Esempio n. 3
0
        private string GetOldSetting(MappingFields field)
        {
            if (LdapMapping == null)
            {
                LdapMapping = new Dictionary <MappingFields, string>();
            }

            if (LdapMapping.ContainsKey(field))
            {
                return(LdapMapping[field]);
            }
            else
            {
                return("");
            }
        }