Пример #1
0
        public EtudiantPage()
        {
            InitializeComponent();
            etudiantOperation  = new EtudiantOperationImpl(App.Connection);
            filiereOperation   = new FiliereOperationImpl(App.Connection);
            imageOperationImpl = new ImageOperationImpl(App.Connection);
            //image.Source = ImageSource.FromFile(Height > Width ? "icon.png" : "Cute.jpg");
            img = new Model.Image();
            //traitementImage();
            List <Filiere> filieres = filiereOperation.ReadFilieres();

            foreach (var fil in filieres)
            {
                listFiliere.Add(fil.Nom_filiere);
            }
            picker.ItemsSource        = listFiliere;
            listEtudiantModel         = new ObservableCollection <Etudiant>(etudiantOperation.ReadEtudiants());
            listEtudiantModelForView  = new ObservableCollection <EtudiantForView>();
            listEtudiantModelForView2 = new ObservableCollection <EtudiantForView>();
            Remplir();
            DisplayAlert("col", listEtudiantModel.Count.ToString(), "pok");


            /*foreach (var img in imageOperationImpl.ReadImages())
             * {
             *  img.ImageSource = imageOperationImpl.CreateSource(img.Content);
             * }*/
            /*foreach (var etu in listEtudiantModel)
             * {
             *  Model.Image i=imageOperationImpl.ReadImage(etu.Image);
             *
             * }*/
            ListEtudiants.ItemsSource = listEtudiantModelForView;
            BindingContext            = listEtudiantModelForView;
        }
Пример #2
0
        /// <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");
        }
Пример #3
0
        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) { };
        }
Пример #4
0
        public AjoutEtudiant()
        {
            InitializeComponent();
            traitementImage();

            /*listFiliere.Add("All");
             * listFiliere.Add("Info");
             * listFiliere.Add("GTR");
             * listFiliere.Add("Indus");*/
            filiereOperation      = new FiliereOperationImpl(App.Connection);
            imageOperationImpl    = new ImageOperationImpl(App.Connection);
            etudiantOperationImpl = new EtudiantOperationImpl(App.Connection);
            List <Filiere> filieres = filiereOperation.ReadFilieres();

            //listFiliere.Add(" ");
            foreach (var fil in filieres)
            {
                listFiliere.Add(fil.Nom_filiere);
            }
            picker.ItemsSource = listFiliere;
            img = new Model.Image();
        }
Пример #5
0
        public AjoutEtudiant(Etudiant e)
        {
            Etudiant etudiant = e;

            InitializeComponent();
            filiereOperation      = new FiliereOperationImpl(App.Connection);
            imageOperationImpl    = new ImageOperationImpl(App.Connection);
            etudiantOperationImpl = new EtudiantOperationImpl(App.Connection);

            /*listFiliere.Add("All");
             * listFiliere.Add("Info");
             * listFiliere.Add("GTR");
             * listFiliere.Add("Indus");*/
            List <Filiere> filieres = filiereOperation.ReadFilieres();

            //listFiliere.Add(" ");
            foreach (var fil in filieres)
            {
                listFiliere.Add(fil.Nom_filiere);
            }
            picker.ItemsSource = listFiliere;
            traitementImage();
            nom.Text     = etudiant.Nom;
            prenom.Text  = etudiant.Prenom;
            date.Date    = etudiant.Date_naissance;
            cne.Text     = Convert.ToString(etudiant.Cne);
            adresse.Text = etudiant.Adresse;
            tel.Text     = etudiant.Telephone;
            sexe.Text    = etudiant.Sexe;
            //picker.SelectedItem= filiereOperation.ReadFilieres().SingleOrDefault(fil=>fil.Id_fil== etudiant.Id_fil).Nom_filiere;

            img = imageOperationImpl.ReadImage(etudiantOperationImpl.ReadEtudiant(e.Cne).Image);
            ImageWithSource imageWithSource = new ImageWithSource(img);

            imageWithSource.ImageSource = imageOperationImpl.CreateSource(img.Content);
            image.Source = imageWithSource.ImageSource;
        }