Ejemplo n.º 1
0
        private void PictureBox2_Click(object sender, EventArgs e)
        {
            if (dgvTodo.CurrentRow.Selected == true)
            {
                editar editar = new editar("Panteones Mun.");
                editar.txt_oficio.Text = dgvTodo.CurrentRow.Cells[1].Value.ToString();
                editar.txt_nom.Text    = dgvTodo.CurrentRow.Cells[2].Value.ToString();
                editar.txt_tipo.Text   = dgvTodo.CurrentRow.Cells[3].Value.ToString();
                editar.txt_pase.Text   = dgvTodo.CurrentRow.Cells[4].Value.ToString();
                editar.txt_recibo.Text = dgvTodo.CurrentRow.Cells[5].Value.ToString();
                editar.dt_fecha.Value  = DateTime.Parse(dgvTodo.CurrentRow.Cells[6].Value.ToString());
                editar.txt_costo.Text  = dgvTodo.CurrentRow.Cells[7].Value.ToString();
                editar.Show();

                if (editar.txt_recibo.Text.Length != 0)
                {
                    editar.txt_costo.ReadOnly = true;
                    MessageBox.Show(" Este oficio ya fue registrado \n No podrá mdificar su costo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Seleccione un registro para editar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void PictureBox2_Click(object sender, EventArgs e)
 {
     if (dgvTodo.CurrentRow.Selected == true)
     {
         editar editar = new editar("Obras Publicas");
         editar.txt_oficio.Text       = dgvTodo.CurrentRow.Cells[1].Value.ToString();
         editar.txt_nom.Text          = dgvTodo.CurrentRow.Cells[2].Value.ToString();
         editar.txt_tipo.SelectedItem = dgvTodo.CurrentRow.Cells[3].Value.ToString();
         editar.txt_pase.Text         = dgvTodo.CurrentRow.Cells[4].Value.ToString();
         editar.txt_recibo.Text       = dgvTodo.CurrentRow.Cells[5].Value.ToString();
         editar.dt_fecha.Value        = DateTime.Parse(dgvTodo.CurrentRow.Cells[0].Value.ToString());
         editar.txt_costo.Text        = dgvTodo.CurrentRow.Cells[6].Value.ToString();
         editar.Show();
     }
     else
     {
         MessageBox.Show("Seleccione un registro para editar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }