Example #1
0
    protected void bindTradeComboBox()
    {
        DataSetGlobal.TradeDataTable dt = new DataSetGlobal.TradeDataTable();
        DataSetGlobalTableAdapters.TradeTableAdapter ta = new DataSetGlobalTableAdapters.TradeTableAdapter();
        ta.Fill(dt, (String)HttpContext.Current.Session["currentContract"]);

        this.ComboBoxTrade.DataSource = dt;
        dt.AddTradeRow("select", "select");
        this.ComboBoxTrade.DataTextField = dt.TradeColumn.ToString();
        this.ComboBoxTrade.DataValueField = dt.TradeColumn.ToString();
        this.ComboBoxTrade.SelectedValue = "select";
        this.ComboBoxTrade.DataBind();
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Get list of trades and position categories of the current contract
        dtTrade = new DataSetGlobal.TradeDataTable();
        DataSetGlobalTableAdapters.TradeTableAdapter ta = new DataSetGlobalTableAdapters.TradeTableAdapter();
        ta.Fill(dtTrade, (String)HttpContext.Current.Session["currentContract"]);
        dtTrade.AddTradeRow("select", "select");

        dtPositionCategory = new DataSetGlobal.PositionCategoryDataTable();
        DataSetGlobalTableAdapters.PositionCategoryTableAdapter ta2 = new DataSetGlobalTableAdapters.PositionCategoryTableAdapter();
        ta2.Fill(dtPositionCategory, (String)HttpContext.Current.Session["currentContract"]);
        dtPositionCategory.AddPositionCategoryRow("select", "select");

        if (this.GridView1.Rows.Count == 0)
        {
            this.LabelNoRecordFound.Visible = true;
        }

        if (GridViewAddWorkers.Rows.Count == 0)
        {
            LabelNoExistingWorker.Visible = true;
        }

        hideContractorCAItems();
    }