Esempio n. 1
0
        public void AddInstallmentTypeInDatabase()
        {
            InstallmentTypeManager installmentTypeManager = (InstallmentTypeManager)container["InstallmentTypeManager"];
            int id = installmentTypeManager.AddInstallmentType(new InstallmentType {
                Name = "Bi-Monthly", NbOfDays = 0, NbOfMonths = 2
            });

            Assert.AreNotEqual(0, id);
        }
Esempio n. 2
0
        public int AddInstallmentType(InstallmentType pInstallmentType)
        {
            List <InstallmentType> list = _installmentTypeManager.SelectAllInstallmentTypes();

            foreach (InstallmentType type in list)
            {
                if (type.Name.ToLower() == pInstallmentType.Name.ToLower())
                {
                    throw new OpenCbsPackageSaveException(OpenCbsPackageSaveExceptionEnum.InstallmentTypeNameAlreadyExist);
                }
                if (type.NbOfDays == pInstallmentType.NbOfDays && type.NbOfMonths == pInstallmentType.NbOfMonths)
                {
                    throw new OpenCbsPackageSaveException(OpenCbsPackageSaveExceptionEnum.InstallmentTypeValuesAlreadyExist);
                }
            }
            return(_installmentTypeManager.AddInstallmentType(pInstallmentType));
        }
Esempio n. 3
0
 public int AddInstallmentType(InstallmentType pInstallmentType)
 {
     CheckExistingInstallmentType(pInstallmentType);
     return(_installmentTypeManager.AddInstallmentType(pInstallmentType));
 }