Пример #1
0
        public RecordsUpdater(
            IIlaroAdmin admin,
            IExecutingDbCommand executor,
            IFetchingRecords source,
            IProvidingUser user)
        {
            if (admin == null)
            {
                throw new ArgumentNullException(nameof(admin));
            }
            if (executor == null)
            {
                throw new ArgumentNullException(nameof(executor));
            }
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            _admin    = admin;
            _executor = executor;
            _source   = source;
            _user     = user;
        }
        public RecordsSource_EnumEntityFilters()
        {
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Insert
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Update
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Delete
            });

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity<EntityChange>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.ChangeEntity;
            _property = _entity["ChangeType"];
        }
 public RecordsSource_GetEntityWithData()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity<Product>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
 }
        public RecordsSource_EnumEntityFilters()
        {
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Insert
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Update
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey = "1",
                ChangedOn = DateTime.Now,
                ChangeType = EntityChangeType.Delete
            });

            _source = new RecordsSource(_admin, new Notificator());
            Entity<EntityChange>.Register().ReadAttributes();
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.ChangeEntity;
            _property = _entity["ChangeType"];
        }
Пример #5
0
        public EntityController(
            Notificator notificator,
            IEntityService entityService,
            IFetchingRecords source,
            IFetchingRecordsHierarchy hierarchySource)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (entityService == null)
            {
                throw new ArgumentNullException("entityService");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (hierarchySource == null)
            {
                throw new ArgumentNullException("hierarchySource");
            }

            _notificator     = notificator;
            _entityService   = entityService;
            _source          = source;
            _hierarchySource = hierarchySource;
        }
 public RecordsSource_GetRecord()
 {
     _source = new RecordsSource(_admin, new Notificator());
     _admin.RegisterEntity<Product>();
     _admin.Initialise(ConnectionStringName);
     _entity = _admin.GetEntity("Product");
 }
Пример #7
0
        public RecordsSource_GetEntityWithData()
        {
            _source = new RecordsSource(_admin, new Notificator());
            Entity <Product> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
        }
Пример #8
0
 public RecordsSource_GetEntityWithData()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity <Product>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
 }
Пример #9
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (updater == null)
            {
                throw new ArgumentNullException("updater");
            }
            if (deleter == null)
            {
                throw new ArgumentNullException("deleter");
            }

            _notificator = notificator;
            _source      = source;
            _creator     = creator;
            _updater     = updater;
            _deleter     = deleter;
        }
Пример #10
0
 public RecordsSource_GetRecord()
 {
     _source = new RecordsSource(_admin, new Notificator());
     _admin.RegisterEntity <Product>();
     _admin.Initialise(ConnectionStringName);
     _entity = _admin.GetEntity("Product");
 }
        public RecordsSource_EnumEntityFilters()
        {
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Insert
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Update
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Delete
            });

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity <EntityChange>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity   = Admin.ChangeEntity;
            _property = _entity["ChangeType"];
        }
Пример #12
0
        public EntityController(
            IIlaroAdmin admin,
            Notificator notificator,
            IEntityService entityService,
            IFetchingRecords source,
            IFetchingRecordsHierarchy hierarchySource)
        {
            if (admin == null)
            {
                throw new ArgumentNullException(nameof(admin));
            }
            if (notificator == null)
            {
                throw new ArgumentNullException(nameof(notificator));
            }
            if (entityService == null)
            {
                throw new ArgumentNullException(nameof(entityService));
            }
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (hierarchySource == null)
            {
                throw new ArgumentNullException(nameof(hierarchySource));
            }

            _admin           = admin;
            _notificator     = notificator;
            _entityService   = entityService;
            _source          = source;
            _hierarchySource = hierarchySource;
        }
        public RecordsSource_EnumEntityFilters()
        {
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Insert
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Update
            });
            DB.EntityChanges.Insert(new
            {
                EntityName = "Entity",
                EntityKey  = "1",
                ChangedOn  = DateTime.Now,
                ChangeType = EntityChangeType.Delete
            });

            _source = new RecordsSource(_admin, new Notificator());
            Entity <EntityChange> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
            _entity   = _admin.ChangeEntity;
            _property = _entity["ChangeType"];
        }
Пример #14
0
        public EntitiesController(
            Notificator notificator,
            IFetchingRecords entitiesSource,
            IConfiguration configuration,
            IFilterFactory filterFactory)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (entitiesSource == null)
            {
                throw new ArgumentException("entitiesSource");
            }
            if (configuration == null)
            {
                throw new ArgumentException("configuration");
            }
            if (filterFactory == null)
            {
                throw new ArgumentException("filterFactory");
            }

            _notificator    = notificator;
            _entitiesSource = entitiesSource;
            _configuration  = configuration;
            _filterFactory  = filterFactory;
        }
 public RecordsSource_DetermineDisplayValue()
 {
     _source = new RecordsSource(_admin, new Notificator());
     Entity<Product>.Register().ReadAttributes();
     Entity<Customer>.Register().ReadAttributes();
     Entity<EmployeeTerritory>.Register().ReadAttributes();
     _admin.Initialise(ConnectionStringName);
 }
Пример #16
0
 public RecordsUpdater_()
 {
     _source = new RecordsSource(_admin, new Notificator());
     _user = A.Fake<IProvidingUser>();
     A.CallTo(() => _user.CurrentUserName()).Returns("Test");
     var executor = new DbCommandExecutor(_admin, _user);
     _updater = new RecordsUpdater(_admin, executor, _source, _user);
 }
Пример #17
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter,
            IComparingRecords comparer,
            IDescribingChanges changeDescriber,
            IHandlingFiles filesHandler,
            IValidatingEntities validator)
        {
            if (notificator == null)
            {
                throw new ArgumentNullException("notificator");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (creator == null)
            {
                throw new ArgumentNullException("creator");
            }
            if (updater == null)
            {
                throw new ArgumentNullException("updater");
            }
            if (deleter == null)
            {
                throw new ArgumentNullException("deleter");
            }
            if (comparer == null)
            {
                throw new ArgumentNullException("comparer");
            }
            if (changeDescriber == null)
            {
                throw new ArgumentNullException("changeDescriber");
            }
            if (filesHandler == null)
            {
                throw new ArgumentNullException("filesHandler");
            }
            if (validator == null)
            {
                throw new ArgumentNullException("validator");
            }

            _notificator     = notificator;
            _source          = source;
            _creator         = creator;
            _updater         = updater;
            _deleter         = deleter;
            _comparer        = comparer;
            _changeDescriber = changeDescriber;
            _filesHandler    = filesHandler;
            _validator       = validator;
        }
 public RecordsSource_GetRecord()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity <Product>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
     _entity = Admin.EntitiesTypes
               .FirstOrDefault(x => x.Name == "Product");
 }
 public RecordsSource_DetermineDisplayValue()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity <Product>();
     Admin.AddEntity <Customer>();
     Admin.AddEntity <EmployeeTerritory>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
 }
 public RecordsSource_DetermineDisplayValue()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity<Product>();
     Admin.AddEntity<Customer>();
     Admin.AddEntity<EmployeeTerritory>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
 }
 public RecordsSource_GetRecord()
 {
     _source = new RecordsSource(new Notificator());
     Admin.AddEntity<Product>();
     Admin.SetForeignKeysReferences();
     Admin.ConnectionStringName = ConnectionStringName;
     _entity = Admin.EntitiesTypes
         .FirstOrDefault(x => x.Name == "Product");
 }
        public RecordsUpdater_ManyToMany()
        {
            _source = new RecordsSource(_admin, new Notificator());
            _user   = A.Fake <IProvidingUser>();
            A.CallTo(() => _user.CurrentUserName()).Returns("Test");
            var executor = new DbCommandExecutor(_admin, _user);

            _updater = new RecordsUpdater(_admin, executor, _source, _user);
        }
        public RecordsSource_Searching_String()
        {
            DB.Products.Insert(ProductName: "Test");
            DB.Products.Insert(ProductName: "Product");

            _source = new RecordsSource(_admin, new Notificator());
            Entity<Product>.Register().ReadAttributes();
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
        }
Пример #24
0
        public RecordsDeleter_()
        {
            _user = A.Fake <IProvidingUser>();
            A.CallTo(() => _user.CurrentUserName()).Returns("Test");
            var executor = new DbCommandExecutor(_admin, _user);

            _hierarchySource = new RecordsHierarchySource(_admin);
            _deleter         = new RecordsDeleter(_admin, executor, _hierarchySource, _user);
            _source          = new RecordsSource(_admin, new Notificator());
        }
        public RecordsSource_BoolEntityFilters()
        {
            DB.Products.Insert(ProductName: "Product", Discontinued: true);
            DB.Products.Insert(ProductName: "Product2", Discontinued: false);

            _source = new RecordsSource(_admin, new Notificator());
            Entity<Product>.Register().ReadAttributes();
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
            _property = _entity["Discontinued"];
        }
        public RecordsSource_DetermineDisplayValue()
        {
            _source = new RecordsSource(_admin, new Notificator());
            Entity <Product> .Register().ReadAttributes();

            Entity <Customer> .Register().ReadAttributes();

            Entity <EmployeeTerritory> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
        }
        public RecordsSource_Searching_String()
        {
            DB.Products.Insert(ProductName: "Test");
            DB.Products.Insert(ProductName: "Product");

            _source = new RecordsSource(_admin, new Notificator());
            Entity <Product> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
        }
        public RecordsSource_Ordering()
        {
            DB.Products.Insert(ProductName: "Product");
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity<Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                .FirstOrDefault(x => x.Name == "Product");
        }
        public RecordsSource_BoolEntityFilters()
        {
            DB.Products.Insert(ProductName: "Product", Discontinued: true);
            DB.Products.Insert(ProductName: "Product2", Discontinued: false);

            _source = new RecordsSource(_admin, new Notificator());
            Entity <Product> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
            _entity   = _admin.GetEntity("Product");
            _property = _entity["Discontinued"];
        }
Пример #30
0
        public RecordsUpdater(
            IExecutingDbCommand executor,
            IFetchingRecords source)
        {
            if (executor == null)
                throw new ArgumentNullException("executor");
            if (source == null)
                throw new ArgumentNullException("source");

            _executor = executor;
            _source = source;
        }
Пример #31
0
        public RecordsSource_Ordering()
        {
            DB.Products.Insert(ProductName: "Product");
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity <Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                      .FirstOrDefault(x => x.Name == "Product");
        }
        public RecordsSource_Searching_Numeric()
        {
            DB.Products.Insert(ProductName: "Test", UnitPrice: 3);
            DB.Products.Insert(ProductName: "Product", UnitPrice: 4.23);

            _source = new RecordsSource(new Notificator());
            Entity<Product>.Add().SetSearchProperties(x => x.UnitPrice);
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                .FirstOrDefault(x => x.Name == "Product");
        }
        public RecordsSource_ForeignEntityFilters()
        {
            _supplierId = DB.Suppliers.Insert(CompanyName: "Supplier").SupplierID;
            DB.Products.Insert(ProductName: "Product", SupplierID: _supplierId);
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(_admin, new Notificator());
            Entity<Product>.Register().ReadAttributes();
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
            _property = _entity["SupplierID"];
        }
        public RecordsSource_Searching_Numeric()
        {
            DB.Products.Insert(ProductName: "Test", UnitPrice: 3);
            DB.Products.Insert(ProductName: "Product", UnitPrice: 4.23);

            _source = new RecordsSource(_admin, new Notificator());

            Entity<Product>.Register().ReadAttributes()
                .SearchProperties(x => x.UnitPrice);
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
        }
Пример #35
0
        public RecordsSource_Searching_Numeric()
        {
            DB.Products.Insert(ProductName: "Test", UnitPrice: 3);
            DB.Products.Insert(ProductName: "Product", UnitPrice: 4.23);

            _source = new RecordsSource(new Notificator());
            Entity <Product> .Add().SetSearchProperties(x => x.UnitPrice);

            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                      .FirstOrDefault(x => x.Name == "Product");
        }
Пример #36
0
        public RecordsSource_ForeignEntityFilters()
        {
            _supplierId = DB.Suppliers.Insert(CompanyName: "Supplier").SupplierID;
            DB.Products.Insert(ProductName: "Product", SupplierID: _supplierId);
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(_admin, new Notificator());
            Entity <Product> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
            _entity   = _admin.GetEntity("Product");
            _property = _entity["SupplierID"];
        }
        public RecordsSource_BoolEntityFilters()
        {
            DB.Products.Insert(ProductName: "Product", Discontinued: true);
            DB.Products.Insert(ProductName: "Product2", Discontinued: false);

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity<Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                .FirstOrDefault(x => x.Name == "Product");
            _property = _entity["Discontinued"];
        }
        public RecordsSource_BoolEntityFilters()
        {
            DB.Products.Insert(ProductName: "Product", Discontinued: true);
            DB.Products.Insert(ProductName: "Product2", Discontinued: false);

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity <Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                      .FirstOrDefault(x => x.Name == "Product");
            _property = _entity["Discontinued"];
        }
Пример #39
0
        public RecordsSource_Searching_Numeric()
        {
            DB.Products.Insert(ProductName: "Test", UnitPrice: 3);
            DB.Products.Insert(ProductName: "Product", UnitPrice: 4.23);

            _source = new RecordsSource(_admin, new Notificator());

            Entity <Product> .Register().ReadAttributes()
            .SearchProperties(x => x.UnitPrice);

            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Product");
        }
        public RecordsSource_ForeignEntityFilters()
        {
            _supplierId = DB.Suppliers.Insert(CompanyName: "Supplier").SupplierID;
            DB.Products.Insert(ProductName: "Product", SupplierID: _supplierId);
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity <Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                      .FirstOrDefault(x => x.Name == "Product");
            _property = _entity["SupplierID"];
        }
        public RecordsSource_ForeignEntityFilters()
        {
            _supplierId = DB.Suppliers.Insert(CompanyName: "Supplier").SupplierID;
            DB.Products.Insert(ProductName: "Product", SupplierID: _supplierId);
            DB.Products.Insert(ProductName: "Product2");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity<Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                .FirstOrDefault(x => x.Name == "Product");
            _property = _entity["SupplierID"];
        }
Пример #42
0
        public RecordsUpdater_()
        {
            _source = new RecordsSource(new Notificator());
            _user = A.Fake<IProvidingUser>();
            A.CallTo(() => _user.Current()).Returns("Test");
            var executor = new DbCommandExecutor(_user);
            _updater = new RecordsUpdater(executor, _source);
            Admin.AddEntity<Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;

            _productId = DB.Products.Insert(ProductName: "Product").ProductID;
            _entity = _source.GetEntityWithData(Admin.GetEntity("Product"), _productId.ToString());
        }
Пример #43
0
        public RecordsUpdater_()
        {
            _source = new RecordsSource(new Notificator());
            _user   = A.Fake <IProvidingUser>();
            A.CallTo(() => _user.Current()).Returns("Test");
            var executor = new DbCommandExecutor(_user);

            _updater = new RecordsUpdater(executor, _source);
            Admin.AddEntity <Product>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;

            _productId = DB.Products.Insert(ProductName: "Product").ProductID;
            _entity    = _source.GetEntityWithData(Admin.GetEntity("Product"), _productId.ToString());
        }
Пример #44
0
        public EntitiesController(
            Notificator notificator,
            IFetchingRecords entitiesSource,
            IConfiguration configuration)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (entitiesSource == null)
                throw new ArgumentException("entitiesSource");
            if (configuration == null)
                throw new ArgumentException("configuration");

            _notificator = notificator;
            _entitiesSource = entitiesSource;
            _configuration = configuration;
        }
Пример #45
0
        public RecordsUpdater(
            IExecutingDbCommand executor,
            IFetchingRecords source)
        {
            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            _executor = executor;
            _source   = source;
        }
Пример #46
0
        public RecordsService(
            IIlaroAdmin admin,
            IFetchingRecords entitiesSource,
            IFilterFactory filterFactory)
        {
            if (admin == null)
                throw new ArgumentNullException(nameof(admin));
            if (entitiesSource == null)
                throw new ArgumentNullException(nameof(entitiesSource));
            if (filterFactory == null)
                throw new ArgumentNullException(nameof(filterFactory));

            _admin = admin;
            _entitiesSource = entitiesSource;
            _filterFactory = filterFactory;
        }
        public RecordsSource_DateTimeEntityFilters()
        {
            _fakeClock = new FakeClock(
                () => new DateTime(2015, 7, 20),
                () => new DateTime(2015, 7, 20));

            DB.Orders.Insert(ShipCity: "City1", OrderDate: "2015.07.20 11:33");
            DB.Orders.Insert(ShipCity: "City2", OrderDate: "2015.07.19 11:33");
            DB.Orders.Insert(ShipCity: "City3", OrderDate: "2015.06.20 11:33");
            DB.Orders.Insert(ShipCity: "City4", OrderDate: "2014.08.20 11:33");

            _source = new RecordsSource(_admin, new Notificator());
            Entity<Order>.Register().ReadAttributes();
            _admin.Initialise(ConnectionStringName);
            _entity = _admin.GetEntity("Order");
            _property = _entity["OrderDate"];
        }
        public RecordsSource_DateTimeEntityFilters()
        {
            _fakeClock = new FakeClock(
                () => new DateTime(2015, 7, 20),
                () => new DateTime(2015, 7, 20));

            DB.Orders.Insert(ShipCity: "City1", OrderDate: "2015.07.20 11:33");
            DB.Orders.Insert(ShipCity: "City2", OrderDate: "2015.07.19 11:33");
            DB.Orders.Insert(ShipCity: "City3", OrderDate: "2015.06.20 11:33");
            DB.Orders.Insert(ShipCity: "City4", OrderDate: "2014.08.20 11:33");

            _source = new RecordsSource(_admin, new Notificator());
            Entity <Order> .Register().ReadAttributes();

            _admin.Initialise(ConnectionStringName);
            _entity   = _admin.GetEntity("Order");
            _property = _entity["OrderDate"];
        }
        public RecordsSource_DateTimeEntityFilters()
        {
            _fakeClock = new FakeClock(
                () => new DateTime(2015, 7, 20),
                () => new DateTime(2015, 7, 20));

            DB.Orders.Insert(ShipCity: "City1", OrderDate: "2015.07.20 11:33");
            DB.Orders.Insert(ShipCity: "City2", OrderDate: "2015.07.19 11:33");
            DB.Orders.Insert(ShipCity: "City3", OrderDate: "2015.06.20 11:33");
            DB.Orders.Insert(ShipCity: "City4", OrderDate: "2014.08.20 11:33");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity <Order>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                      .FirstOrDefault(x => x.Name == "Order");
            _property = _entity["OrderDate"];
        }
        public RecordsSource_DateTimeEntityFilters()
        {
            _fakeClock = new FakeClock(
                () => new DateTime(2015, 7, 20),
                () => new DateTime(2015, 7, 20));

            DB.Orders.Insert(ShipCity: "City1", OrderDate: "2015.07.20 11:33");
            DB.Orders.Insert(ShipCity: "City2", OrderDate: "2015.07.19 11:33");
            DB.Orders.Insert(ShipCity: "City3", OrderDate: "2015.06.20 11:33");
            DB.Orders.Insert(ShipCity: "City4", OrderDate: "2014.08.20 11:33");

            _source = new RecordsSource(new Notificator());
            Admin.AddEntity<Order>();
            Admin.SetForeignKeysReferences();
            Admin.ConnectionStringName = ConnectionStringName;
            _entity = Admin.EntitiesTypes
                .FirstOrDefault(x => x.Name == "Order");
            _property = _entity["OrderDate"];
        }
Пример #51
0
        public EntityController(
            Notificator notificator,
            IEntityService entityService,
            IFetchingRecords source,
            IFetchingRecordsHierarchy hierarchySource)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (entityService == null)
                throw new ArgumentNullException("entityService");
            if (source == null)
                throw new ArgumentNullException("source");
            if (hierarchySource == null)
                throw new ArgumentNullException("hierarchySource");

            _notificator = notificator;
            _entityService = entityService;
            _source = source;
            _hierarchySource = hierarchySource;
        }
Пример #52
0
        public RecordsUpdater(
            IIlaroAdmin admin,
            IExecutingDbCommand executor,
            IFetchingRecords source,
            IProvidingUser user)
        {
            if (admin == null)
                throw new ArgumentNullException(nameof(admin));
            if (executor == null)
                throw new ArgumentNullException(nameof(executor));
            if (source == null)
                throw new ArgumentNullException(nameof(source));
            if (user == null)
                throw new ArgumentNullException(nameof(user));

            _admin = admin;
            _executor = executor;
            _source = source;
            _user = user;
        }
Пример #53
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter,
            IComparingRecords comparer,
            IDescribingChanges changeDescriber,
            IHandlingFiles filesHandler,
            IValidatingEntities validator)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (source == null)
                throw new ArgumentNullException("source");
            if (creator == null)
                throw new ArgumentNullException("creator");
            if (updater == null)
                throw new ArgumentNullException("updater");
            if (deleter == null)
                throw new ArgumentNullException("deleter");
            if (comparer == null)
                throw new ArgumentNullException("comparer");
            if (changeDescriber == null)
                throw new ArgumentNullException("changeDescriber");
            if (filesHandler == null)
                throw new ArgumentNullException("filesHandler");
            if (validator == null)
                throw new ArgumentNullException("validator");

            _notificator = notificator;
            _source = source;
            _creator = creator;
            _updater = updater;
            _deleter = deleter;
            _comparer = comparer;
            _changeDescriber = changeDescriber;
            _filesHandler = filesHandler;
            _validator = validator;
        }
Пример #54
0
        public RecordsService(
            IIlaroAdmin admin,
            IFetchingRecords entitiesSource,
            IFilterFactory filterFactory)
        {
            if (admin == null)
            {
                throw new ArgumentNullException(nameof(admin));
            }
            if (entitiesSource == null)
            {
                throw new ArgumentNullException(nameof(entitiesSource));
            }
            if (filterFactory == null)
            {
                throw new ArgumentNullException(nameof(filterFactory));
            }

            _admin          = admin;
            _entitiesSource = entitiesSource;
            _filterFactory  = filterFactory;
        }
Пример #55
0
        public EntityController(
            IIlaroAdmin admin,
            Notificator notificator,
            IEntityService entityService,
            IFetchingRecords source,
            IFetchingRecordsHierarchy hierarchySource)
        {
            if (admin == null)
                throw new ArgumentNullException(nameof(admin));
            if (notificator == null)
                throw new ArgumentNullException(nameof(notificator));
            if (entityService == null)
                throw new ArgumentNullException(nameof(entityService));
            if (source == null)
                throw new ArgumentNullException(nameof(source));
            if (hierarchySource == null)
                throw new ArgumentNullException(nameof(hierarchySource));

            _admin = admin;
            _notificator = notificator;
            _entityService = entityService;
            _source = source;
            _hierarchySource = hierarchySource;
        }
Пример #56
0
        public EntityService(
            Notificator notificator,
            IFetchingRecords source,
            ICreatingRecords creator,
            IUpdatingRecords updater,
            IDeletingRecords deleter)
        {
            if (notificator == null)
                throw new ArgumentNullException("notificator");
            if (source == null)
                throw new ArgumentNullException("source");
            if (creator == null)
                throw new ArgumentNullException("creator");
            if (updater == null)
                throw new ArgumentNullException("updater");
            if (deleter == null)
                throw new ArgumentNullException("deleter");

            _notificator = notificator;
            _source = source;
            _creator = creator;
            _updater = updater;
            _deleter = deleter;
        }
 public RecordsSource_GetEntityWithData()
 {
     _source = new RecordsSource(_admin, new Notificator());
     Entity<Product>.Register().ReadAttributes();
     _admin.Initialise(ConnectionStringName);
 }