开发者

Gridview retrieving old values before updating

I am using gridview to populate data, i retrieve the new values but i need the old values for reporting purposes, is there a way i could retrieve these old values? I am using templatefield

     protected void TcGridView_RowEditing(object sender, GridViewEditEventArgs e)
    {

        T开发者_高级运维cGridView.EditIndex = e.NewEditIndex;

        FillTravelers();
    }

            protected void TcGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow row = TcGridView.Rows[e.RowIndex];

        //FillTravelers();
        TcGridView.EditIndex = -1;
        TextBox txtFC = row.FindControl("FCTextBox1") as TextBox;

        Label txtID = row.FindControl("IDLabel") as Label;
        Label txtDC = row.FindControl("DCLabel") as Label;
        Label txtRate = row.FindControl("RateLabel") as Label;

        String FC = txtFC.Text;
        String ID = txtID.Text;
        String DC = txtDC.Text;
        String Rate = txtRate.Text;

        double newDC = Convert.ToDouble(FC) / Convert.ToDouble(Rate);

        Transaction trs = new Transaction(Convert.ToInt32(ID), " ", " ", Convert.ToDouble(FC), Convert.ToDouble(Rate), newDC, " ", ID);
        DatabaseHandler.EditTransaction(trs);

        FillTravelers();
    }

Thanks Karl

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜