当前位置: 首页>>代码示例>>C#>>正文


C# ICacheService类代码示例

本文整理汇总了C#中ICacheService的典型用法代码示例。如果您正苦于以下问题:C# ICacheService类的具体用法?C# ICacheService怎么用?C# ICacheService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ICacheService类属于命名空间,在下文中一共展示了ICacheService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public void Update(ICacheService cacheService, Account selectedAccount, WorkPeriod currentWorkPeriod)
        {
            var accountType = cacheService.GetAccountTypeById(selectedAccount.AccountTypeId);
            var transactions = Dao.Query(GetCurrentRange(accountType.DefaultFilterType, x => x.AccountId == selectedAccount.Id, currentWorkPeriod)).OrderBy(x => x.Date);
            Transactions = transactions.Select(x => new AccountDetailData(x, selectedAccount)).ToList();
            if (accountType.DefaultFilterType > 0)
            {
                var pastDebit = Dao.Sum(x => x.Debit, GetPastRange(accountType.DefaultFilterType, x => x.AccountId == selectedAccount.Id, currentWorkPeriod));
                var pastCredit = Dao.Sum(x => x.Credit, GetPastRange(accountType.DefaultFilterType, x => x.AccountId == selectedAccount.Id, currentWorkPeriod));
                var pastExchange = Dao.Sum(x => x.Exchange, GetPastRange(accountType.DefaultFilterType, x => x.AccountId == selectedAccount.Id, currentWorkPeriod));
                if (pastCredit > 0 || pastDebit > 0)
                {
                    Summaries.Add(new AccountSummaryData(Resources.Total, Transactions.Sum(x => x.Debit), Transactions.Sum(x => x.Credit)));
                    var detailValue =
                        new AccountDetailData(
                        new AccountTransactionValue
                        {
                            Name = Resources.PastTransactions,
                            Credit = pastCredit,
                            Debit = pastDebit,
                            Exchange = pastExchange
                        }, selectedAccount) { IsBold = true };
                    Transactions.Insert(0, detailValue);
                }
            }

            Summaries.Add(new AccountSummaryData(Resources.GrandTotal, Transactions.Sum(x => x.Debit), Transactions.Sum(x => x.Credit)));

            for (var i = 0; i < Transactions.Count; i++)
            {
                Transactions[i].Balance = (Transactions[i].Debit - Transactions[i].Credit);
                if (i > 0) (Transactions[i].Balance) += (Transactions[i - 1].Balance);
            }
        }
开发者ID:khriza,项目名称:SambaPOS-3,代码行数:34,代码来源:AccountTransactionSummary.cs

示例2: PrinterMapViewModel

 public PrinterMapViewModel(PrinterMap model, IMenuService menuService, IPrinterDao printerDao, ICacheService cacheService)
 {
     Model = model;
     _menuService = menuService;
     _printerDao = printerDao;
     _cacheService = cacheService;
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:PrinterMapViewModel.cs

示例3: PackagesController

 public PackagesController(
     IPackageService packageService,
     IUploadFileService uploadFileService,
     IUserService userService,
     IMessageService messageService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratedPackageCmd,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IPackageFileService packageFileService,
     IEntitiesContext entitiesContext,
     IAppConfiguration config,
     IIndexingService indexingService,
     ICacheService cacheService)
 {
     _packageService = packageService;
     _uploadFileService = uploadFileService;
     _userService = userService;
     _messageService = messageService;
     _searchService = searchService;
     _autoCuratedPackageCmd = autoCuratedPackageCmd;
     _nugetExeDownloaderService = nugetExeDownloaderService;
     _packageFileService = packageFileService;
     _entitiesContext = entitiesContext;
     _config = config;
     _indexingService = indexingService;
     _cacheService = cacheService;
 }
开发者ID:ryanhartley84332,项目名称:NuGetGallery,代码行数:27,代码来源:PackagesController.cs

示例4: ExecutePrintJob

 public ExecutePrintJob(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IPrinterService printerService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _printerService = printerService;
 }
开发者ID:khriza,项目名称:SambaPOS-3,代码行数:7,代码来源:ExecutePrintJob.cs

示例5: TicketTotalsViewModel

 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances)
 {
     _cacheService = cacheService;
     _accountBalances = accountBalances;
     ResetCache();
     _model = Ticket.Empty;
 }
开发者ID:khriza,项目名称:SambaPOS-3,代码行数:7,代码来源:TicketTotalsViewModel.cs

示例6: TagController

 public TagController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicTagService topicTagService, ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicTagService = topicTagService;
     _categoryService = categoryService;
     _cacheService = cacheService;
 }
开发者ID:huchao007,项目名称:mvcforum,代码行数:7,代码来源:TagController.cs

示例7: TorznabController

 public TorznabController(IIndexerManagerService i, Logger l, IServerService s, ICacheService c)
 {
     indexerService = i;
     logger = l;
     serverService = s;
     cacheService = c;
 }
开发者ID:iheijoushin,项目名称:Jackett,代码行数:7,代码来源:TorznabController.cs

示例8: MenuItemSelectorViewModel

        public MenuItemSelectorViewModel(IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, IMenuService menuService,
            ISettingService settingService, ICacheService cacheService)
        {
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _menuService = menuService;
            _settingService = settingService;
            _cacheService = cacheService;

            CategoryCommand = new DelegateCommand<ScreenMenuCategory>(OnCategoryCommandExecute);
            MenuItemCommand = new DelegateCommand<ScreenMenuItem>(OnMenuItemCommandExecute);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecute);
            FindLocationCommand = new DelegateCommand<string>(OnFindLocationExecute, CanFindLocation);
            FindMenuItemCommand = new DelegateCommand<string>(OnFindMenuItemCommand);
            FindTicketCommand = new DelegateCommand<string>(OnFindTicketExecute, CanFindTicket);
            IncPageNumberCommand = new CaptionCommand<string>(Localization.Properties.Resources.NextPage + " >>", OnIncPageNumber, CanIncPageNumber);
            DecPageNumberCommand = new CaptionCommand<string>("<< " + Localization.Properties.Resources.PreviousPage, OnDecPageNumber, CanDecPageNumber);
            SubCategoryCommand = new CaptionCommand<ScreenSubCategoryButton>(".", OnSubCategoryCommand);

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnNumeratorReset);
            NumeratorValue = "";

            SubCategories = new ObservableCollection<ScreenSubCategoryButton>();
        }
开发者ID:Spanky81,项目名称:SambaPOS-3,代码行数:25,代码来源:MenuItemSelectorViewModel.cs

示例9: AbstractHttpDataService

 public AbstractHttpDataService(string baseUrl, string username, string password, ICacheService cacheService)
 {
   this.BaseUrl = baseUrl;
   this.UserName = username;
   this.Password = password;
   this.CacheService = cacheService;
 }
开发者ID:michaelkauflin,项目名称:teamcity-dashboard,代码行数:7,代码来源:AbstractHttpDataService.cs

示例10: ReturningAmountViewModel

 public ReturningAmountViewModel(ICacheService cacheService, IApplicationState applicationState,
      PaymentEditor paymentEditor)
 {
     _cacheService = cacheService;
     _applicationState = applicationState;
     _paymentEditor = paymentEditor;
 }
开发者ID:hperassi,项目名称:SambaPOS-3,代码行数:7,代码来源:ReturningAmountViewModel.cs

示例11: TicketListerWidgetViewModel

        public TicketListerWidgetViewModel(Widget model, IApplicationState applicationState, ITicketServiceBase ticketService,
            IPrinterService printerService, ICacheService cacheService, IAutomationDao automationDao)
            : base(model, applicationState)
        {
            _applicationState = applicationState;
            _ticketService = ticketService;
            _printerService = printerService;
            _cacheService = cacheService;
            _automationDao = automationDao;
            ItemSelectionCommand = new DelegateCommand<TicketViewData>(OnItemSelection);

            EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe(
            x =>
            {
                if (_applicationState.ActiveAppScreen == AppScreens.EntityView
                    && x.Topic == EventTopicNames.MessageReceivedEvent
                    && x.Value.Command == Messages.TicketRefreshMessage)
                {
                    Refresh();
                }
            });

            EventServiceFactory.EventService.GetEvent<GenericEvent<WidgetEventData>>().Subscribe(
            x =>
            {
                if (x.Value.WidgetName == Name)
                {
                    State = x.Value.Value;
                }
            });
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:31,代码来源:TicketListerWidgetViewModel.cs

示例12: ReturningAmountViewModel

 public ReturningAmountViewModel(ICacheService cacheService, IAutomationService automationService,
      PaymentEditor paymentEditor)
 {
     _cacheService = cacheService;
     _automationService = automationService;
     _paymentEditor = paymentEditor;
 }
开发者ID:shuxingliu,项目名称:SambaPOS-3,代码行数:7,代码来源:ReturningAmountViewModel.cs

示例13: SubentroWCFService

 public SubentroWCFService(IVersamentiCondominiService versamentiCondominiService, INotaPredefinitaService notaPredefinitaService, IPersonaService personaService, ICacheService cacheService)
 {
     _versamentiCondominiService = versamentiCondominiService;
     _notaPredefinitaService = notaPredefinitaService;
     _personaService = personaService;
     _cacheService = cacheService;
 }
开发者ID:gipasoft,项目名称:Sfera,代码行数:7,代码来源:SubentroWCFService.cs

示例14: ChangeTicketEntity

 public ChangeTicketEntity(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IEntityService entityService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _entityService = entityService;
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:ChangeTicketEntity.cs

示例15: BatchDocumentCreatorViewModel

 public BatchDocumentCreatorViewModel(IAccountService accountService, ICacheService cacheService)
 {
     Accounts = new ObservableCollection<AccountRowViewModel>();
     _accountService = accountService;
     _cacheService = cacheService;
     CreateDocuments = new CaptionCommand<string>(string.Format(Resources.Create_f, "").Trim(), OnCreateDocuments, CanCreateDocument);
 }
开发者ID:shuxingliu,项目名称:SambaPOS-3,代码行数:7,代码来源:BatchDocumentCreatorViewModel.cs


注:本文中的ICacheService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。