Пример #1
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            //desplegar estudiante seleccionado editar/borrar
            UpdateDeleteStudentForm updateDeleteStdF = new UpdateDeleteStudentForm();

            updateDeleteStdF.textBoxID.Text        = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            updateDeleteStdF.textBoxFname.Text     = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            updateDeleteStdF.textBoxLname.Text     = dataGridView1.CurrentRow.Cells[2].Value.ToString();
            updateDeleteStdF.dateTimePicker1.Value = (DateTime)dataGridView1.CurrentRow.Cells[3].Value;

            //genero
            if (dataGridView1.CurrentRow.Cells[4].Value.ToString() == "Female")
            {
                updateDeleteStdF.radioButtonFemale.Checked = true;
            }

            updateDeleteStdF.maskedTextBoxPhone.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString();
            updateDeleteStdF.textBoxAddress.Text     = dataGridView1.CurrentRow.Cells[6].Value.ToString();

            //image
            byte[] pic;
            pic = (byte[])dataGridView1.CurrentRow.Cells[7].Value;
            MemoryStream picture = new MemoryStream(pic);

            updateDeleteStdF.pictureBoxStudent.Image = Image.FromStream(picture);
            updateDeleteStdF.Show();
        }
Пример #2
0
        private void editRemoveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateDeleteStudentForm upDelStdF = new UpdateDeleteStudentForm();

            upDelStdF.Show(this);
        }