Exemple #1
0
        public void ThatServicesCanDeleteUnit()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).Get();

            UnitServices.Delete(unit);
            Assert.IsNull(UnitServices.Units.SingleOrDefault(x => x.Name == GetUnitDto().Name));
        }
Exemple #2
0
        public void ThatServicesReturnsSameUnitWhenAskedTwiceForSameUnit()
        {
            var unit1 = UnitServices.WithDto(GetUnitDto()).Get();
            var unit2 = UnitServices.WithDto(GetUnitDto()).Get();

            Assert.AreEqual(unit1, unit2);
        }
Exemple #3
0
        public void ThatUnitGroupIsStillThereAfterUnitDelete()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).Get();

            UnitServices.Delete(unit);
            Assert.IsNotNull(UnitGroupServices.UnitGroups.SingleOrDefault(x => x.Name == GetUnitDto().UnitGroupName));
        }
Exemple #4
0
        public void ThatUnitCollectionContainsUnit()
        {
            var unit  = UnitServices.WithDto((UnitTestFixtures.GetTestUnitMilligram())).Get();
            var group = unit.UnitGroup;

            Assert.IsTrue(group.Units.Contains(unit));
        }
Exemple #5
0
        public void ThatAUnitGroupCanBeChanged()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).Get();

            // ToDo: rewrite
            UnitServices.ChangeUnitName(unit, "changed");
            Assert.IsNotNull(UnitServices.Units.SingleOrDefault(x => x.Name == "changed"));
        }
 public EmailController()
 {
     UnitOfWork                = new UnitOfWork();
     EmailServices             = new EmailServices(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferService           = new TransferService(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
 }
Exemple #7
0
        public void LoadUnit(int limit, int offset)
        {
            var data = UnitServices.GetListWithPagePaging(ContentSearch, offset, limit);

            if (data != null)
            {
                Units = new ObservableCollection <Unit>(data);
            }
            else
            {
                Units?.Clear();
            }
        }
 public TransferController()
 {
     UnitOfWork                = new UnitOfWork();
     TransferService           = new TransferService(UnitOfWork);
     ItemServices              = new ItemServices(UnitOfWork);
     ProcurementServices       = new ProcurementServices(UnitOfWork);
     StoreServices             = new StoreServices(UnitOfWork);
     SubStoreServices          = new SubStoreServices(UnitOfWork);
     SubSubStoreServices       = new SubSubStoreServices(UnitOfWork);
     SubSubSubStoreServices    = new SubSubSubStoreServices(UnitOfWork);
     SubSubSubSubStoreServices = new SubSubSubSubStoreServices(UnitOfWork);
     TransferTypeServices      = new TransferTypeServices(UnitOfWork);
     UnitServices              = new UnitServices(UnitOfWork);
     ConditionOfItemServices   = new ConditionOfItemServices(UnitOfWork);
 }
Exemple #9
0
        protected UnitEntity buildCube()
        {
            UnitEntity e = new UnitEntity();
            UnitServices unitservices = new UnitServices();
            unitservices.AddService(typeof(IUnitEntityType), e);

            GraphicComponent graphic = new GraphicComponent(); // get provided services

            // init each component
            initializeComponent(graphic, unitservices);
            graphic.LoadContent();

            e.Components.Add(graphic);
            return e;
        }
 public ProcurementController()
 {
     UnitOfWork                   = new UnitOfWork();
     ProcurementServices          = new ProcurementServices(UnitOfWork);
     ProcrurementTypeServices     = new ProcrurementTypeServices(UnitOfWork);
     SupplierCompanyServices      = new SupplierCompanyServices(UnitOfWork);
     SubSubSubSubCategoryServices = new SubSubSubSubCategoryServices(UnitOfWork);
     SubSubSubCategoryServices    = new SubSubSubCategoryServices(UnitOfWork);
     SubSubCategoryServices       = new SubSubCategoryServices(UnitOfWork);
     SubCategoryServices          = new SubCategoryServices(UnitOfWork);
     CategoryServices             = new CategoryServices(UnitOfWork);
     ItemServices                 = new ItemServices(UnitOfWork);
     ModelServices                = new ModelServices(UnitOfWork);
     BrandServices                = new BrandServices(UnitOfWork);
     UnitServices                 = new UnitServices(UnitOfWork);
 }
        public void Save()
        {
            if (_backuptUnit == null)
            {
                CurrentUnit.UserCreated = "Admin";
                CurrentUnit.CreatedTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
                UnitServices.Insert(CurrentUnit);
            }
            else
            {
                CurrentUnit.UserModified = "Admin";
                CurrentUnit.ModifiedTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
                UnitServices.Update(CurrentUnit);
            }

            (App.Current.MainWindow.DataContext as MainViewModel).UnitViewModel.SearchUnit();
            (App.Current.MainWindow.DataContext as MainViewModel).CloseDialog();
        }
 public ItemController()
 {
     unitOfWork                   = new UnitOfWork();
     itemServices                 = new ItemServices(unitOfWork);
     categoryServices             = new CategoryServices(unitOfWork);
     subCategoryServices          = new SubCategoryServices(unitOfWork);
     subSubCategoryServices       = new SubSubCategoryServices(unitOfWork);
     subSubSubCategoryServices    = new SubSubSubCategoryServices(unitOfWork);
     subSubSubSubCategoryServices = new SubSubSubSubCategoryServices(unitOfWork);
     companyServices              = new CompanyServices(unitOfWork);
     unitServices                 = new UnitServices(unitOfWork);
     storeServices                = new StoreServices(unitOfWork);
     subStoreServices             = new SubStoreServices(unitOfWork);
     subSubStoreServices          = new SubSubStoreServices(unitOfWork);
     subSubSubStoreServices       = new SubSubSubStoreServices(unitOfWork);
     subSubSubSubStoreServices    = new SubSubSubSubStoreServices(unitOfWork);
     BrandServices                = new BrandServices(unitOfWork);
     ModelServices                = new ModelServices(unitOfWork);
 }
 public UnitController()
 {
     unitOfWork  = new UnitOfWork();
     unitService = new UnitServices(unitOfWork);
 }
Exemple #14
0
 public void DeleteUnit(Unit unit)
 {
     UnitServices.Delete(unit);
     SearchUnit();
 }
Exemple #15
0
 public int GetCountUnit() => UnitServices.GetTotalCountWithName(ContentSearch);
Exemple #16
0
 private IUnit GetUnitFromJObject(JObject unit)
 {
     return(UnitServices.WithDto(new UnitDto {
         Name = unit.Value <String>("Name")
     }).Get());
 }
Exemple #17
0
        public void ThatServicesCanCreateNewUnitWithNewUnitGroup()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).Get();

            Assert.IsNotNull(unit);
        }
Exemple #18
0
 protected void initializeComponent(BaseUnitComponent component, UnitServices unitServices)
 {
     component.Initialize(unitServices, this.serviceProvider);
 }
Exemple #19
0
        public void ThatServicesCanCreateNewUnitAndAddUnitToGroup()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).AddToGroup(GetGroupDto()).Get();

            Assert.IsNotNull(unit);
        }
Exemple #20
0
        public void ThatServicesGetsTheUnitFromTheRepositoryOnceItsAdded()
        {
            var unit = UnitServices.WithDto(GetUnitDto()).AddToGroup(GetGroupDto()).Get();

            Assert.AreEqual(unit, UnitServices.GetUnit(unit.Id));
        }