コード例 #1
0
        public BrokerBO AddBroker(BrokerBO broker)
        {
            broker _broker = new broker();

            _broker.brokername = broker.BrokerName;
            if (broker.Address != null)
            {
                _broker.addrkey = broker.Address.AddrKey;
            }
            _broker.brokerid = broker.BrokerId;
            var brokerguid = repo.Add(_broker);

            broker.BrokerKey = brokerguid;
            return(broker);
        }
コード例 #2
0
        // Approve proposal (check risk, bank balance, etc)
        public async Task Handle(StockQuotationProposal arrivedProposal, CancellationToken cancellationToken)
        {
            if (arrivedProposal._ownerId != _id)
            {
                return;
            }

            // Instructions to approve proposal

            var stockQuotation = new StockQuotation(arrivedProposal);

            _newYorkStockExchange.Publish(stockQuotation).Wait();

            if (!stockQuotation._isExecuted)
            {
                _brokerRepository.Add(stockQuotation);
            }
        }
コード例 #3
0
        // POST api/values
        public HttpResponseMessage Post([FromBody] BrokerBO brokerBO)
        {
            Data.broker _broker = new Data.broker();

            _broker.brokerid   = brokerBO.BrokerId;
            _broker.brokername = brokerBO.BrokerName;
            _broker.status     = 1;
            _broker.statusdate = DateTime.Now;

            if (brokerBO.Address != null)
            {
                var custaddress = new Data.address()
                {
                    address1 = brokerBO.Address.Address1,
                    address2 = brokerBO.Address.Address2,
                    city     = brokerBO.Address.City,
                    state    = brokerBO.Address.State,
                    country  = brokerBO.Address.Country,
                    zipcode  = brokerBO.Address.Zip,
                    email    = brokerBO.Address.Email,
                    fax      = brokerBO.Address.Fax,
                    addrname = _broker.brokerid
                };
                var addrkey = new AddressRepository().Add(custaddress);
                _broker.addrkey = addrkey;
            }
            Guid brokerid = repo.Add(_broker);

            if (brokerid != null && brokerid != Guid.Empty)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, brokerid, Configuration.Formatters.JsonFormatter));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }
コード例 #4
0
 public void Add(BrokerModel entity)
 {
     _repository.Add(entity);
 }