Beispiel #1
0
 public FieldAPIController(FormGeneratorContext context
                           , UserManager <MyUser> userManager
                           , IFieldDependenciesRepository depRepo)
 {
     _dependenciesRepository = depRepo;
     _context     = context;
     _userManager = userManager;
 }
Beispiel #2
0
        public static void SeedDependencies(IFieldDependenciesRepository repository, FormGeneratorContext context)
        {
            Field korzen = context.Field.FirstOrDefault(f => f.Id == 1);
            var   fields = context.Field.Where(f => f.Id != 1).ToList();
            FieldFieldDependency dep1 = new FieldFieldDependency(korzen, FieldFieldDependencyType.FieldDuplication, "22");

            fields.ForEach(f => dep1.RelatedFields.Add(f));
            var test = repository.GetAllDependFields();

            repository.SaveDependency(dep1);
        }
        public void UpdateIndependentFieldsList(IFieldDependenciesRepository repository, FormGeneratorContext context)
        {
            var allDependFields     = repository.GetAllDependFields();
            var allIndependedFields = context.Field.AsNoTracking()
                                      .ToList()
                                      .Where(f => {
                return((!allDependFields.Contains(f)) && (f.Name != SuperiorFieldName) &&
                       (!RelatedFields.Contains(f)));
            });

            AllIndependentFieldsName = JsonConvert.SerializeObject(allIndependedFields.Select(f => f.Name).ToList());
        }
Beispiel #4
0
 public FieldDependencyController(IFieldDependenciesRepository repo, FormGeneratorContext ctx, IMapper mapper)
 {
     _fieldDependenciesRepo = repo;
     _context = ctx;
     _mapper  = mapper;
 }
Beispiel #5
0
 public FormsController(FormGeneratorContext context, UserManager <MyUser> userManager, IFieldDependenciesRepository repository)
 {
     _context     = context;
     _userManager = userManager;
     pomik        = repository;
 }