コード例 #1
0
ファイル: EntityDao.cs プロジェクト: mustafaasaber/SambaPOS-3
 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)));
 }
コード例 #2
0
        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());
        }
コード例 #3
0
 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)));
 }
コード例 #4
0
        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)));
        }
コード例 #5
0
 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)));
 }
コード例 #6
0
        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());
        }
コード例 #7
0
ファイル: MenuDao.cs プロジェクト: chengming0916/SamplePrism
 public MenuDao()
 {
     ValidatorRegistry.RegisterSaveValidator(new NonDuplicateSaveValidator <MenuItem>(string.Format(Resources.SaveErrorDuplicateItemName_f, Resources.MenuItem)));
     ValidatorRegistry.RegisterDeleteValidator(new MenuItemDeleteValidator());
     ValidatorRegistry.RegisterDeleteValidator(new ScreenMenuDeleteValidator());
 }
コード例 #8
0
 public PriceListDao()
 {
     ValidatorRegistry.RegisterSaveValidator(new MenuItemPriceDefinitionSaveValidator());
 }
コード例 #9
0
 //
 public UserDao()
 {
     ValidatorRegistry.RegisterDeleteValidator(new UserDeleteValidator());
     ValidatorRegistry.RegisterDeleteValidator(new UserRoleDeleteValidator());
     ValidatorRegistry.RegisterSaveValidator(new UserSaveValidator());
 }
コード例 #10
0
 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());
 }
コード例 #11
0
 public AutomationDao()
 {
     ValidatorRegistry.RegisterDeleteValidator <AppAction>(x => Dao.Exists <ActionContainer>(y => y.AppActionId == x.Id), Resources.Action, Resources.Rule);
     ValidatorRegistry.RegisterSaveValidator(new AppActionSaveValidator());
 }
コード例 #12
0
 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);
 }