示例#1
0
        public static ApplicationItem CreateOrUpdate(Application application, ProductFeatureCategory category, int productFeatureApplicabilityId, DateTime today)
        {
            var current = GetFirstActive(application, category);
            bool create = current == null || current.ProdFeatApplicabilityId != productFeatureApplicabilityId;
            if (current != null && current.ProdFeatApplicabilityId != productFeatureApplicabilityId)
                current.EndDate = today;

            if (create)
            {
                ApplicationItem applicationItem = new ApplicationItem();
                applicationItem.Application = application;
                applicationItem.ProdFeatApplicabilityId = productFeatureApplicabilityId;
                applicationItem.EffectiveDate = today;
                return applicationItem;
            }
            else
                return current;
        }
示例#2
0
 public static ApplicationItem GetFirstActive(Application application, ProductFeatureCategory category)
 {
     return Context.ApplicationItems.FirstOrDefault(entity => entity.EndDate == null
         && entity.ProductFeatureApplicability.ProductFeature.ProductFeatCatId == category.Id
         && entity.ApplicationId == application.Id);
 }
示例#3
0
 public static IQueryable<ApplicationItem> GetAllActive(Application application, ProductFeatureCategory category)
 {
     return Context.ApplicationItems.Where(entity => entity.EndDate == null
         && entity.ProductFeatureApplicability.ProductFeature.ProductFeatCatId == category.Id
         && entity.ApplicationId == application.Id);
 }
        public static ProductFeatureApplicability RetrieveFeature(ProductFeatureCategory featureCategory, LoanApplication loanApplication)
        {
            var app = Context.ApplicationItems.SingleOrDefault(entity =>
                entity.ProductFeatureApplicability.ProductFeature.ProductFeatureCategory.Id == featureCategory.Id
                && entity.ApplicationId == loanApplication.ApplicationId && entity.EndDate == null);

            return app.ProductFeatureApplicability;
        }
 public static List<ProductFeatureApplicability> GetAllActive(ProductFeatureCategory category, FinancialProduct financialProduct)
 {
     return financialProduct.ProductFeatureApplicabilities.Where(entity => entity.EndDate == null && entity.ProductFeature.ProductFeatCatId == category.Id).ToList();
 }
 public static IQueryable<ProductFeature> All(ProductFeatureCategory category)
 {
     return Context.ProductFeatures.Where(entity => entity.ProductFeatCatId == category.Id);
 }