Example #1
0
 public DataManager()
 {
     cont                       = new ModelContainer();
     branchRepository           = new BranchRepository(cont);
     categoryRepository         = new CategoryRepository(cont);
     checkDishRepository        = new CheckDishRepository(cont);
     checkMerchandiseRepository = new CheckMerchandiseRepository(cont);
     clientRepository           = new ClientRepository(cont);
     companyOwnerRepository     = new CompanyOwnerRepository(cont);
     companyRepository          = new CompanyRepository(cont);
     contactPersonRepository    = new ContactPersonRepository(cont);
     dishRepository             = new DishRepository(cont);
     documentRepository         = new DocumentRepository(cont);
     ejectionRepository         = new EjectionRepository(cont);
     employeeRepository         = new EmployeeRepository(cont);
     encashmentRepository       = new EncashmentRepository(cont);
     landlordRepository         = new LandlordRepository(cont);
     orderRepository            = new OrderRepository(cont);
     personRepository           = new PersonRepository(cont);
     positionRepository         = new PositionRepository(cont);
     prepackRepository          = new PrepackRepository(cont);
     productRepository          = new ProductRepository(cont);
     purchaseRepository         = new PurchaseRepository(cont);
     recipeDishIngrRepository   = new RecipeDishIngrRepository(cont);
     recipeDishPrepRepository   = new RecipeDishPrepRepository(cont);
     recipePrepIngrRepository   = new RecipePrepIngrRepository(cont);
     recipePrepPrepRepository   = new RecipePrepPrepRepository(cont);
     roomRepository             = new RoomRepository(cont);
     shiftRepository            = new ShiftRepository(cont);
     tableRepository            = new TableRepository(cont);
     warehouseRepository        = new WarehouseRepository(cont);
 }
Example #2
0
        //[Fact]
        public void CreateAndUpdate()
        {
            const string connectionString = "";
            var          id      = Guid.NewGuid();
            var          address = new Address("Faux House", "Imaginary Street", "Scum on the Wold", "Widgetshire", "AB12 3CD");

            using (IUnitOfWork u = new UnitOfWork(new SqlConnection(connectionString)))
            {
                var eventStore         = new SqlEventStore(new DictionaryBackedEventPublisher(), u);
                var landlordRepository = new LandlordRepository(eventStore);
                var l = Landlord.Create(id, new Name("Bob", "Rocket"), "*****@*****.**", address);
                landlordRepository.Save(l, 0);
                u.Commit();
            }

            using (IUnitOfWork u = new UnitOfWork(new SqlConnection(connectionString)))
            {
                var eventStore         = new SqlEventStore(new DictionaryBackedEventPublisher(), u);
                var landlordRepository = new LandlordRepository(eventStore);
                var l = landlordRepository.Get(id);
                l.ChangeName(new Name("Peter", "Crabkin"));
                landlordRepository.Save(l, 1);
                u.Commit();
            }
        }
Example #3
0
 public LandlordController()
 {
     LandlordDB = new LandlordRepository();
 }
Example #4
0
 public BuildingController()
 {
     BuildingDB = new BuildingRepository();
     LandlordDB = new LandlordRepository();
 }