Ejemplo n.º 1
0
        private LaunderingAccountModel ScanCountry(List <LaunderingInformationModel> model, string country)
        {
            var eachCountry = new LaunderingAccountModel();

            eachCountry.Country = country;
            var customers = model.Where(r => r.Country == country).ToList();
            var numbers   = customers.Select(r => r.CustomerId).Distinct().ToList();

            foreach (var numb in numbers)
            {
                eachCountry.Customer.Add(ScanCustomer(model, numb));
            }
            return(eachCountry);
        }
Ejemplo n.º 2
0
        public string BuildEmailReport(LaunderingAccountModel scanResult)
        {
            var message = new MailMessage();

            message.IsBodyHtml = false;
            var customerInfo = "";

            foreach (var customer in scanResult.Customer)
            {
                customerInfo += $"{Environment.NewLine}{Environment.NewLine}{customer.GivenName} {customer.SureName}, over limit Last 72 hours: {customer.overLimitLast72Hours} {Environment.NewLine}{Environment.NewLine}";
                foreach (var account in customer.Account)
                {
                    customerInfo += $"{Environment.NewLine}accountId: {account.AccountId} {Environment.NewLine}{Environment.NewLine}Transactions:{Environment.NewLine}{Environment.NewLine}";
                    var distinctTransactions = account.Transactions.Select(r => r.TransactionId).Distinct().ToList();
                    foreach (var transaction in distinctTransactions)
                    {
                        customerInfo += $"{transaction} ";
                    }
                }
            }
            return(message.Body = $"country: {scanResult.Country} {Environment.NewLine}{customerInfo}");
        }