Пример #1
0
        public void TestFixtureSetUp()
        {
            ProvisioningTable.GetInstance(new User()).AddProvisioningRate(new ProvisioningRate(1, 0, 1000, 0));

            new DataHelper().DeleteInstallments();
            new DataHelper().DeleteCreditContract();
            new DataHelper().DeletedProject();
            new DataHelper().DeleteTiers();
            new DataHelper().DeleteInstallmentTypes();
            new DataHelper().DeletePackage();
            new DataHelper().DeleteAllUser();
        }
Пример #2
0
        private static Credit _AddCredit()
        {
            GeneralSettings.GetInstance("").DeleteAllParameters();
            GeneralSettings.GetInstance("").AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            GeneralSettings.GetInstance("").AddParameter(OGeneralSettings.USECENTS, true);
            FundingLineManager _fundingLineManager = new FundingLineManager(DataUtil.TESTDB);
            FundingLine        fund = new FundingLine();

            fund.Purpose   = "Microsoft financement";
            fund.Name      = "AFD130";
            fund.Deleted   = false;
            fund.StartDate = DateTime.Now;
            fund.EndDate   = DateTime.Now;
            _fundingLineManager.AddFundingLine(fund, null);
            Package _package = new Package();

            _package.Name       = "Package";
            _package.Delete     = false;
            _package.LoanType   = OLoanTypes.Flat;
            _package.ClientType = 'G';
            _package.ChargeInterestWithinGracePeriod = true;
            _package.InstallmentType = new DataHelper().AddBiWeeklyInstallmentType();
            _package.FundingLine     = fund;
            _package.Id = new ProductManager(DataUtil.TESTDB).AddPackage(_package);
            User user = new User();

            user.Id = new DataHelper().AddUserWithIntermediaryAttributs();

            Credit credit =
                new Credit(_package, 1000, 3, 6, 0, new DateTime(2006, 1, 1), user, GeneralSettings.GetInstance(""),
                           NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(user));

            credit.CreationDate = DateTime.Today.AddDays(-1);
            credit.StartDate    = DateTime.Today;
            credit.LoanOfficer  = user;
            credit.CloseDate    = DateTime.Today.AddDays(1);
            credit.BranchCode   = "CA";


            credit.FundingLine = fund;
            //new DataHelper().AddGenericFundingLine();
            credit.Code = "TEST";

            return(credit);
        }
Пример #3
0
        public void TestFixtureSetUp()
        {
            User.CurrentUser    = new User();
            User.CurrentUser.Id = 1;

            GeneralSettings dataParam = GeneralSettings.GetInstance("");

            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.USECENTS, true);

            ChartOfAccounts chartOfAccounts = ChartOfAccounts.GetInstance(User.CurrentUser);

            chartOfAccounts.Accounts = chartOfAccounts.DefaultAccounts;

            ProvisioningTable provisioningTable = ProvisioningTable.GetInstance(User.CurrentUser);

            provisioningTable.AddProvisioningRate(new ProvisioningRate(1, 0, 0, 2));
        }
Пример #4
0
        /// <summary>
        /// This method Fill the instance of the ProvisioningTable object accessed by singleton
        /// </summary>
        public void SelectAllProvisioningRates()
        {
            ProvisioningTable provisioningTable = ProvisioningTable.GetInstance(_user);

            string sqlText = "SELECT id,number_of_days_min, number_of_days_max, provisioning_value FROM ProvisioningRules";

            SqlCommand select = new SqlCommand(sqlText, CurrentConnection);

            using (SqlDataReader reader = select.ExecuteReader())
            {
                while (reader.Read())
                {
                    ProvisioningRate pR = new ProvisioningRate();
                    pR.Number      = DatabaseHelper.GetInt32("id", reader);
                    pR.NbOfDaysMin = DatabaseHelper.GetInt32("number_of_days_min", reader);
                    pR.NbOfDaysMax = DatabaseHelper.GetInt32("number_of_days_max", reader);
                    pR.Rate        = DatabaseHelper.GetDouble("provisioning_value", reader);

                    provisioningTable.AddProvisioningRate(pR);
                }
            }
        }
Пример #5
0
        public void SetUp()
        {
            Package package = new Package(new InstallmentType(1, "Monthly", 0, 1), OLoanTypes.Flat, true);

            package.KeepExpectedInstallment             = true;
            package.NonRepaymentPenalties.InitialAmount = 0.003;

            contractForAPerson = new Credit(package, 1000, 0.03, 6, 1, new DateTime(2006, 1, 1), User.CurrentUser, GeneralSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(User.CurrentUser));
            contractForAPerson.NonRepaymentPenalties.InitialAmount = 0.003;

            _person           = new Person();
            _person.FirstName = "Nicolas";
            _person.LastName  = "MANGIN";
            _person.District  = new District(1, "Ile de France", new Province(1, "France"));
            _person.City      = "Paris";

            User user = User.CurrentUser;

            user.FirstName = "Nicolas";
            user.LastName  = "MANGIN";
            contractForAPerson.LoanOfficer = user;

            contractForAGroup           = new Credit(package, 1000, 0.03, 6, 1, new DateTime(2006, 1, 1), User.CurrentUser, GeneralSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(User.CurrentUser));
            _group                      = new Group();
            _group.Name                 = "Groupe MANGIN";
            _group.District             = new District(1, "Lorraine", new Province(1, "France"));
            _group.City                 = "Nancy";
            contractForAGroup.EntryFees = 0.03;
        }