コード例 #1
0
        public void Create_Complex_Account()
        {
            var            context        = new ValiasrContext("Valiasr");
            Person         person         = PersonTest.CreatePerson();
            Customer       customer       = PersonTest.CreateCustomer(person);
            Lawyer         lawyer         = PersonTest.CreateLawyer(person);
            IndexAccount   indexAccount   = CreateIndexAccount();
            GeneralAccount generalAccount = CreateGeneralAccount();
            Account        account        = CreateAccount();

            account.Lawyers = new Collection <Lawyer>();
            account.Lawyers.Add(lawyer);
            account.Customers = new Collection <Customer>();
            account.Customers.Add(customer);
            LoanRequest loanRequest = new LoanRequest();
            Loan        loan        = new Loan();

            //        loan.Account = account;
            loan.LoanRequest = loanRequest;
            LoanRequestOkyAssistant loanRequestOkyAssistant = new LoanRequestOkyAssistant();

            loanRequest.LoanRequestOkyAsistant = loanRequestOkyAssistant;
            loanRequest.Account  = account;
            account.LoanRequests = new Collection <LoanRequest>();
            account.LoanRequests.Add(loanRequest);
            indexAccount.BankAccounts = new Collection <BankAccount>();
            indexAccount.BankAccounts.Add(account);
            indexAccount.BankAccounts.Add(loan);
            generalAccount.IndexAccounts = new Collection <IndexAccount>();
            generalAccount.IndexAccounts.Add(indexAccount);
            context.GeneralAccounts.Add(generalAccount);
            //context.IndexAccounts.Add(indexAccount);

            context.SaveChanges();

            /* GeneralAccount generalAccount = CreateGeneralAccount();
             *
             *
             *
             * account.Lawyers.Add(lawyer);
             * indexAccount.Accounts.Add(account);
             * generalAccount.IndexAccounts.Add(indexAccount);
             *
             * context.GeneralAccounts.Add(generalAccount);
             * account.Customers.Add(customer);
             * context.SaveChanges();*/
        }
コード例 #2
0
ファイル: SrviceTest.cs プロジェクト: rahman-vali/Valiasr
        public LoanRequest Create_Request(Account account)
        {
            var LoanRequest = new LoanRequest
            {
                Id           = Guid.NewGuid(),
                Account      = account,
                Amount       = 5000,
                ReqNo        = 1,
                Description  = "h",
                Duration     = 20,
                DurationType = "kl",
                FingerRegId  = 4,
                LastDate     = 13921024,
            };
            LoanRequestOkyAssistant loanRequestOkyAsistant = new LoanRequestOkyAssistant();

            LoanRequest.LoanRequestOkyAsistant = loanRequestOkyAsistant;
            return(LoanRequest);
        }