Beispiel #1
0
        private static void InitialiseAccountsMster(QuickLoanDbContext context)
        {
            var accountEntries = new Accounts[]
            {
                new Accounts
                {
                    AccountNumber = "5000",
                },
                new Accounts
                {
                    AccountNumber = "6000"
                },
                new Accounts
                {
                    AccountNumber = "7000"
                },
                new Accounts
                {
                    AccountNumber = "8000"
                }
            };

            foreach (Accounts accountEntry in accountEntries)
            {
                context.Accounts.Add(accountEntry);
            }
            context.SaveChanges();
        }
Beispiel #2
0
        private static void IntialiseBanker(QuickLoanDbContext context)
        {
            var bankOfficers = new BankOfficer[]
            {
                new BankOfficer {
                    FirstName = "ERIC",
                    LastName  = "JHON",
                    Branch    = new Branch
                    {
                        BranchCode = "BR0002",
                        Name       = "Branch 2"
                    },
                    OnlineUser = new User {
                        UserId   = "eric",
                        Password = "******",
                        UserType = 1
                    }
                }
            };

            foreach (BankOfficer bo in bankOfficers)
            {
                context.BankerOfficers.Add(bo);
            }
            context.SaveChanges();
        }
Beispiel #3
0
        private static void InitialiseLoansMster(QuickLoanDbContext context)
        {
            var loanDetailsEntries = new Loans[]
            {
                new Loans()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    LoanNumber  = 0,
                    Balance     = 10000,
                    EmiDue      = 400,
                    EmiDueDate  = DateTime.Now.AddDays(3).ToString("MM/dd/yyyy"),
                    Description = "Description"
                },

                new Loans()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    LoanNumber  = 1,
                    Balance     = 20000,
                    EmiDue      = 100,
                    EmiDueDate  = DateTime.Now.AddDays(4).ToString("MM/dd/yyyy"),
                    Description = "Description"
                },

                new Loans()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    LoanNumber  = 3,
                    Balance     = 20000,
                    EmiDue      = 200,
                    EmiDueDate  = DateTime.Now.AddDays(1).ToString("MM/dd/yyyy"),
                    Description = "Description"
                },
                new Loans()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    LoanNumber  = 3,
                    Balance     = 60000,
                    EmiDue      = 300,
                    EmiDueDate  = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"),
                    Description = "Description"
                },
                new Loans()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    LoanNumber  = 3,
                    Balance     = 70000,
                    EmiDue      = 700,
                    EmiDueDate  = DateTime.Now.AddDays(2).ToString("MM/dd/yyyy"),
                    Description = "Description"
                }
            };

            foreach (Loans loanDetailsEntry in loanDetailsEntries)
            {
                context.Loans.Add(loanDetailsEntry);
            }
            context.SaveChanges();
        }
Beispiel #4
0
        private static void InitialiseShareMster(QuickLoanDbContext context)
        {
            var shareDetailsEntries = new Shares[]
            {
                new Shares()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    ShareNumber = 0,
                    Balance     = 10000,
                    Description = "Description"
                },

                new Shares()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    ShareNumber = 1,
                    Balance     = 20000,
                    Description = "Description"
                },

                new Shares()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    ShareNumber = 3,
                    Balance     = 30000,
                    Description = "Description"
                },
                new Shares()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    ShareNumber = 3,
                    Balance     = 40000,
                    Description = "Description"
                },
                new Shares()
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    ShareNumber = 3,
                    Balance     = 50000,
                    Description = "Description"
                }
            };

            foreach (Shares shareDetailsEntry in shareDetailsEntries)
            {
                context.Shares.Add(shareDetailsEntry);
            }
            context.SaveChanges();
        }
Beispiel #5
0
        public static void Initialize(QuickLoanDbContext context)
        {
            context.Database.EnsureCreated();
            //InitialiseLoanOptions(context);
            // Look for any users.
            if (context.Users.Any())
            {
                return;   // DB has been seeded
            }
            InitialiseAccount(context);

            IntialiseBanker(context);

            InitialiseLoanOptions(context);
        }
Beispiel #6
0
        private static void InitialiseAccount(QuickLoanDbContext context)
        {
            var accounts = new Account[]
            {
                new Account {
                    FirstName = "BRENNA ANNA C",
                    LastName  = "MURPHY",
                    Number    = "8976890760",
                    Addresses = new List <Address> {
                        new Address {
                            AddressType   = "PERM",
                            StreetAddress = "",
                            City          = "",
                            State         = "",
                            Country       = "",
                            ZipCode       = ""
                        },
                        new Address {
                            AddressType   = "RESI",
                            StreetAddress = "",
                            City          = "",
                            State         = "",
                            Country       = "",
                            ZipCode       = ""
                        }
                    },
                    Branch = new Branch
                    {
                        BranchCode = "BR0001",
                        Name       = "Branch 1"
                    },
                    OnlineUser = new User {
                        UserId   = "amurphy",
                        Password = "******",
                        UserType = 3
                    }
                }
            };

            foreach (Account account in accounts)
            {
                context.Accounts.Add(account);
            }
            context.SaveChanges();
        }
Beispiel #7
0
        private static void InitialiseCards(QuickLoanDbContext context)
        {
            var cards = new Cards[]
            {
                new Cards()
                {
                    CardNumber     = "7890",
                    AccountsId     = 1,
                    Type           = "CREDIT",
                    PaymentDueDate = "04/09/2018",
                    PaymentDue     = 100
                },

                new Cards()
                {
                    CardNumber     = "8942",
                    AccountsId     = 2,
                    Type           = "CREDIT",
                    PaymentDueDate = "03/03/2018",
                    PaymentDue     = 200
                },
                new Cards()
                {
                    CardNumber     = "8945",
                    AccountsId     = 3,
                    Type           = "CREDIT",
                    PaymentDueDate = "06/06/2018",
                    PaymentDue     = 90
                },
                new Cards()
                {
                    CardNumber     = "7842",
                    AccountsId     = 4,
                    Type           = "CREDIT",
                    PaymentDueDate = "05/03/2019",
                    PaymentDue     = 50
                }
            };

            foreach (Cards card in cards)
            {
                context.Cards.Add(card);
            }
            context.SaveChanges();
        }
Beispiel #8
0
 private static void InitialiseBankNames(QuickLoanDbContext context)
 {
     var BankNames = new BankNames[]
     {
         new BankNames
         {
             BankId             = 10,
             NationalIdentifier = "ABC",
             BankName           = "OBC1"
         },
         new BankNames
         {
             BankId             = 10,
             NationalIdentifier = "ABC",
             BankName           = "OBC1"
         }
     };
 }
Beispiel #9
0
        private static void InitialiseMembersMster(QuickLoanDbContext context)
        {
            var memberEntries = new Members[]
            {
                new Members
                {
                    MemberName      = "Member1",
                    LoanEligibility = 3000,
                    LastLogin       = "******",
                    IsEditable      = false,
                    InUse           = true
                },
                new Members
                {
                    MemberName      = "Member2",
                    LoanEligibility = 4000,
                    LastLogin       = "******",
                    IsEditable      = false,
                    InUse           = true
                },
                new Members
                {
                    MemberName      = "Member3",
                    LoanEligibility = 1000,
                    LastLogin       = "******",
                    IsEditable      = true,
                    InUse           = false
                },
                new Members
                {
                    MemberName      = "Member4",
                    LoanEligibility = 2000,
                    LastLogin       = "******",
                    IsEditable      = true,
                    InUse           = false
                }
            };

            foreach (Members memberEntry in memberEntries)
            {
                context.Members.Add(memberEntry);
            }
            context.SaveChanges();
        }
Beispiel #10
0
        public static void Initialize(QuickLoanDbContext context)
        {
            context.Database.EnsureCreated();

            if (context.Accounts.Any())
            {
                return;       // DB has been seeded
            }

            InitialiseAccountTypeMster(context);
            InitialiseAccountsMster(context);
            InitialiseMembersMster(context);
            InitialiseAccountMemberDetailsMster(context);
            InitialiseLoansMster(context);
            InitialiseShareMster(context);
            InitialiseTransaction(context);
            InitialiseCards(context);
            InitialiseBankNames(context);
        }
Beispiel #11
0
        private static void InitialiseAccountMemberDetailsMster(QuickLoanDbContext context)
        {
            var accountDetailsEntries = new AccountDetails[]
            {
                new AccountDetails
                {
                    AccountsId     = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    MembersId      = context.Members.Select(item => item).Where(item => item.MemberName == "Member1").ToList <Members>()[0].Id,
                    AccountTypesId = context.AccountTypes.Select(item => item).Where(item => item.Type == "Primary").ToList <AccountTypes>()[0].Id,
                },
                new AccountDetails
                {
                    AccountsId     = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    MembersId      = context.Members.Select(item => item).Where(item => item.MemberName == "Member2").ToList <Members>()[0].Id,
                    AccountTypesId = context.AccountTypes.Select(item => item).Where(item => item.Type == "Primary").ToList <AccountTypes>()[0].Id,
                },
                new AccountDetails
                {
                    AccountsId     = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    MembersId      = context.Members.Select(item => item).Where(item => item.MemberName == "Member1").ToList <Members>()[0].Id,
                    AccountTypesId = context.AccountTypes.Select(item => item).Where(item => item.Type == "Joint").ToList <AccountTypes>()[0].Id,
                },
                new AccountDetails
                {
                    AccountsId     = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    MembersId      = context.Members.Select(item => item).Where(item => item.MemberName == "Member3").ToList <Members>()[0].Id,
                    AccountTypesId = context.AccountTypes.Select(item => item).Where(item => item.Type == "Primary").ToList <AccountTypes>()[0].Id,
                },
                new AccountDetails
                {
                    AccountsId     = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    MembersId      = context.Members.Select(item => item).Where(item => item.MemberName == "Member4").ToList <Members>()[0].Id,
                    AccountTypesId = context.AccountTypes.Select(item => item).Where(item => item.Type == "Primary").ToList <AccountTypes>()[0].Id,
                }
            };

            foreach (AccountDetails accountDetailsEntry in accountDetailsEntries)
            {
                context.AccountDetails.Add(accountDetailsEntry);
            }
            context.SaveChanges();
        }
Beispiel #12
0
        private static void InitialiseAccountTypeMster(QuickLoanDbContext context)
        {
            var accountTypeEntries = new AccountTypes[]
            {
                new AccountTypes
                {
                    //Id=1,
                    Type = "Primary"
                },
                new AccountTypes
                {
                    //Id=2,
                    Type = "Joint"
                }
            };

            foreach (AccountTypes accountTypeEntry in accountTypeEntries)
            {
                context.AccountTypes.Add(accountTypeEntry);
            }
            context.SaveChanges();
        }
Beispiel #13
0
        private static void InitialiseLoanOptions(QuickLoanDbContext context)
        {
            var loanOptions = new List <LoanOptions> {
                new LoanOptions {
                    Tenure       = "5 Years",
                    LoanAmount   = 100000.00m,
                    EMIAmount    = 1887.22m,
                    InterestRate = "5.00",
                    LoanSchedule = new List <LoanSchedule>()
                    {
                        new LoanSchedule {
                            TenureYear    = "2018",
                            PrincipalPaid = 8915.12m,
                            InterestPaid  = 2407.60m,
                            Balance       = 91084.88m
                        },
                        new LoanSchedule {
                            TenureYear    = "2019",
                            PrincipalPaid = 18511.59m,
                            InterestPaid  = 4133.85m,
                            Balance       = 72573.29m
                        },
                        new LoanSchedule {
                            TenureYear    = "2020",
                            PrincipalPaid = 19458.66m,
                            InterestPaid  = 3186.78m,
                            Balance       = 53114.63m
                        },
                        new LoanSchedule {
                            TenureYear    = "2021",
                            PrincipalPaid = 20454.23m,
                            InterestPaid  = 2191.21m,
                            Balance       = 32660.40m
                        },
                        new LoanSchedule {
                            TenureYear    = "2022",
                            PrincipalPaid = 21500.69m,
                            InterestPaid  = 1144.75m,
                            Balance       = 11159.71m
                        },
                        new LoanSchedule {
                            TenureYear    = "2023",
                            PrincipalPaid = 11159.71m,
                            InterestPaid  = 163.32m,
                            Balance       = 0
                        }
                    }
                },
                new LoanOptions {
                    Tenure       = "10 Years",
                    LoanAmount   = 100000.00m,
                    EMIAmount    = 1000.60m,
                    InterestRate = "5.00",
                    LoanSchedule = new List <LoanSchedule>()
                    {
                        new LoanSchedule {
                            TenureYear    = "2018",
                            PrincipalPaid = 3904.43m,
                            InterestPaid  = 2459.53m,
                            Balance       = 96095.57m
                        },
                        new LoanSchedule {
                            TenureYear    = "2019",
                            PrincipalPaid = 8107.25m,
                            InterestPaid  = 4620.67m,
                            Balance       = 87988.32m
                        },
                        new LoanSchedule {
                            TenureYear    = "2020",
                            PrincipalPaid = 8522.03m,
                            InterestPaid  = 4205.89m,
                            Balance       = 79466.29m
                        },
                        new LoanSchedule {
                            TenureYear    = "2021",
                            PrincipalPaid = 8958.05m,
                            InterestPaid  = 3769.87m,
                            Balance       = 70508.24m
                        },
                        new LoanSchedule {
                            TenureYear    = "2022",
                            PrincipalPaid = 9416.36m,
                            InterestPaid  = 3311.56m,
                            Balance       = 61091.88m
                        },
                        new LoanSchedule {
                            TenureYear    = "2023",
                            PrincipalPaid = 9898.12m,
                            InterestPaid  = 2829.80m,
                            Balance       = 51193.76m
                        },
                        new LoanSchedule {
                            TenureYear    = "2024",
                            PrincipalPaid = 10404.51m,
                            InterestPaid  = 2323.41m,
                            Balance       = 40789.25m
                        },
                        new LoanSchedule {
                            TenureYear    = "2025",
                            PrincipalPaid = 10936.84m,
                            InterestPaid  = 1791.08m,
                            Balance       = 29852.41m
                        },
                        new LoanSchedule {
                            TenureYear    = "2026",
                            PrincipalPaid = 11496.39m,
                            InterestPaid  = 1231.53m,
                            Balance       = 18356.02m
                        },
                        new LoanSchedule {
                            TenureYear    = "2027",
                            PrincipalPaid = 12084.56m,
                            InterestPaid  = 643.36m,
                            Balance       = 6271.46m
                        },
                        new LoanSchedule {
                            TenureYear    = "2028",
                            PrincipalPaid = 6271.46m,
                            InterestPaid  = 91.77m,
                            Balance       = 0
                        }
                    }
                },
                new LoanOptions {
                    Tenure       = "15 Years",
                    LoanAmount   = 100000.00m,
                    EMIAmount    = 600.45m,
                    InterestRate = "5.00",
                    LoanSchedule = new List <LoanSchedule>()
                    {
                        new LoanSchedule {
                            TenureYear    = "2018",
                            PrincipalPaid = 2268.25m,
                            InterestPaid  = 2476.49m,
                            Balance       = 97731.75m
                        },
                        new LoanSchedule {
                            TenureYear    = "2019",
                            PrincipalPaid = 4709.85m,
                            InterestPaid  = 4779.63m,
                            Balance       = 93021.90m
                        },
                        new LoanSchedule {
                            TenureYear    = "2020",
                            PrincipalPaid = 4950.83m,
                            InterestPaid  = 4538.65m,
                            Balance       = 88071.07m
                        },
                        new LoanSchedule {
                            TenureYear    = "2021",
                            PrincipalPaid = 5204.11m,
                            InterestPaid  = 4285.37m,
                            Balance       = 82866.96m
                        },
                        new LoanSchedule {
                            TenureYear    = "2022",
                            PrincipalPaid = 5470.37m,
                            InterestPaid  = 4019.11m,
                            Balance       = 77396.59m
                        },
                        new LoanSchedule {
                            TenureYear    = "2023",
                            PrincipalPaid = 5750.22m,
                            InterestPaid  = 3739.26m,
                            Balance       = 71646.37m
                        },
                        new LoanSchedule {
                            TenureYear    = "2024",
                            PrincipalPaid = 6044.40m,
                            InterestPaid  = 3445.08m,
                            Balance       = 65601.97m
                        },
                        new LoanSchedule {
                            TenureYear    = "2025",
                            PrincipalPaid = 6353.68m,
                            InterestPaid  = 3135.80m,
                            Balance       = 59248.29m
                        },
                        new LoanSchedule {
                            TenureYear    = "2026",
                            PrincipalPaid = 6678.74m,
                            InterestPaid  = 2810.74m,
                            Balance       = 52569.55m
                        },
                        new LoanSchedule {
                            TenureYear    = "2027",
                            PrincipalPaid = 7020.43m,
                            InterestPaid  = 2469.05m,
                            Balance       = 45549.12m
                        },
                        new LoanSchedule {
                            TenureYear    = "2028",
                            PrincipalPaid = 7379.62m,
                            InterestPaid  = 2109.86m,
                            Balance       = 38169.50m
                        },
                        new LoanSchedule {
                            TenureYear    = "2029",
                            PrincipalPaid = 7757.18m,
                            InterestPaid  = 1732.30m,
                            Balance       = 30412.32m
                        },
                        new LoanSchedule {
                            TenureYear    = "2030",
                            PrincipalPaid = 8154.04m,
                            InterestPaid  = 1335.44m,
                            Balance       = 22258.28m
                        },
                        new LoanSchedule {
                            TenureYear    = "2031",
                            PrincipalPaid = 8571.22m,
                            InterestPaid  = 918.26m,
                            Balance       = 13687.06m
                        },
                        new LoanSchedule {
                            TenureYear    = "2032",
                            PrincipalPaid = 9009.75m,
                            InterestPaid  = 479.73m,
                            Balance       = 4677.31m
                        },
                        new LoanSchedule {
                            TenureYear    = "2033",
                            PrincipalPaid = 4677.31m,
                            InterestPaid  = 68.47m,
                            Balance       = 0.00m
                        }
                    }
                }
            };

            foreach (LoanOptions lo in loanOptions)
            {
                context.LoanOptions.Add(lo);
            }
            context.SaveChanges();
        }
Beispiel #14
0
 public LoanManager(QuickLoanDbContext quickLoanDbContext, IConfiguration configuration)
 {
     _quickLoanDbContext = quickLoanDbContext;
     _configuration      = configuration;
 }
Beispiel #15
0
 public AuthManager(QuickLoanDbContext context)
 {
     _context = context;
 }
Beispiel #16
0
 public ResetCreditCardManager(QuickLoanDbContext context)
 {
     _context = context;
 }
Beispiel #17
0
 public PaymentManager(QuickLoanDbContext context)
 {
     _context = context;
 }
Beispiel #18
0
        private static void InitialiseTransaction(QuickLoanDbContext context)
        {
            var transactions = new Transactions[]
            {
                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 0,
                    Postdate    = "01/09/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    Description = "Loan advance",
                    Type        = "LOAN",
                    RecordId    = 0,
                    Postdate    = "02/08/2018",
                    Amount      = 700
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 0,
                    Postdate    = "03/09/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 0,
                    Postdate    = "04/09/2018",
                    Amount      = 200
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "5000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 0,
                    Postdate    = "05/09/2018",
                    Amount      = 700
                },

                //-----------------------------------

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 1,
                    Postdate    = "01/09/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    Description = "Loan advance",
                    Type        = "LOAN",
                    RecordId    = 1,
                    Postdate    = "02/08/2018",
                    Amount      = 700
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "03/09/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 1,
                    Postdate    = "04/09/2018",
                    Amount      = 200
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "6000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "05/09/2018",
                    Amount      = 700
                },

                //-----------------------------------
                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "02/09/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    Description = "Loan advance",
                    Type        = "LOAN",
                    RecordId    = 3,
                    Postdate    = "02/18/2018",
                    Amount      = 700
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "03/20/2018",
                    Amount      = 300
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "04/09/2018",
                    Amount      = 200
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "7000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "06/09/2018",
                    Amount      = 700
                },
                //-----------------------------------
                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "02/09/2018",
                    Amount      = 500
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    Description = "Loan advance",
                    Type        = "LOAN",
                    RecordId    = 3,
                    Postdate    = "02/18/2018",
                    Amount      = 900
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "03/20/2018",
                    Amount      = 390
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "04/09/2018",
                    Amount      = 200
                },

                new Transactions
                {
                    AccountsId  = context.Accounts.Select(item => item).Where(item => item.AccountNumber == "8000").ToList <Accounts>()[0].Id,
                    Description = "cash deposit",
                    Type        = "Share",
                    RecordId    = 3,
                    Postdate    = "06/09/2018",
                    Amount      = 700
                },
            };

            foreach (Transactions transaction in transactions)
            {
                context.Transactions.Add(transaction);
            }
            context.SaveChanges();
        }
Beispiel #19
0
 public AccountManager(QuickLoanDbContext context)
 {
     _context = context;
 }