Example #1
0
    protected void grvConsutarSop_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int index = int.Parse(e.CommandArgument.ToString());

        GridViewRow row = grvConsutarSop.Rows[(index)];

        if (e.CommandName == "Modificar_Click")
        {
            string sop_Id = row.Cells[2].Text;

            DataTable dt = new DataTable();
            dt                         = AdministrarSoportesBancarios.ConsultarSoporteBancarioEditar(sop_Id);
            txtSop_Id.Text             = sop_Id;
            txtIdentificacionEdit.Text = dt.Rows[0]["identificacion"].ToString();
            txtReferenciaEdit.Text     = dt.Rows[0]["referencia"].ToString();
            txtTalonEdit.Text          = dt.Rows[0]["talon"].ToString();
            txtValorEdit.Text          = dt.Rows[0]["valor"].ToString();
            //txtValorNumEdit.Text = dt.Rows[0]["valorNum"].ToString();

            int estadoSop = int.Parse(dt.Rows[0]["estado"].ToString());
            int recibido  = int.Parse(dt.Rows[0]["recibido"].ToString());

            if (recibido == 1 && (estadoSop == 2 || estadoSop == 4 || estadoSop == 7))
            {
                txtValorEdit.Enabled = true;
            }
            else if (recibido == 2 && (estadoSop == 2 || estadoSop == 4 || estadoSop == 7))
            {
                txtValorEdit.Enabled = false;
            }

            if (estadoSop == 4 || estadoSop == 7)
            {
                txtIdentificacionEdit.Enabled = false;
                txtValorEdit.Enabled          = false;
            }
            else
            {
                txtIdentificacionEdit.Enabled = true;
            }

            formEditarSoporte.Visible = true;
            tablaSoporte.Visible      = false;
        }
    }