Пример #1
0
        private void ApplyGeneralParameters(SettingGroup group)
        {
            ApplicationSettingsServices service = new ApplicationSettingsServices(_user);

            foreach (Setting s in group.Settings)
            {
                service.UpdateSelectedParameter(s.Name, s.Value);
            }
        }
Пример #2
0
        private void ApplyPublicHoliday(SettingGroup group)
        {
            ApplicationSettingsServices service = new ApplicationSettingsServices(_user);

            foreach (Setting s in group.Settings)
            {
                DictionaryEntry entry = new DictionaryEntry(s.Value, s.Name);
                service.DeleteNonWorkingDate(entry);
                service.AddNonWorkingDate(entry);
            }
        }
 private void ApplyProvisioningRules(SettingGroup group)
 {
     foreach (Setting s in group.Settings)
     {
         foreach (ProvisioningRate rate in ProvisionTable.GetInstance(_user).ProvisioningRates)
         {
             if (rate.NbOfDaysMin + "-" + rate.NbOfDaysMax == s.Name)
             {
                 rate.ProvisioningValue = Convert.ToDouble(s.Value);
             }
         }
     }
     ServicesProvider.GetInstance().GetChartOfAccountsServices().UpdateProvisioningTableInstance();
 }
Пример #4
0
 public Setting MatchNames(SettingGroup pGroup, Setting pSetting)
 {
     foreach (SettingGroup group in _Groups)
     {
         if (group.Name == pGroup.Name)
         {
             foreach (Setting s in group.Settings)
             {
                 if (s.Name == pSetting.Name)
                 {
                     return(s);
                 }
             }
         }
     }
     return(null);
 }
Пример #5
0
 private void ApplyProvisioningRules(SettingGroup group)
 {
     foreach (Setting s in group.Settings)
     {
         foreach (ProvisioningRate rate in ProvisionTable.GetInstance(_user).ProvisioningRates)
         {
             if (rate.Number.ToString() == s.Name)
             {
                 var values = s.Value.Split('/');
                 rate.NbOfDaysMin          = Convert.ToInt32(values[0]);
                 rate.NbOfDaysMax          = Convert.ToInt32(values[1]);
                 rate.ProvisioningValue    = Convert.ToDouble(values[2]);
                 rate.ProvisioningInterest = Convert.ToDouble(values[3]);
                 rate.ProvisioningPenalty  = Convert.ToDouble(values[4]);
             }
         }
     }
     ServicesProvider.GetInstance().GetChartOfAccountsServices().UpdateProvisioningTableInstance();
 }
Пример #6
0
 private Settings GetSelectedSettings()
 {
     Settings settings = new Settings();
     foreach (TreeNode gnode in tvSettings.Nodes)
     {
         if ((gnode.Checked) || (NodeChildChecked(gnode)))
         {
             SettingGroup group = new SettingGroup(gnode.Name);
             settings.Add(group);
             foreach (TreeNode node in gnode.Nodes)
             {
                 if (node.Checked)
                 {
                     Setting s = (Setting)node.Tag;
                     group.Add(s);
                 }
             }
         }
     }
     return settings;
 }
 private void ApplyProvisioningRules(SettingGroup group)
 {
     foreach (Setting s in group.Settings)
     {
         foreach (ProvisioningRate rate in ProvisionTable.GetInstance(_user).ProvisioningRates)
         {
             if(rate.NbOfDaysMin + "-" + rate.NbOfDaysMax == s.Name)
             {
                 rate.ProvisioningValue = Convert.ToDouble(s.Value);
             }
         }
     }
     ServicesProvider.GetInstance().GetChartOfAccountsServices().UpdateProvisioningTableInstance();
 }
 private void ApplyPublicHoliday(SettingGroup group)
 {
     ApplicationSettingsServices service = new ApplicationSettingsServices(_user);
     foreach (Setting s in group.Settings)
     {
         DictionaryEntry entry = new DictionaryEntry(s.Value, s.Name);
         service.DeleteNonWorkingDate(entry);
         service.AddNonWorkingDate(entry);
     }
 }
 private void ApplyGeneralParameters(SettingGroup group)
 {
     ApplicationSettingsServices service = new ApplicationSettingsServices(_user);
     foreach (Setting s in group.Settings)
     {
         service.UpdateSelectedParameter(s.Name, s.Value);
     }
 }
 private void ApplyPackages(SettingGroup group)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 public Setting MatchNames(SettingGroup pGroup, Setting pSetting)
 {
     foreach (SettingGroup group in _Groups)
     {
         if (group.Name == pGroup.Name)
         {
             foreach (Setting s in group.Settings)
             {
                 if (s.Name == pSetting.Name) return s;
             }
         }
     }
     return null;
 }
        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.CITYOPENVALUE, gp.IsCityAnOpenValue.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.CONSOLIDATION_MODE, gp.ConsolidationMode.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_WILD_CHAR_CHECK, gp.IDWildCharCheck.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.IMF_CODE, gp.ImfCode));

            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.NAME_FORMAT, gp.FirstNameFormat));

            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.USE_TELLER_MANAGEMENT, gp.UseTellerManagement.ToString()));
            generalParameters.Add(new Setting(OGeneralSettings.USEPROJECTS, gp.UseProjects.ToString()));

            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.NbOfDaysMin + "-" + prate.NbOfDaysMax, prate.ProvisioningValue.ToString()));
            }

            // 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;
        }
 public void Add(SettingGroup pGroup)
 {
     _Groups.Add(pGroup);
 }
        private void ApplyProvisioningRules(SettingGroup group)
        {
            foreach (Setting s in group.Settings)
            {
                foreach (ProvisioningRate rate in ProvisionTable.GetInstance(_user).ProvisioningRates)
                {
                    if (rate.Number.ToString() == s.Name)
                    {
                        var values = s.Value.Split('/');
                        rate.NbOfDaysMin = Convert.ToInt32(values[0]);
                        rate.NbOfDaysMax = Convert.ToInt32(values[1]);
                        rate.ProvisioningValue = Convert.ToDouble(values[2]);
                        rate.ProvisioningInterest = Convert.ToDouble(values[3]);
                        rate.ProvisioningPenalty = Convert.ToDouble(values[4]);
                    }
                }

            }
            ServicesProvider.GetInstance().GetChartOfAccountsServices().UpdateProvisioningTableInstance();
        }
Пример #15
0
 public void Add(SettingGroup pGroup)
 {
     _Groups.Add(pGroup);
 }
Пример #16
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.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);
        }
Пример #17
0
 private void ApplyPackages(SettingGroup group)
 {
     throw new Exception("The method or operation is not implemented.");
 }