public EntityDao() { ValidatorRegistry.RegisterDeleteValidator(new EntityDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator <EntityType>(x => Dao.Exists <Entity>(y => y.EntityTypeId == x.Id), Resources.EntityType, Resources.Entity); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <Entity>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.Entity))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <EntityType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.EntityType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <EntityScreenItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.EntityScreenItem))); }
public InventoryService(IApplicationState applicationState, ICacheService cacheService) { _applicationState = applicationState; _cacheService = cacheService; EventServiceFactory.EventService.GetEvent <GenericEvent <WorkPeriod> >().Subscribe(OnWorkperiodStatusChanged); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <InventoryItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.InventoryItem))); ValidatorRegistry.RegisterDeleteValidator <InventoryItem>(x => Dao.Exists <PeriodicConsumptionItem>(y => y.InventoryItem.Id == x.Id), Resources.InventoryItem, Resources.EndOfDayRecord); ValidatorRegistry.RegisterSaveValidator(new RecipeSaveValidator()); }
public AccountDao() { ValidatorRegistry.RegisterDeleteValidator(new AccountDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new AccountTypeDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new AccountTransactionTypeDeleteValidator()); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <Account>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.Account))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.AccountType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountTransactionType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.AccountTransactionType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountTransactionDocumentType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.DocumentType))); }
public ResourceService() { _resourceScreenItemCount = Dao.Count <ResourceScreenItem>(); ValidatorRegistry.RegisterDeleteValidator <Resource>(x => Dao.Exists <TicketResource>(y => y.ResourceId == x.Id), Resources.Resource, Resources.Ticket); ValidatorRegistry.RegisterDeleteValidator <ResourceType>(x => Dao.Exists <Resource>(y => y.ResourceTypeId == x.Id), Resources.ResourceType, Resources.Resource); ValidatorRegistry.RegisterDeleteValidator <ResourceScreenItem>(x => Dao.Exists <ResourceScreen>(y => y.ScreenItems.Any(z => z.Id == x.Id)), Resources.ResourceScreenItem, Resources.ResourceScreen); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <Resource>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.Resource))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <ResourceType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.ResourceType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <ResourceScreenItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.ResourceScreenItem))); }
public AccountService(ICacheService cacheService) { _cacheService = cacheService; ValidatorRegistry.RegisterDeleteValidator(new AccountDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new AccountTypeDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator <AccountTransactionType>(x => Dao.Exists <AccountTransactionDocumentType>(y => y.TransactionTypes.Any(z => z.Id == x.Id)), Resources.AccountTransactionType, Resources.DocumentType); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <Account>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.Account))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.AccountType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountTransactionType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.AccountTransactionType))); ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <AccountTransactionDocumentType>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.DocumentType))); }
public UserService(IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, IDepartmentService departmentService, IAutomationService automationService) { _applicationState = applicationState; _applicationStateSetter = applicationStateSetter; _departmentService = departmentService; _automationService = automationService; ValidatorRegistry.RegisterDeleteValidator(new UserDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new UserRoleDeleteValidator()); ValidatorRegistry.RegisterSaveValidator(new UserSaveValidator()); }
public MenuDao() { ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <MenuItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.MenuItem))); ValidatorRegistry.RegisterDeleteValidator(new MenuItemDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new ScreenMenuDeleteValidator()); }
public PriceListDao() { ValidatorRegistry.RegisterSaveValidator(new MenuItemPriceDefinitionSaveValidator()); }
// public UserDao() { ValidatorRegistry.RegisterDeleteValidator(new UserDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator(new UserRoleDeleteValidator()); ValidatorRegistry.RegisterSaveValidator(new UserSaveValidator()); }
public InventoryDao() { ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <InventoryItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.InventoryItem))); ValidatorRegistry.RegisterDeleteValidator <InventoryItem>(x => Dao.Exists <PeriodicConsumptionItem>(y => y.InventoryItemId == x.Id), Resources.InventoryItem, Resources.EndOfDayRecord); ValidatorRegistry.RegisterSaveValidator(new RecipeSaveValidator()); }
public AutomationDao() { ValidatorRegistry.RegisterDeleteValidator <AppAction>(x => Dao.Exists <ActionContainer>(y => y.AppActionId == x.Id), Resources.Action, Resources.Rule); ValidatorRegistry.RegisterSaveValidator(new AppActionSaveValidator()); }
public MenuDao() { ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <MenuItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.MenuItem))); ValidatorRegistry.RegisterDeleteValidator(new MenuItemDeleteValidator()); ValidatorRegistry.RegisterDeleteValidator <ScreenMenu>(x => Dao.Exists <TicketType>(y => y.ScreenMenuId == x.Id), Resources.Menu, Resources.TicketType); }