private void gv_Ordenes_CellClick(object sender, DataGridViewCellEventArgs e) { gb_buscar.Visible = true; label4.Text = "Cargando Protocolo..."; this.Refresh(); if (e.RowIndex != -1) { if (gv_Ordenes.Rows.Count > 0) { //formulario.Recargar_Medicos = true; //formulario.CargarMedicos(1); string buscar = gv_Ordenes[1, gv_Ordenes.CurrentCell.RowIndex].Value.ToString(); formulario.txt_codordenAUX.Text = gv_Ordenes[0, gv_Ordenes.CurrentCell.RowIndex].Value.ToString(); formulario.lb_NroProtocolo.Text = "Nro. Orden: " + gv_Ordenes[1, gv_Ordenes.CurrentCell.RowIndex].Value.ToString(); formulario.cbo_hora.Checked = true; formulario.cbo_hora.Enabled = false; formulario.fechaDia.Enabled = false; formulario.horaDia.Enabled = false; //if (gv_Ordenes[5, gv_Ordenes.CurrentCell.RowIndex].Value.ToString() == "1" || gv_Ordenes[5, gv_Ordenes.CurrentCell.RowIndex].Value.ToString() == "0") if (gv_Ordenes[5, gv_Ordenes.CurrentCell.RowIndex].Value.ToString() == "0") { formulario.btn_EliminarOrden.Visible = true; formulario.tabControl1.Visible = true; formulario.gb_datos_ingreso.Enabled = true; } else { formulario.lk_cambiar_fecha_entrega.Visible = true; formulario.btn_EliminarOrden.Visible = false; formulario.tabControl1.Visible = false; formulario.gb_datos_ingreso.Enabled = false; } formulario.CargarSeccionales(false); formulario.cbo_SeccionalDerivacion.SelectedValue = (Convert.ToInt32(gv_Ordenes[1, gv_Ordenes.CurrentCell.RowIndex].Value.ToString().Substring(0, 3))).ToString(); string Seccional = usuarios.seccionalnumero.ToString(); if (Seccional != gv_Ordenes[1, gv_Ordenes.CurrentCell.RowIndex].Value.ToString().Substring(0, 3)) { //Derivacion formulario.cbo_TipoOrden.Enabled = false; } else { //Misma seccional formulario.cbo_TipoOrden.Enabled = true; } formulario.cbo_SeccionalDerivacion.Enabled = false; formulario.EditarProtocolo(buscar); this.Close(); //button1_Click(null, null); } } }