private decimal ScoreSingleRule(FraudCheckData data, FraudRule rule) { decimal result = 0; switch (rule.RuleType) { case FraudRuleType.CreditCardNumber: if (rule.RuleValue == data.CreditCard) { result += 7; data.Messages.Add("Credit Card Matched Fraud Rules"); } break; case FraudRuleType.DomainName: if (rule.RuleValue == data.DomainName) { result += 3; data.Messages.Add("Domain Matched Fraud Rules"); } break; case FraudRuleType.EmailAddress: if (rule.RuleValue == data.EmailAddress) { result += 5; data.Messages.Add("Email Address Matched Fraud Rules"); } break; case FraudRuleType.IPAddress: if (rule.RuleValue == data.IpAddress) { result += 1; data.Messages.Add("IP Address Fraud Rules"); } break; case FraudRuleType.PhoneNumber: if (rule.RuleValue == data.PhoneNumber) { result += 3; data.Messages.Add("Phone Number Matched Fraud Rules"); } break; } return(result); }
private decimal ScoreSingleRule(FraudCheckData data, FraudRule rule) { decimal result = 0; switch (rule.RuleType) { case FraudRuleType.CreditCardNumber: if (rule.RuleValue == data.CreditCard) { result += 7; data.Messages.Add("Credit Card Matched Fraud Rules"); } break; case FraudRuleType.DomainName: if (rule.RuleValue == data.DomainName) { result += 3; data.Messages.Add("Domain Matched Fraud Rules"); } break; case FraudRuleType.EmailAddress: if (rule.RuleValue == data.EmailAddress) { result += 5; data.Messages.Add("Email Address Matched Fraud Rules"); } break; case FraudRuleType.IPAddress: if (rule.RuleValue == data.IpAddress) { result += 1; data.Messages.Add("IP Address Fraud Rules"); } break; case FraudRuleType.PhoneNumber: if (rule.RuleValue == data.PhoneNumber) { result += 3; data.Messages.Add("Phone Number Matched Fraud Rules"); } break; } return result; }
//CreditCard Number protected void btnNewCCNumber_Click(System.Object sender, System.Web.UI.ImageClickEventArgs e) { if (this.CreditCardField.Text.Trim().Length > 0) { FraudRule r = new FraudRule(); r.RuleType = FraudRuleType.CreditCardNumber; r.RuleValue = this.CreditCardField.Text.Trim().ToLower(); repository.Create(r); } LoadLists(); }
//Email Address protected void btnNewEmail_Click(System.Object sender, System.Web.UI.ImageClickEventArgs e) { if (this.EmailField.Text.Trim().Length > 0) { FraudRule r = new FraudRule(); r.RuleType = FraudRuleType.EmailAddress; r.RuleValue = this.EmailField.Text.Trim().ToLower(); repository.Create(r); } LoadLists(); }