コード例 #1
0
ファイル: SellingState.cs プロジェクト: ashic/StopLoss
        public StockState HandleTimeout(SellCommand command)
        {
            if(_version == command.Version)
                return new SoldState(command.Id);

            return this;
        }
コード例 #2
0
 public SellPageVM(SellPage page)
 {
     Page        = page;
     ShowItems   = new ShowItemsToSellCommand(this, new Operations());
     SellCommand = new SellCommand(page);
     ItemsToSell = new ObservableCollection <Item>();
     Page.dataGrid.ItemsSource = ItemsToSell;
     Page.time.Text            = DateTime.Now.ToString();
 }
コード例 #3
0
        public static async Task Main(string[] args)
        {
            ThreadPool.SetMinThreads(Environment.ProcessorCount * 15, Environment.ProcessorCount * 10);
            var _auditor            = new AuditWriter();
            var sell_service        = new SellCommand(Service.SELL_SERVICE, _auditor);
            var sell_commit_service = new SellCommitCommand(Service.SELL_COMMIT_SERVICE, _auditor);
            var sell_cancel_service = new SellCancelCommand(Service.SELL_CANCEL_SERVICE, _auditor);

            List <Task> tasks = new List <Task>
            {
                sell_service.StartService(),
                        sell_commit_service.StartService(),
                        sell_cancel_service.StartService()
            };

            await Task.WhenAll(tasks).ConfigureAwait(false);
        }
コード例 #4
0
        public async Task <IActionResult> Index(SellCommand command, string displayUrl)
        {
            try
            {
                command.UserId      = CurrentUserService.UserId;
                command.CurrencyUrl = displayUrl;

                await Mediator.Send(command);

                return(RedirectToAction("Sells", "Factors"));
            }
            catch (ValidationException exception)
            {
                foreach (var(key, value) in exception.Errors)
                {
                    ModelState.AddModelError(key, value[0]);
                }
                return(View(command));
            }
            catch (NotFoundException exception)
            {
                return(NotFound(exception.Message));
            }
        }
コード例 #5
0
ファイル: IncreasingState.cs プロジェクト: ashic/StopLoss
 public StockState HandleTimeout(SellCommand command)
 {
     return this;
 }
コード例 #6
0
ファイル: Stock.cs プロジェクト: ashic/StopLoss
 public void HandleTimeout(SellCommand command)
 {
     _state = _state.HandleTimeout(command);
 }
コード例 #7
0
ファイル: SoldState.cs プロジェクト: ashic/StopLoss
 public StockState HandleTimeout(SellCommand command)
 {
     return(this);
 }
コード例 #8
0
ファイル: Stock.cs プロジェクト: ashic/StopLoss
 public void HandleTimeout(SellCommand command)
 {
     _state = _state.HandleTimeout(command);
 }