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); }
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)); }
public int AddInstallmentType(InstallmentType pInstallmentType) { CheckExistingInstallmentType(pInstallmentType); return(_installmentTypeManager.AddInstallmentType(pInstallmentType)); }