public IProposal ToProposal(IProposal proposal) { proposal.Sender = Sender; proposal.Message = Message; proposal.JobId = JobId; return(proposal); }
public void AddSelection([NotNull] IProposal proposal, int index = -1) { var selectedAfter = DateTimeOffset.Now - TriggeredAt; Selections.Add(new ProposalSelection { Proposal = proposal, SelectedAfter = selectedAfter, Index = index }); }
public Task ApproveProposalAsync(IProposal proposal) { if (proposal is Proposal2D <byte> p) { this.state.X = p.NewX; this.state.Y = p.NewY; } return(Task.FromResult(1)); }
public static ProposalVM Parse(IProposal vm) { return(new ProposalVM() { Id = vm.Id, Sender = vm.Sender, Message = vm.Message, JobId = vm.JobId }); }
public Order(IProposal proposal, double quantity) { int propIndex = -1; SecurityEntry ownerEntry = ((MDEntryGroup) proposal).OwnerEntry; propIndex = ownerEntry.GetGroupIndex((MDEntryGroup)proposal); weakCopy = ((Proposal) proposal).OwnerEntry.WeakClone(); currentMDGroup = weakCopy.GetGroup((uint) propIndex); OrderMessage = FixApplication.Current.NewOrder(proposal, quantity); }
private static void AppendProposalName(StringBuilder proposalRepresentation, IProposal proposal) { if (proposal.Name != null) { var identifier = proposal.Name.Identifier.EncodeSpecialChars(); proposalRepresentation.Append(identifier); } else { proposalRepresentation.Append("???"); } }
public void Propose(IProposal proposal) { if (proposal == null) { return; } if (proposal is Proposal2D <T> ) { lock (mSyncRoot) { mProposals.Add((Proposal2D <T>)proposal); } } else { throw new ArgumentException("Only Proposal2D<T> is supported."); } }
//public ClientBO() //{ // _dao = new ClientDAO(); //} /* * CRUD + LIST */ #region CREATE public virtual OperationResult Create(IProposal proposal) { try { using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled); _dao.Create(proposal); transactionScope.Complete(); return(new OperationResult <List <IProposal> >() { Success = true }); } catch (Exception e) { return(new OperationResult <List <IProposal> >() { Success = false, Exception = e }); } }
public async virtual Task <OperationResult> DeleteAsync(IProposal proposal) { try { using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled); await _dao.DeleteAsync(proposal); transactionScope.Complete(); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }
private static void AnonymizeCodeNames(IProposal proposal) { proposal.Name = proposal.Name.ToAnonymousName(); }
public void Add(IProposal proposal) { Proposals.Add(proposal); }
public async Task DeleteAsync(IProposal client) { client.IsDeleted = true; await UpdateAsync(client); }
public void Delete(IProposal client) { client.IsDeleted = true; Update(client); }
public async Task UpdateAsync(IProposal client) { _context.Entry(client).State = EntityState.Modified; await _context.SaveChangesAsync(); }
public void Update(IProposal client) { _context.Entry(client).State = EntityState.Modified; _context.SaveChanges(); }
public async Task CreateAsync(IProposal client) { await _context.Set <IProposal>().AddAsync(client); await _context.SaveChangesAsync(); }
public void Create(IProposal client) { _context.Set <IProposal>().Add(client); _context.SaveChanges(); }
public ProposalSelection(IProposal p) { Proposal = p; Index = DefaultIndex; }
public int GetPosition(IProposal proposal) { return(Proposals.IndexOf(proposal)); }
public Message NewOrder(IProposal proposal, double quantity) { bool isInvertedSecurity = ((Proposal)proposal).OwnerEntry.IsInverted; Message message = null; Account account = new Account(GetOrderSession().getSenderCompID().ToLower()); ClOrdID clOrdId = new ClOrdID("ClOrd_" + Guid.NewGuid()); HandlInst handlInst = new HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION); OrdType ordType = new OrdType(OrdType.LIMIT); TimeInForce timeInForce = new TimeInForce(TimeInForce.FILL_OR_KILL); TransactTime transactTime = new TransactTime(); Price price = new Price(((Proposal)proposal).MDEntryPx); SecurityExchange securityExchange = new SecurityExchange(((Proposal)proposal).OwnerEntry.SecurityExchange); SecurityType securityType = new SecurityType(((Proposal)proposal).OwnerEntry.SecurityType); Symbol symbol = new Symbol(((Proposal)proposal).OwnerEntry.Symbol); SecurityID securityId = new SecurityID(((Proposal)proposal).OwnerEntry.SecurityID); OrderQty orderQty = new OrderQty(quantity); Side side = null; switch (proposal.Action) { case EntryType.Bid: side = !isInvertedSecurity ? new Side(Side.SELL) : new Side(Side.BUY); break; case EntryType.Offer: side = !isInvertedSecurity ? new Side(Side.BUY) : new Side(Side.SELL); break; default: throw new Exception("Undefined entry type."); } message = new QuickFix42.NewOrderSingle(); ((QuickFix42.NewOrderSingle)message).set(account); ((QuickFix42.NewOrderSingle)message).set(clOrdId); ((QuickFix42.NewOrderSingle)message).set(side); ((QuickFix42.NewOrderSingle)message).set(transactTime); ((QuickFix42.NewOrderSingle)message).set(ordType); ((QuickFix42.NewOrderSingle)message).set(price); ((QuickFix42.NewOrderSingle)message).set(orderQty); ((QuickFix42.NewOrderSingle)message).set(securityId); ((QuickFix42.NewOrderSingle)message).set(securityExchange); ((QuickFix42.NewOrderSingle)message).set(timeInForce); ((QuickFix42.NewOrderSingle)message).set(securityType); return message; }
public bool CompareToModel(IProposal model) { return(Sender == model.Sender && Message == model.Message && JobId == model.JobId); }