Exemplo n.º 1
0
        private void DataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                string CODIGO;

                if (e.ColumnIndex == 21)// created column index (delete button)
                {
                    string sub_valor = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                    int    longitud  = sub_valor.Length - 4;

                    string valor = sub_valor.Substring(4, longitud);
                    if (EXTRALABEL.Text == "ADMIN")
                    {
                        UTILITY util = new UTILITY();
                        util.borrar(valor);
                    }

                    DataGrid.Rows.Remove(DataGrid.Rows[e.RowIndex]);
                }
                COMBOCONDICION.Text = (string)DataGrid.CurrentRow.Cells["CONDICION_EXTRACION"].Value;
                //    COMBOCONDICION.Text = (string)DataGrid.CurrentRow.Cells["CONDICION_EXTRACION"].Value;
                TXTNUMEQUIPO.Text    = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_S"].Value;
                TXTMODELOEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_S"].Value;
                TXTSERIEEQUIPO.Text  = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_S"].Value;
                TXTCONTADOR.Text     = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_S"].Value);

                // int quantity = (int)DataGrid.CurrentRow.Cells["CANTIDAD"].Value;
                //   TXTCODIGO.Text = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                TXTMODELOEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_S"].Value;
                TXTSERIEEQUIPO.Text  = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_S"].Value;
                //TXTCONTADOR.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_S"].Value);
                TXTNUMEQUIPO.Text = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_S"].Value;

                TXTNOMBREEQUIPOENTRADA.Text = (string)DataGrid.CurrentRow.Cells["NO.EQUIPO_E"].Value;
                TXTCOMENTARIO.Text          = (string)DataGrid.CurrentRow.Cells["COMENTARIO"].Value;

                TXTMODELOENTRADA.Text    = (string)DataGrid.CurrentRow.Cells["MODELO_EQUIPO_E"].Value;
                TXTSERIENTRADA.Text      = (string)DataGrid.CurrentRow.Cells["SERIE_EQUIPO_E"].Value;
                TXTCONTADOR_ENTRADA.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CONTADOR_E"].Value);
                // TXTNOKITENTRADA.Text = (string)DataGrid.CurrentRow.Cells["NUM. KIT_EQUIPO_E"].Value;
                TXTTECNICO.Text    = (string)DataGrid.CurrentRow.Cells["TECNICO"].Value;
                DATATIMEPICO.Value = (DateTime)DataGrid.CurrentRow.Cells["FECHA_CREA"].Value;
                //       TXT_CODIGO_PIEZA.Text = (string)DataGrid.CurrentRow.Cells["CODIGO_DEPIEZA"].Value;
                //  TXTCANTIDAD.Text = Convert.ToString(DataGrid.CurrentRow.Cells["CANTIDAD"].Value);
                // TXTDESCRIPCION.Text = (string)DataGrid.CurrentRow.Cells["DESCRIPCION_PIEZA"].Value;
                //  COMBOBODEGA.Text = Convert.ToString(DataGrid.CurrentRow.Cells["BODEGA"].Value);
                TXTCOMENTARIO.Text      = (string)DataGrid.CurrentRow.Cells["COMENTARIO"].Value;
                TXTGERENTESERVICIO.Text = (string)DataGrid.CurrentRow.Cells["GERENTE_DE_SERVICIO"].Value;
                TXTSERVICIO.Text        = (string)DataGrid.CurrentRow.Cells["SERVICIO_AL_CLIENTE"].Value;
                CODIGO          = (string)DataGrid.CurrentRow.Cells["CODIGO EXTRACION"].Value;
                EXTRALABEL.Text = CODIGO;
                if (CODIGO != "")
                {
                    int    LONG      = CODIGO.Length - 4;
                    string sub_codig = CODIGO.Substring(4, LONG);
                    TXTCODIGOEXTRA.Text = sub_codig;
                }
                else
                {
                    MessageBox.Show("Error al seleccionar el codigo (Por favor contacte con el administrador del sistema)", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("NO DEBE DARLE CLICK AL TITULO DE LA TABLA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        public DataTable Devulve_codigo()

        {
            return(CODIGO.CodigoDiagnostico());
        }