/// <summary> /// convertir les Etudiants en EtudiantForView et créer la collection d'Etudiants pour l'affichage /// </summary> public void Remplir() { foreach (var etudiant in etudiantOperation.ReadEtudiants()) { EtudiantForView e = new EtudiantForView(); e.Adresse = etudiant.Adresse; e.Cne = etudiant.Cne; e.Date_naissance = etudiant.Date_naissance; e.Id_fil = etudiant.Id_fil; e.Image = etudiant.Image; Model.Image image = new Model.Image(); //DisplayAlert("ss", "e.image="+e.Image.ToString(), "okkk"); image = imageOperationImpl.ReadImage(e.Image); ImageWithSource imageWithSource = new ImageWithSource(image); imageWithSource.ImageSource = imageOperationImpl.CreateSource(image.Content); e.ImageWithSource = imageWithSource; //ButtonAjouter.Text = e.ImageWithSource.Content.Length.ToString(); // Xamarin.Forms.Image imag = new Xamarin.Forms.Image(); //imag.Source = imageWithSource.ImageSource; //this.Content = imag; //Thread.Sleep(3000); e.Nom = etudiant.Nom; e.Prenom = etudiant.Prenom; e.Sexe = etudiant.Sexe; e.Telephone = etudiant.Telephone; listEtudiantModelForView.Add(e); } DisplayAlert("Operation Succeed", "EtudiantForView Ready", "OK"); }
public EtudiantProfil(Etudiant e) { InitializeComponent(); etudiantOperation = new EtudiantOperationImpl(App.Connection); imageOperationImpl = new ImageOperationImpl(App.Connection); filiereOperationImpl = new FiliereOperationImpl(App.Connection); etudiant = e; ee = new EtudiantForView(); ee.Adresse = etudiant.Adresse; ee.Cne = etudiant.Cne; ee.Date_naissance = etudiant.Date_naissance; ee.Id_fil = etudiant.Id_fil; ee.Image = etudiant.Image; Model.Image img = new Model.Image(); //DisplayAlert("ss", "e.image="+e.Image.ToString(), "okkk"); img = imageOperationImpl.ReadImage(e.Image); ImageWithSource imageWithSource = new ImageWithSource(img); imageWithSource.ImageSource = imageOperationImpl.CreateSource(img.Content); ee.ImageWithSource = imageWithSource; ee.Nom = etudiant.Nom; ee.Prenom = etudiant.Prenom; ee.Sexe = etudiant.Sexe; ee.Telephone = etudiant.Telephone; //etudiant = ee; nom.Text = etudiant.Nom; prenom.Text = etudiant.Prenom; adresse.Text = etudiant.Adresse; tel.Text = etudiant.Telephone; Filiere f = new Filiere(); f.Id_fil = ee.Id_fil; sexe.Text = etudiant.Sexe; date.Text = etudiant.Date_naissance.ToLongDateString(); image.Source = ee.MyProperty; try { filiere.Text = filiereOperationImpl.ReadFilieres().SingleOrDefault(fil => fil.Id_fil == f.Id_fil).Nom_filiere; } catch (Exception ex) { }; }