public void UpdateSelectedDepartment(int departmentId) { _applicationStateSetter.SetSelectedResourceScreen(null); _applicationStateSetter.SetCurrentDepartment(departmentId); EventServiceFactory.EventService.PublishEvent(EventTopicNames.ActivatePosView); PermittedDepartments.ToList().ForEach(x => x.Refresh()); RaisePropertyChanged(() => PermittedDepartments); }
public void DisplayTickets() { _lastSelectedResource = null; if (_applicationState.CurrentDepartment == null && _applicationState.CurrentLoggedInUser.UserRole.DepartmentId > 0) { _applicationStateSetter.SetCurrentDepartment(_applicationState.CurrentLoggedInUser.UserRole.DepartmentId); } Debug.Assert(_applicationState.CurrentDepartment != null); if (SelectedTicket != null || !_cacheService.GetResourceScreens().Any() || _applicationState.CurrentDepartment.TicketCreationMethod == 1) { DisplaySingleTicket(); return; } CommonEventPublisher.PublishEntityOperation <Resource>(null, EventTopicNames.SelectResource, EventTopicNames.ResourceSelected); }
private static void CreateWarehouseTestContext(WarehouseTestContext testContext, IWorkspace workspace) { workspace.Delete <InventoryTransactionType>(x => x.Id > 0); workspace.Delete <Entity>(x => x.Id > 0); testContext.Iskender = workspace.Single <MenuItem>(x => x.Name == "İskender"); testContext.Iskender.Portions[0].MenuItemId = testContext.Iskender.Id; testContext.Doner = workspace.Single <MenuItem>(x => x.Name == "Ankara Döneri"); testContext.Doner.Portions[0].MenuItemId = testContext.Doner.Id; testContext.DonerEti = new InventoryItem { Name = "Döner Eti", BaseUnit = "GR", GroupCode = "", TransactionUnit = "KG", TransactionUnitMultiplier = 1000 }; testContext.Yogurt = new InventoryItem { Name = "Yoğurt", BaseUnit = "GR", GroupCode = "", TransactionUnit = "KG", TransactionUnitMultiplier = 1000 }; testContext.Pide = new InventoryItem { Name = "Pide", BaseUnit = "Yarım", GroupCode = "", TransactionUnit = "Adet", TransactionUnitMultiplier = 2 }; testContext.ZeytinYagi = new InventoryItem { Name = "Zeytin Yağı", BaseUnit = "Ölçü", GroupCode = "", TransactionUnit = "Litre", TransactionUnitMultiplier = 100 }; testContext.Tuz = new InventoryItem { Name = "Tuz", BaseUnit = "Ölçü", GroupCode = "", TransactionUnit = "Paket", TransactionUnitMultiplier = 100 }; testContext.Kekik = new InventoryItem { Name = "Kekik", BaseUnit = "Ölçü", GroupCode = "", TransactionUnit = "Paket", TransactionUnitMultiplier = 100 }; workspace.Add(testContext.DonerEti); workspace.Add(testContext.Yogurt); workspace.Add(testContext.Pide); workspace.Add(testContext.ZeytinYagi); workspace.Add(testContext.Tuz); workspace.Add(testContext.Kekik); testContext.IskenderRecipe = new Recipe { Name = "İskender Reçetesi", Portion = testContext.Iskender.Portions[0] }; workspace.Add(testContext.IskenderRecipe); testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.DonerEti, Quantity = 120 }); testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.Yogurt, Quantity = 50 }); testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.Pide, Quantity = 2 }); testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.ZeytinYagi, Quantity = 1 }); testContext.IskenderRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.Tuz, Quantity = 10 }); testContext.DonerRecipe = new Recipe { Name = "Döner Reçetesi", Portion = testContext.Doner.Portions[0] }; workspace.Add(testContext.DonerRecipe); testContext.DonerRecipe.RecipeItems.Add(new RecipeItem { InventoryItem = testContext.DonerEti, Quantity = 120 }); testContext.LocalWarehouseAccountType = new AccountType { Name = "Local Warehouse Account Type" }; testContext.SellerWarehouseAccountType = new AccountType { Name = "Seller Warehouse Account Type" }; workspace.Add(testContext.LocalWarehouseAccountType); workspace.Add(testContext.SellerWarehouseAccountType); testContext.WarehouseType = workspace.Single <WarehouseType>(x => x.Name == Resources.Warehouses); testContext.WarehouseEntityType = new EntityType { Name = "Warehouse Resource Type" }; workspace.Add(testContext.WarehouseEntityType); testContext.LocalWarehouseAccount = new Account { AccountTypeId = testContext.LocalWarehouseAccountType.Id }; testContext.Seller1Account = new Account { AccountTypeId = testContext.SellerWarehouseAccountType.Id }; testContext.Seller2Account = new Account { AccountTypeId = testContext.SellerWarehouseAccountType.Id }; workspace.Add(testContext.LocalWarehouseAccount); workspace.Add(testContext.Seller1Account); workspace.Add(testContext.Seller2Account); testContext.LocalWarehouse = new Warehouse { Name = "Local Warehouse", WarehouseTypeId = testContext.WarehouseType.Id }; testContext.BarWarehouse = new Warehouse { Name = "Bar Warehouse", WarehouseTypeId = testContext.WarehouseType.Id }; testContext.Seller1Warehouse = new Warehouse { WarehouseTypeId = testContext.WarehouseType.Id }; testContext.Seller2Warehouse = new Warehouse { WarehouseTypeId = testContext.WarehouseType.Id }; workspace.Add(testContext.LocalWarehouse); workspace.Add(testContext.BarWarehouse); workspace.Add(testContext.Seller1Warehouse); workspace.Add(testContext.Seller2Warehouse); testContext.LocalWarehouseEntity = new Entity { WarehouseId = testContext.LocalWarehouse.Id, EntityTypeId = testContext.WarehouseEntityType.Id, AccountId = testContext.LocalWarehouseAccount.Id }; testContext.BarWarehouseEntity = new Entity { WarehouseId = testContext.BarWarehouse.Id, EntityTypeId = testContext.WarehouseEntityType.Id }; testContext.Seller1WarehouseEntity = new Entity { WarehouseId = testContext.Seller1Warehouse.Id, EntityTypeId = testContext.WarehouseEntityType.Id, AccountId = testContext.Seller1Account.Id }; testContext.Seller2WarehouseEntity = new Entity { WarehouseId = testContext.Seller2Warehouse.Id, EntityTypeId = testContext.WarehouseEntityType.Id, AccountId = testContext.Seller2Account.Id }; workspace.Add(testContext.LocalWarehouseEntity); workspace.Add(testContext.BarWarehouseEntity); workspace.Add(testContext.Seller1WarehouseEntity); workspace.Add(testContext.Seller2WarehouseEntity); testContext.PurchaseAccountTransactionType = new AccountTransactionType { SourceAccountTypeId = testContext.SellerWarehouseAccountType.Id, TargetAccountTypeId = testContext.LocalWarehouseAccountType.Id, DefaultTargetAccountId = testContext.LocalWarehouseAccount.Id }; workspace.Add(testContext.PurchaseAccountTransactionType); testContext.PurchaseTransactionType = new InventoryTransactionType { Name = "PurchaseTransaction", SourceWarehouseTypeId = testContext.WarehouseType.Id, TargetWarehouseTypeId = testContext.WarehouseType.Id, DefaultSourceWarehouseId = testContext.Seller1Warehouse.Id, DefaultTargetWarehouseId = testContext.LocalWarehouse.Id, }; testContext.PurchaseTransactionDocumentType = new InventoryTransactionDocumentType { AccountTransactionType = testContext.PurchaseAccountTransactionType, InventoryTransactionType = testContext.PurchaseTransactionType, SourceEntityTypeId = testContext.WarehouseEntityType.Id, TargetEntityTypeId = testContext.WarehouseEntityType.Id, DefaultSourceEntityId = testContext.Seller1WarehouseEntity.Id, DefaultTargetEntityId = testContext.LocalWarehouseEntity.Id }; testContext.BarTransferTransactionType = new InventoryTransactionType { Name = "Bar Transfer", SourceWarehouseTypeId = testContext.WarehouseType.Id, TargetWarehouseTypeId = testContext.WarehouseType.Id, DefaultSourceWarehouseId = testContext.LocalWarehouse.Id, DefaultTargetWarehouseId = testContext.BarWarehouse.Id }; testContext.BarTransferTransactionDocumentType = new InventoryTransactionDocumentType { InventoryTransactionType = testContext.BarTransferTransactionType, SourceEntityTypeId = testContext.WarehouseEntityType.Id, TargetEntityTypeId = testContext.WarehouseEntityType.Id, DefaultSourceEntityId = testContext.LocalWarehouseEntity.Id, DefaultTargetEntityId = testContext.BarWarehouseEntity.Id }; workspace.Add(testContext.PurchaseTransactionType); workspace.Add(testContext.BarTransferTransactionType); testContext.Department = workspace.Single <Department>(x => x.Name == "Restoran"); testContext.Department.WarehouseId = testContext.LocalWarehouse.Id; ApplicationStateSetter.SetCurrentDepartment(testContext.Department.Id); WorkPeriodService.StartWorkPeriod(""); Thread.Sleep(1); }