Example #1
0
 public void loadStuden()
 {
     try
     {
         ClassStudentDAO dt = new ClassStudentDAO();
         Student         a  = new Student();
         a                = dt.lookForStuden(ClassStudentDAO.StudentID);
         txtHoten.Text    = a.FirstName + a.LastName;
         txtNgaySinh.Text = a.Birthday.ToShortDateString();
         txtDiachi.Text   = a.AdressDetail;
         MemoryStream mom = new MemoryStream(a.Image.ToArray());
         Image        img = Image.FromStream(mom);
         pcAnhhocsinh.Image = img;
     }
     catch
     {
     }
 }
 private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         ClassStudentDAO dt = new ClassStudentDAO();
         ClassStudentDAO.StudentID = (int)gridView1.GetRowCellValue(e.FocusedRowHandle, "StudentID");
         Student a = dt.lookForStuden(ClassStudentDAO.StudentID);
         txtTenhocsinh.Text = a.FirstName + " " + a.LastName;
         txtNgaySinh.Text   = a.Birthday.ToShortDateString();
         txtDiachi.Text     = a.AdressDetail;
         MemoryStream mom = new MemoryStream(a.Image.ToArray());
         Image        b   = Image.FromStream(mom);
         pcAnhhocsinh.Image = b;
     }
     catch
     {
     }
 }