Beispiel #1
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        //to get all the data from dividendDB by calling the method and search by id
        Dividend d = DividendDB.getADividend(lblDividendID.Text);

        //get the selected one
        d.Status = ddlStatus.SelectedItem.Text;
        //updating by calling the method from dividend
        int result = DividendDB.updateDividend(d);

        if (result > 0)
        {
            Page_Load(sender, e);
        }
    }
Beispiel #2
0
    protected void gvDividendPendingA_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        pnlEdit.Visible = true;
        //to get the selected index
        Dividend d = DividendDB.getADividend(e.CommandArgument.ToString());

        if (d == null)
        {
            lblDividendID.Text = "";
            ddlStatus.Text     = "Paid";
        }
        else
        {
            //take the value from dividend
            lblDividendID.Text = d.DividendId.ToString();
            ddlStatus.Text     = d.Status.ToString();
        }
    }