Exemplo n.º 1
0
    private void BindDataToDDL()
    {
        var listPacks = availableOptions;

        var list = new Dictionary <string, string>();

        foreach (PortfolioShare share in listPacks)
        {
            PortfolioProduct Product = share.Product;
            list.Add(share.Id.ToString(), Product.Name + " (" + SharesMarketManager.GetSharesAvailableForSale(share) + " " + Resources.U4000.UNITS + ")");
        }
        ddlOptions.DataSource     = list;
        ddlOptions.DataTextField  = "Value";
        ddlOptions.DataValueField = "Key";
        ddlOptions.DataBind();
    }
Exemplo n.º 2
0
    protected void AuctionGrid1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ShareOnMarket Share = new ShareOnMarket(Convert.ToInt32(e.Row.Cells[0].Text));

            // 3 - Portfolio Product
            // 5 - Price WITH FEE

            PortfolioProduct Product = new PortfolioProduct(Share.PortfolioProductId);

            e.Row.Cells[3].Text = "<a href=\"products.aspx?id=" + Product.Id + "\">" + Product.Name + "</a>";
            e.Row.Cells[5].Text = SharesMarketManager.CalculatePriceWithFee(Share.Price).ToString();

            ((LiteralControl)e.Row.Cells[6].Controls[2]).Text = " " + L1.BUY;
        }
    }