public void TransferSelectedItemsToNewTote(List <InventoryItem> objects, Tote tote) { foreach (InventoryItem item in objects) { Scout.Core.Service <IInventoryService>().AddItemToTote(tote, item); } }
public ToteTransferForm(Tote tote) { InitializeComponent(); m_tote = tote; Init(); Bind(); }
public ToteDetailView(Tote tote) { m_tote = tote; InitializeComponent(); Init(); Bind(); }
public ToteContentsSelectorForm(ToteContentsTransferCommandArguments args) { m_args = args; m_tote = m_args.CurrentTote; InitializeComponent(); Bind(); WireEvents(); }
public ToteAddContentsForm(Tote tote) { m_tote = tote; m_session = tote.Session; InitializeComponent(); WireEvents(); RefreshContents(); }
public ToteManagerForm(Tote tote) { InitializeComponent(); m_tote = tote; Bind(); WireCommandRequests(); WireEvents(); }
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); } }
public ToteWinnersLoosersReportMessage(FinishedToteRewards rewards, Tote tote) { Option = rewards.WinningOptionName; WinningBets = rewards.WinningBets; Rewards = rewards.ProportionalReward; OwnerPercent = rewards.OwnerPercent; ToteId = tote.Id; ToteOwner = tote.Owner; }
/// <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; }
public void TransferToteToDomain(Tote tote, Domain domain) { tote.Domain = domain; foreach (InventoryItem item in tote.Contents) { item.ChangeDomain(domain); } }
public ToteContentsPutAwayForm(ToteContentsTransferCommandArguments args) { InitializeComponent(); m_tote = args.CurrentTote; m_args = args; Init(); Bind(); WireEvents(); }
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; }
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)); }
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); }
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); }
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)); }
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); }
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(); } } }
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); }
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); } }
public ToteTransferCommandArguments(Tote tote) { m_tote = tote; }
public ToteAddItemsDomainCommand(params object[] input) : base(input) { m_tote = input[0] as Tote; }
public TotePrintLabelDomainCommand(params object[] input) : base(input) { m_tote = input[0] as Tote; }
public ToteStatusMessage(MessageContext context, Tote tote) { Context = context; Tote = tote; }
public ToteContentsTransferCommandArguments(Tote currentTote) { m_currentTote = currentTote; m_itemsToMove = new List <InventoryItem>(); m_session = m_currentTote.Session; }
public ToteRemoveItemsCommandArguments(Tote tote) { m_session = tote.Session; m_tote = tote; m_itemsToRemove = new List <InventoryItem>(); }