private void _met_keypress_txt_clv_li(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r')
     {
         if (_form_pres.txt_clv_li.Text != "")
         {
             _met_env_data();
             _dav_pres._met_bus_libr();
             _sql_data_read = _dav_pres._SqlDataReader;
             while (_sql_data_read.Read())
             {
                 _str_estado = _sql_data_read[3].ToString();
                 _str_nom    = _sql_data_read.GetString(1);
                 _str_clasi  = _sql_data_read.GetString(2);
             }
             if (_str_estado != "PRESTADO  ")
             {
                 _form_pres.txt_nom_li.Text  = _str_nom;
                 _form_pres.txt_clas_li.Text = _str_clasi;
             }
             else
             {
                 _cls_var._str_clv_li = _form_pres.txt_clv_li.Text;
                 _frm_li_pre          = new View.Frm_libros_prestados();
                 Controller.cls_libros_prestados _con = new cls_libros_prestados(_frm_li_pre);
                 _frm_li_pre.ShowDialog();
             }
             _form_pres.txt_matri.Focus();
         }
         else
         {
             System.Windows.Forms.MessageBox.Show("Error al buscar el libro! Campo vacio....Por favor introduce una clave", "Mensaje desde el sistema", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
         }
     }
 }
Ejemplo n.º 2
0
 private void _met_event_click_cell_datagridview(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (Convert.ToString(_frm_bus_li.dataGridView1.CurrentRow.Cells[0].Value) != "")
     {
         if (_frm_bus_li.dataGridView1.CurrentRow.Cells[3].Value.ToString() != "PRESTADO  ")
         {
             _frm_pres.txt_clv_li.Text  = _frm_bus_li.dataGridView1.CurrentRow.Cells[0].Value.ToString().ToUpper();
             _frm_pres.txt_nom_li.Text  = _frm_bus_li.dataGridView1.CurrentRow.Cells[1].Value.ToString().ToUpper();
             _frm_pres.txt_clas_li.Text = _frm_bus_li.dataGridView1.CurrentRow.Cells[2].Value.ToString().ToUpper();
             _frm_bus_li.Hide();
         }
         else
         {
             _cls_var._str_clv_li = _frm_bus_li.dataGridView1.CurrentRow.Cells[0].Value.ToString();
             _frm_li_pre          = new View.Frm_libros_prestados();
             Controller.cls_libros_prestados _con = new cls_libros_prestados(_frm_li_pre);
             _frm_li_pre.ShowDialog();
         }
     }
 }