protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("Company Symbol"); dt.Columns.Add("Company Name"); dt.Columns.Add("Quantity Available", typeof(int)); dt.Columns.Add("Price", typeof(Double)); dt.Columns.Add("Update Date", typeof(DateTime)); String companySymbol = SymbolTextBox.Text; String companyName = CompanyNameTextBox.Text; int minQtyAvailable = string.IsNullOrEmpty(MinQuantityTextBox.Text) ? -1 : Int32.Parse(MinQuantityTextBox.Text); int maxQtyAvailable = string.IsNullOrEmpty(MaxQuantityTextBox.Text) ? -1 : Int32.Parse(MaxQuantityTextBox.Text); Double minPrice = string.IsNullOrEmpty(MinPriceTextBox.Text) ? -1 : Double.Parse(MinPriceTextBox.Text); Double maxPrice = string.IsNullOrEmpty(MaxPriceTextBox.Text) ? -1 : Double.Parse(MaxPriceTextBox.Text); SharesBrokeringWSReference.SharesBrokeringWSClient javaWSclient = new SharesBrokeringWSReference.SharesBrokeringWSClient(); SharesBrokeringWSReference.user u = javaWSclient.getUser(Session["username"].ToString()); Session["currency"] = u.Currency; SharesBrokeringWSReference.Share[] shares = javaWSclient.GetFilteredShares(companySymbol, companyName, minQtyAvailable, maxQtyAvailable, minPrice, maxPrice, u.Currency); if (shares != null) { NoSharesFoundLabel.Visible = false; foreach (SharesBrokeringWSReference.Share s in shares) { DataRow row = dt.NewRow(); row[0] = s.CompanySymbol; row[1] = s.CompanyName; row[2] = s.QtyAvailable; row[3] = s.Price.Value; row[4] = s.UpdateDate; dt.Rows.Add(row); } } else { NoSharesFoundLabel.Visible = true; } SharesGridView.DataSource = dt; SharesGridView.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { CurrencyListBox.Visible = false; ConfirmCurrencyButton.Visible = false; AmountLabel.Visible = false; AmountTextBox.Visible = false; ConfirmDepositButton.Visible = false; ConfirmWithdrawButton.Visible = false; SharesBrokeringWSReference.SharesBrokeringWSClient javaWSclient = new SharesBrokeringWSReference.SharesBrokeringWSClient(); SharesBrokeringWSReference.user u = javaWSclient.getUser(Session["username"].ToString()); CurrentCurrencyValueLabel.Text = u.Currency; Session["currency"] = u.Currency; CurrentWalletValueLabel.Text = u.Wallet.ToString(); Session["wallet"] = u.Wallet; }