protected void Page_Load(object sender, EventArgs e) { /* userID:"487f3303-041e-479f-9cc9-cc6e2e31c247", tradeTypeID:"2", orderTypeID:"2", tickerSymbol:id, quantity: 1987, tradeStatusID: 1, */ try{ string qty = Request.QueryString["quantity"].ToString(); //string uid = Request.QueryString["uid"].ToString(); string tradeTypeID = Request.QueryString["tradeTypeID"].ToString(); string orderTypeID = Request.QueryString["orderTypeID"].ToString(); string tickerSymbol = Request.QueryString["tickerSymbol"].ToString(); string tradeStatusID = Request.QueryString["tradeStatusID"].ToString(); TAExchangeTradeEntities dbEntities = new TAExchangeTradeEntities(); trade newTrade = new trade(); MembershipUser user = Membership.GetUser(); newTrade.quantity = Convert.ToInt32(qty); newTrade.userID = new Guid(user.ProviderUserKey.ToString()); newTrade.tradeTypeID = Convert.ToInt32(tradeTypeID); newTrade.orderTypeID = Convert.ToInt32(orderTypeID); newTrade.tickerSymbol = tickerSymbol; newTrade.tradeStatusID = Convert.ToInt32(tradeStatusID); //newTrade.transactionID = 35; dbEntities.AddTotrades(newTrade); dbEntities.SaveChanges(); output.Text = "Success"; } catch (Exception ex) { output.Text = (ex.ToString()); } //output.Text = Request.QueryString["quantity"].ToString(); }
/// <summary> /// Deprecated Method for adding a new object to the trades EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotrades(trade trade) { base.AddObject("trades", trade); }
/// <summary> /// Create a new trade object. /// </summary> /// <param name="transactionID">Initial value of the transactionID property.</param> /// <param name="userID">Initial value of the userID property.</param> /// <param name="tradeTypeID">Initial value of the tradeTypeID property.</param> /// <param name="orderTypeID">Initial value of the orderTypeID property.</param> /// <param name="tickerSymbol">Initial value of the tickerSymbol property.</param> /// <param name="quantity">Initial value of the quantity property.</param> /// <param name="tradePrice">Initial value of the tradePrice property.</param> /// <param name="tradeStatusID">Initial value of the tradeStatusID property.</param> public static trade Createtrade(global::System.Int32 transactionID, global::System.Guid userID, global::System.Int32 tradeTypeID, global::System.Int32 orderTypeID, global::System.String tickerSymbol, global::System.Decimal quantity, global::System.Decimal tradePrice, global::System.Int32 tradeStatusID) { trade trade = new trade(); trade.transactionID = transactionID; trade.userID = userID; trade.tradeTypeID = tradeTypeID; trade.orderTypeID = orderTypeID; trade.tickerSymbol = tickerSymbol; trade.quantity = quantity; trade.tradePrice = tradePrice; trade.tradeStatusID = tradeStatusID; return trade; }