Exemple #1
0
        public static IServices GetInstance()
        {
            if (_theUniqueInstance == null)
                _theUniqueInstance = new ServicesProvider();

            return _theUniqueInstance._iServices;
        }
Exemple #2
0
 public static ServicesProvider GetServiceProvider()
 {
     if (_theUniqueInstance == null)
         return _theUniqueInstance = new ServicesProvider();
     return _theUniqueInstance;
 }
Exemple #3
0
        public Settings GetCurrentSettings(bool pIncludePackages)
        {
            Settings settings = new Settings();
            // General parameters
            SettingGroup generalParameters = new SettingGroup(GENERAL_PARAMETERS);

            settings.Add(generalParameters);
            ApplicationSettings gp = ApplicationSettings.GetInstance(_user.Md5);


            generalParameters.Add(new Setting(OGeneralSettings.ACCOUNTINGPROCESS, ((int)gp.AccountingProcesses).ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.ALLOWSMULTIPLELOANS, gp.IsAllowMultipleLoans.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.ALLOWSMULTIPLEGROUPS, gp.IsAllowMultipleGroups.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.BAD_LOAN_DAYS, gp.BadLoanDays.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, gp.IsCalculationLateFeesDuringHolidays.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.CEASE_LAIE_DAYS, gp.CeaseLateDays.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.CITYMANDATORY, gp.IsCityMandatory.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.CONTRACT_CODE_TEMPLATE, gp.ContractCodeTemplate));
            generalParameters.Add(new Setting(OGeneralSettings.COUNTRY, gp.Country));
            generalParameters.Add(new Setting(OGeneralSettings.AUTOMATIC_ID, gp.IsAutomaticID.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, gp.DoNotSkipNonWorkingDays.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.ENFORCE_ID_PATTERN, gp.EnforceIDPattern.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.GROUPMINMEMBERS, gp.GroupMinMembers.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.GROUPMAXMEMBERS, gp.GroupMaxMembers.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.VILLAGEMINMEMBERS, gp.VillageMinMembers.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.VILLAGEMAXMEMBERS, gp.VillageMaxMembers.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.CLIENT_AGE_MIN, gp.ClientAgeMin.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.CLIENT_AGE_MAX, gp.ClientAgeMax.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.MAX_LOANS_COVERED, gp.MaxLoansCovered.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.MAX_GUARANTOR_AMOUNT, gp.MaxGuarantorAmount.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.ID_PATTERN, gp.IDPattern));
            generalParameters.Add(new Setting(OGeneralSettings.INTERESTS_ALSO_CREDITED_IN_FL, gp.InterestsCreditedInFL.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.INCREMENTALDURINGDAYOFF, gp.IsIncrementalDuringDayOff.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.LATEDAYSAFTERACCRUALCEASES, gp.LateDaysAfterAccrualCeases.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.MAX_NUMBER_INSTALLMENT, gp.MaxNumberInstallment.ToString()));;
            generalParameters.Add(new Setting(OGeneralSettings.MFI_NAME, gp.MfiName));

            generalParameters.Add(new Setting(OGeneralSettings.OLBBEFOREREPAYMENT, gp.IsOlbBeforeRepayment.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, gp.PayFirstInterestRealValue.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.PENDING_SAVINGS_MODE, gp.PendingSavingsMode));

            generalParameters.Add(new Setting(OGeneralSettings.SAVINGS_CODE_TEMPLATE, gp.SavingsCodeTemplate));

            generalParameters.Add(new Setting(OGeneralSettings.VAT_RATE, gp.VatRate.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.WEEKENDDAY1, gp.WeekEndDay1.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.WEEKENDDAY2, gp.WeekEndDay2.ToString()));

            generalParameters.Add(new Setting(OGeneralSettings.INTEREST_RATE_DECIMAL_PLACES, Convert.ToString(gp.InterestRateDecimalPlaces)));
            generalParameters.Add(new Setting(OGeneralSettings.STOP_WRITEOFF_PENALTY, Convert.ToString(gp.IsStopWriteOffPenalty.ToString())));
            generalParameters.Add(new Setting(OGeneralSettings.MODIFY_ENTRY_FEE, Convert.ToString(gp.ModifyEntryFee.ToString())));

            // Provisioning Rules
            SettingGroup provisioningRules = new SettingGroup(PROVISIONING_RULES);

            settings.Add(provisioningRules);
            foreach (ProvisioningRate prate in ProvisionTable.GetInstance(_user).ProvisioningRates)
            {
                provisioningRules.Add(new Setting(prate.Number.ToString(), String.Format("{0}/{1}/{2}/{3}/{4}",
                                                                                         prate.NbOfDaysMin,
                                                                                         prate.NbOfDaysMax,
                                                                                         prate.ProvisioningValue,
                                                                                         prate.ProvisioningInterest,
                                                                                         prate.ProvisioningPenalty)));
            }

            // Public Holidays
            SettingGroup publicHolidays = new SettingGroup(PUBLIC_HOLIDAYS);

            settings.Add(publicHolidays);
            foreach (DateTime entry in ServicesProvider.GetInstance().GetNonWorkingDate().PublicHolidays.Keys)
            {
                publicHolidays.Add(new Setting(ServicesProvider.GetInstance().GetNonWorkingDate().PublicHolidays[entry], (entry).ToString("dd/MM/yyyy")));
            }
            //if (pIncludePackages)
            //{
            //    // Packages
            //    SettingGroup packages = new SettingGroup(PACKAGES);
            //    settings.Add(packages);
            //    List<LoanProduct> allPackages = new ProductServices(_user).FindAllPackages(false, OClientTypes.Both);
            //    foreach (LoanProduct package in allPackages)
            //    {
            //        Setting p = new Setting(package.Name, null);
            //        //p.Package = package;
            //        packages.Add(p);
            //    }
            //}
            return(settings);
        }