Пример #1
0
        public virtual int CaptureLead(AllFieldCapture lead)
        {
            t_common_leads commonLead = new t_common_leads()
            {
                title = lead.title,
                first_name = lead.first_name,
                last_name = lead.last_name,
                city = lead.city,
                postcode = lead.postcode,
                Home_Mobile_Phone1 = lead.Home_Mobile_Phone1,
                Home_Mobile_Phone2 = lead.Home_Mobile_Phone2,
                address = lead.address,
                email = lead.email,
                product_id = lead.product_id,
                ip_address = lead.ip_address,
                source = lead.source,
                match_type = lead.match_type,
                keyword = lead.keyword,
                lead_status =lead.lead_status

            };

            int leadId = _saveLead.SaveLeadDetails<t_common_leads>(commonLead);
            commonLead.lead_id = leadId;
            _leadScreen.ScreenLead(commonLead);

            return leadId;
        }
Пример #2
0
        private bool SpamCheck90Days(t_common_leads lead)
        {
            GenericRepository<t_common_leads> gnr = new GenericRepository<t_common_leads>(new sherlockEntities());

            List<t_common_leads> spamEmails = (List<t_common_leads>)gnr.GetMany(x =>
               x.first_name.Equals(lead.first_name)
               && x.last_name.Equals(lead.last_name)
            );

            if (spamEmails.Count > 0)
                return true;

            return false;
        }
Пример #3
0
        public int FilterSpam(t_common_leads lead)
        {
            //??
            //lead.email is the modified email id; it was passed from screening // nw i nd ths mdf_fild for spam checking

            if ((SpamFlagName(lead.first_name)) || (SpamFlagName(lead.last_name)) &&
                (SpamFlagPhone(lead.Home_Mobile_Phone1)) || (SpamFlagPhone(lead.Home_Mobile_Phone2))
                && SpamFlagEmail(lead.email) && SpamFlagIp(lead.ip_address) )
            {
                lead.lead_status = "Spam";
            }

            if(SpamCheck90Days())
            {
                lead.lead_status = "Duplicate Entry";
            }

            int leadId = _modifyValue.ModifyLeadValues<t_common_leads>(lead);

            return leadId;
        }
Пример #4
0
        public int ScreenLead(t_common_leads lead)
        {
            lead.first_name = (string.IsNullOrEmpty(lead.first_name)) ? "" : Regex.Replace(lead.first_name, @"[^a-zA-Z_]+", "");//remove special character and replace by space

            lead.last_name = (string.IsNullOrEmpty(lead.last_name)) ? "" : Regex.Replace(lead.last_name, @"[^a-zA-Z_]+", "");

            lead.Home_Mobile_Phone1 = (string.IsNullOrEmpty(lead.Home_Mobile_Phone1)) ? "" : Regex.Replace(lead.Home_Mobile_Phone1, @"[^0-9]", "").Replace("+44", "0044");

            lead.Home_Mobile_Phone2 = (string.IsNullOrEmpty(lead.Home_Mobile_Phone2)) ? "" : Regex.Replace(lead.Home_Mobile_Phone2, @"[^0-9]", "").Replace("+44", "0044");

            lead.city = (string.IsNullOrEmpty(lead.city)) ? "" : Regex.Replace(lead.city, @"[^a-zA-Z-]+[^\s]+", "");

            lead.postcode = (string.IsNullOrEmpty(lead.postcode)) ? "" : Regex.Replace(lead.postcode, @"[^0-9a-zA-Z ]+", "");

            lead.address = (string.IsNullOrEmpty(lead.postcode)) ? "" : Regex.Replace(lead.address, @"[^0-9a-zA-Z-,' ]+", "");

            lead.email = (string.IsNullOrEmpty(lead.email)) ? "" : isValidEmail(lead.email);

            int leadId = _spamFilter.FilterSpam(lead);

            return leadId;
        }