Example #1
0
 private void Btn_guardar_Click_1(object sender, EventArgs e)
 {
     if (presionado == false)
     {
         Desahiblitarbtn();
         Btn_guardar.Enabled = true;
         presionado          = true;
     }
     else
     {
         Guardardatos();
         Txt_idBonoDesc.Focus();
         presionado = false;
         Deshabilitarcampos();
         Habilitarbtn();
         Limpiar();
     }
 }
Example #2
0
        private void Btn_consultar_Click_1(object sender, EventArgs e)
        {
            if (presionado == false)
            {
                Desahiblitarbtn();
                Btn_consultar.Enabled = true;
                presionado            = true;
            }
            else
            {
                Frm_consultaBonos_Desc conBonos_Desc = new Frm_consultaBonos_Desc();
                conBonos_Desc.ShowDialog();

                if (conBonos_Desc.DialogResult == DialogResult.OK)
                {
                    Txt_idBonoDesc.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index].
                                          Cells[0].Value.ToString();

                    Txt_nombre.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index].
                                      Cells[1].Value.ToString();

                    Txt_valor.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index].
                                     Cells[2].Value.ToString();

                    var1 = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index].
                           Cells[3].Value.ToString();

                    if (var1 == "0")
                    {
                        Chk_bono.Checked      = true;
                        Chk_descuento.Checked = false;
                    }
                    else
                    {
                        Chk_descuento.Checked = true;
                        Chk_bono.Checked      = false;
                    }

                    Txt_idBonoDesc.Focus();
                    presionado = false;
                    Habilitarbtn();
                }
            }
        }