コード例 #1
0
ファイル: ToteService.cs プロジェクト: ewin66/SCOUT_NS
 public void TransferSelectedItemsToNewTote(List <InventoryItem> objects, Tote tote)
 {
     foreach (InventoryItem item in objects)
     {
         Scout.Core.Service <IInventoryService>().AddItemToTote(tote, item);
     }
 }
コード例 #2
0
 public ToteTransferForm(Tote tote)
 {
     InitializeComponent();
     m_tote = tote;
     Init();
     Bind();
 }
コード例 #3
0
 public ToteDetailView(Tote tote)
 {
     m_tote = tote;
     InitializeComponent();
     Init();
     Bind();
 }
コード例 #4
0
 public ToteContentsSelectorForm(ToteContentsTransferCommandArguments args)
 {
     m_args = args;
     m_tote = m_args.CurrentTote;
     InitializeComponent();
     Bind();
     WireEvents();
 }
コード例 #5
0
 public ToteAddContentsForm(Tote tote)
 {
     m_tote    = tote;
     m_session = tote.Session;
     InitializeComponent();
     WireEvents();
     RefreshContents();
 }
コード例 #6
0
ファイル: toteManagerForm.cs プロジェクト: ewin66/SCOUT_NS
 public ToteManagerForm(Tote tote)
 {
     InitializeComponent();
     m_tote = tote;
     Bind();
     WireCommandRequests();
     WireEvents();
 }
コード例 #7
0
 public ToteContentsPutAwayCommand(params object[] input) : base(input)
 {
     m_tote = input[0] as Tote;
     if (m_tote != null)
     {
         Args[0] = new ToteContentsTransferCommandArguments(input[0] as Tote);
     }
 }
コード例 #8
0
 public ToteWinnersLoosersReportMessage(FinishedToteRewards rewards, Tote tote)
 {
     Option       = rewards.WinningOptionName;
     WinningBets  = rewards.WinningBets;
     Rewards      = rewards.ProportionalReward;
     OwnerPercent = rewards.OwnerPercent;
     ToteId       = tote.Id;
     ToteOwner    = tote.Owner;
 }
コード例 #9
0
ファイル: InventoryService.cs プロジェクト: ewin66/SCOUT_NS
        /// <summary>
        /// Adds a inventory item to a tote
        /// </summary>
        /// <param name="tote">Tote</param>
        /// <param name="item">InventoryItem</param>
        public void AddItemToTote(Tote tote, InventoryItem item)
        {
            if (item.Tote != null)
            {
                RemoveItemFromTote(item);
            }

            item.Tote = tote;
        }
コード例 #10
0
ファイル: ToteService.cs プロジェクト: ewin66/SCOUT_NS
        public void TransferToteToDomain(Tote tote, Domain domain)
        {
            tote.Domain = domain;

            foreach (InventoryItem item in tote.Contents)
            {
                item.ChangeDomain(domain);
            }
        }
コード例 #11
0
        public ToteContentsPutAwayForm(ToteContentsTransferCommandArguments args)
        {
            InitializeComponent();

            m_tote = args.CurrentTote;
            m_args = args;

            Init();
            Bind();
            WireEvents();
        }
コード例 #12
0
        public ToteRemoveItemDomainCommand(params object[] input) : base(input)
        {
            Tote tote = input[0] as Tote;

            if (tote != null)
            {
                Args[0] = new ToteContentsTransferCommandArguments(tote);
            }

            m_session = tote.Session;
        }
コード例 #13
0
        public async Task <Tote> RemoveAsync(Tote current, int number)
        {
            var option = current.Options.FirstOrDefault(a => a.Number == number);
            var byId   = Builders <Tote> .Filter.Eq(a => a.Id, current.Id);

            var removeFromOptions = Builders <Tote> .Update.Pull(a => a.Options, option);

            await _ms.Totes.UpdateOneAsync(byId, removeFromOptions);

            return(await _get.GetAsync(current.Id));
        }
コード例 #14
0
        private async Task SetTote(PlaceBetStartMessage pars)
        {
            _user      = pars.UserId;
            _toteValue = await _getTote.GetAsync(pars.ToteId);

            var balance = await _balance.GetAsync(_cp.Period, _user, _toteValue.Currency, false);

            var balanceAmount = balance.Count > 0 ? balance[0].Amount : 0;
            await _slack.Dialog(pars.TriggerId, LongMessagesToUser.ToteDialog(_toteValue, balanceAmount));

            // await _response.ResponseWithBlocks(pars.ResponseUrl, LongMessagesToUser.ToteOptionsButtons(_toteValue, balanceAmount).ToList(), true);
        }
コード例 #15
0
    private void AddTote(Node _node, int _toteNumber, int _productId, int _quantity)
    {
        Tote newTote       = Instantiate(referenceTote, _node.transform.position + Constants.TOTE_RAISE, Quaternion.identity * Quaternion.Euler(0, 90, 0), this.transform);
        int  newToteNumber = _toteNumber;

        newTote.PopulateItems(_productId, _quantity);
        newTote.gridPos    = _node.gridPos;
        newTote.name       = "Tote" + newToteNumber.ToString();
        newTote.number     = newToteNumber;
        newTote.properties = properties;

        allTotes.Add(newTote);
    }
コード例 #16
0
        public async Task <Tote> AddAsync(Tote current, string name)
        {
            var number = current.Options.Any() ? current.Options.Max(a => a.Number) : 0;

            await _ms.Totes.UpdateOneAsync(Builders <Tote> .Filter.Eq(a => a.Id, current.Id),

                                           Builders <Tote> .Update.Push(a => a.Options, new ToteOption
            {
                Bets   = Array.Empty <ToteBet>(),
                Id     = ObjectId.GenerateNewId().ToString(),
                Name   = name,
                Number = number + 1
            }));

            return(await _get.GetAsync(current.Id));
        }
コード例 #17
0
        public async Task <Tote> CreateNewAsync(string user, string currency, string name)
        {
            var tote = new Tote
            {
                Currency    = currency,
                Description = name,
                Id          = ObjectId.GenerateNewId().ToString(),
                Options     = new ToteOption[] {},
                Owner       = user,
                State       = ToteState.Created,
                CreatedOn   = DateTime.Now,
                FinishedOn  = null,
                CancelledOn = null
            };
            await _ms.Totes.InsertOneAsync(tote);

            return(tote);
        }
コード例 #18
0
ファイル: shippingForm.cs プロジェクト: ewin66/SCOUT_NS
        void cartLookup_EditValueChanged(object sender, EventArgs e)
        {
            Tote tote = cartLookup.EditValue as Tote;

            if (tote != null)
            {
                IOutputCommand <List <InventoryItem> > command =
                    m_frontController.RunCommand(
                        ToteCommands.ToteContentsSelector,
                        tote
                        ) as IOutputCommand <List <InventoryItem> >;

                if (command != null)
                {
                    Scout.Core.Modules.Warehouse.Shipping.ProcessBulkShipments
                        (m_salesOrder, command.Output);

                    RefreshData();
                }
            }
        }
コード例 #19
0
        public void TestSimpleRewards()
        {
            var q = new FinishToteAmountsLogicQuery();
            var t = new Tote
            {
                Owner   = "owner",
                Options = new[]
                {
                    new ToteOption {
                        Id = "o1", Bets = new[] { new ToteBet {
                                                      Amount = 100, User = "******"
                                                  }, new ToteBet {
                                                      Amount = 200, User = "******"
                                                  } }
                    },
                    new ToteOption {
                        Id = "o2", Bets = new[] { new ToteBet {
                                                      Amount = 300, User = "******"
                                                  }, new ToteBet {
                                                      Amount = 300, User = "******"
                                                  } }
                    }
                }
            };
            var     r         = q.CalcRewards(t, "o1");
            decimal total     = 900;
            decimal percent   = total / 20m;
            decimal onethird  = ((900 - percent) / 3).Trim();
            decimal twothird  = (2 * ((900 - percent) / 3)).Trim();
            decimal remainder = total - percent - onethird - twothird;

            Assert.AreEqual(r.OwnerPercent, remainder + percent);
            Assert.AreEqual(onethird, r.ProportionalReward[0].Amount);
            Assert.AreEqual(twothird, r.ProportionalReward[1].Amount);
            Assert.AreEqual("1", r.ProportionalReward[0].Account.UserId);
            Assert.AreEqual("2", r.ProportionalReward[1].Account.UserId);
        }
コード例 #20
0
        private void transferButton_Click(object sender, EventArgs e)
        {
            Tote destinationTote = toteLookup.EditValue as Tote;

            if (destinationTote == null)
            {
                return;
            }
            try
            {
                m_totes.TransferSelectedItemsToNewTote(m_args.ItemsToMove, destinationTote);

                Scout.Core.Data.Save(m_session);

                Scout.Core.UserInteraction.Dialog.ShowMessage
                    ("Transfer Complete", UserMessageType.Information);

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #21
0
 public ToteTransferCommandArguments(Tote tote)
 {
     m_tote = tote;
 }
コード例 #22
0
 public ToteAddItemsDomainCommand(params object[] input) : base(input)
 {
     m_tote = input[0] as Tote;
 }
コード例 #23
0
 public TotePrintLabelDomainCommand(params object[] input) : base(input)
 {
     m_tote = input[0] as Tote;
 }
コード例 #24
0
 public ToteStatusMessage(MessageContext context, Tote tote)
 {
     Context = context;
     Tote    = tote;
 }
コード例 #25
0
 public ToteContentsTransferCommandArguments(Tote currentTote)
 {
     m_currentTote = currentTote;
     m_itemsToMove = new List <InventoryItem>();
     m_session     = m_currentTote.Session;
 }
コード例 #26
0
 public ToteRemoveItemsCommandArguments(Tote tote)
 {
     m_session       = tote.Session;
     m_tote          = tote;
     m_itemsToRemove = new List <InventoryItem>();
 }