Ejemplo n.º 1
0
 private void gridviewStudent_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         UpdateStudentForm f = new UpdateStudentForm();
         f.txtID.Text         = this.gridviewStudent.CurrentRow.Cells[0].Value.ToString();
         f.txtFirstName.Text  = this.gridviewStudent.CurrentRow.Cells[1].Value.ToString();
         f.txtLastName.Text   = this.gridviewStudent.CurrentRow.Cells[2].Value.ToString();
         f.dateBirthDay.Value = (DateTime)this.gridviewStudent.CurrentRow.Cells[3].Value;
         if (this.gridviewStudent.CurrentRow.Cells[4].Value.ToString() == "Female    ")
         {
             f.radioFemale.Checked = true;
         }
         else
         {
             f.radioMale.Checked = true;
         }
         f.txtPhone.Text   = this.gridviewStudent.CurrentRow.Cells[5].Value.ToString();
         f.txtAddress.Text = this.gridviewStudent.CurrentRow.Cells[6].Value.ToString();
         byte[] pic;
         pic = (byte[])this.gridviewStudent.CurrentRow.Cells[7].Value;
         MemoryStream picture = new MemoryStream(pic);
         f.pictureStudent.Image = Image.FromStream(picture);
         f.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void editRemoveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateStudentForm tempForm = new UpdateStudentForm();

            tempForm.ShowDialog();
        }