Exemple #1
0
        public GraphiqueCompetence(JSIntituleCompetence jSIntCompetence)
        {
            InitializeComponent();
            JsIntCompetence = jSIntCompetence;

            Intitule.Text    = JsIntCompetence.intitule;
            Description.Text = JsIntCompetence.description;
            RecupNote();
        }
Exemple #2
0
        async private void PosterDemande_Clicked(object sender, EventArgs e)
        {
            JSIntituleCompetence IntituleComp = ((JSIntituleCompetence)ListCompetenceXAML.SelectedItem);

            JSDemande demande = new JSDemande
            {
                id_Competence = IntituleComp.id_Competence,
                id_Employe    = Settings.ActualUser.id_Employe
            };
            var req = await HttpRequest.postRequest(App.Url + "api/Demandes", demande);

            await Navigation.PushAsync(new PageDemande());
        }
        public AffichageCompetence(JSCompetence jSCompetence, JSEmploye jSEmploye = null)
        {
            InitializeComponent();

            if (jSEmploye == null)
            {
                employe = Settings.ActualUser;
            }
            else
            {
                employe = jSEmploye;
            }
            jsCompetence = jSCompetence;
            JSIntituleCompetence jS = jSCompetence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).First();

            Intitule.Text    = jS.intitule;
            Description.Text = jS.description;
            RecupNote();
        }
Exemple #4
0
 public RechercheTuteur(JSIntituleCompetence competence)
 {
     InitializeComponent();
     this.competence = competence;
     CreateLsiteCompetence();
 }
Exemple #5
0
        private async void ChargementData(bool modif)
        {
            var reqTuteur = await HttpRequest.getRequest(App.Url + "api/Membres?filter[include][employe]&filter[where][Id_Groupe]=" + groupe.id_Groupe);

            System.Diagnostics.Debug.WriteLine(reqTuteur);
            var res = JsonConvert.DeserializeObject <List <JSMembre> >(reqTuteur);

            var reqComp = await HttpRequest.getRequest(App.Url + "api/IntituleCompetences?filter[include][competence]&filter[where][Id_Langue]=" + Settings.ActualLanguage);

            ListComp = JsonConvert.DeserializeObject <List <JSIntituleCompetence> >(reqComp);

            var reqEmp = await HttpRequest.getRequest(App.Url + "api/Employes");

            ListEmp = JsonConvert.DeserializeObject <List <JSEmploye> >(reqEmp);
            if (res.Where(c => c.estTutorant == true).Count() != 0)
            {
                groupe.tuteur = res.Where(c => c.estTutorant == true).First().Employe;
            }
            var listp = new List <JSEmploye>();

            foreach (JSMembre m in res)
            {
                if (m.Employe != null)
                {
                    listp.Add(m.Employe);
                    listEmpInitial.Add(m.Employe);
                }
                else
                {
                    var reqManquant = await HttpRequest.getRequest(App.Url + "api/Employes/" + m.id_Employe);

                    var r = JsonConvert.DeserializeObject <JSEmploye>(reqManquant);

                    listp.Add(r);
                    listEmpInitial.Add(r);
                }
            }
            groupe.Participant = listp;

            Titre.Text      = groupe.titre;
            ModifTitre.Text = groupe.titre;

            if (!(groupe.Competence is null))
            {
                if (groupe.Competence.IntituleCompetences is null)
                {
                    var req = await HttpRequest.getRequest(App.Url + "api/IntituleCompetences?filter[where][Id_Langue]=" + Settings.ActualLanguage + "&filter[where][Id_Competence]=" + groupe.Competence.id_Competence);

                    var reqDes = JsonConvert.DeserializeObject <List <JSIntituleCompetence> >(req);
                    if (reqDes.Count > 0)
                    {
                        groupe.Competence.IntituleCompetences = reqDes;
                    }
                    else
                    {
                        var JSi = new JSIntituleCompetence
                        {
                            description = "description",
                            intitule    = "intitule",
                            id_Langue   = 2
                        };
                        groupe.Competence.IntituleCompetences = new List <JSIntituleCompetence>();
                        groupe.Competence.IntituleCompetences.Add(JSi);
                    }
                }
                //Competence
                if (groupe.Competence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).ToList().Count > 0)
                {
                    Competence.Text         = groupe.Competence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).First().intitule;
                    IntituleCompActuel.Text = groupe.Competence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).First().intitule;
                    if (groupe.Competence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).First().description != "")
                    {
                        DescriptionCompActuel.Text = groupe.Competence.IntituleCompetences.Where(c => c.id_Langue == Settings.ActualLanguage).First().description.ToString();
                    }
                    else
                    {
                        DescriptionCompActuel.Text = "Description";
                    }
                }
                else if (groupe.Competence.IntituleCompetences.ToList().Count > 0)
                {
                    Competence.Text         = groupe.Competence.IntituleCompetences.First().intitule;
                    IntituleCompActuel.Text = groupe.Competence.IntituleCompetences.First().intitule;
                    if (groupe.Competence.IntituleCompetences.First().description != "")
                    {
                        DescriptionCompActuel.Text = groupe.Competence.IntituleCompetences.First().description;
                    }
                    else
                    {
                        DescriptionCompActuel.Text = "Description";
                    }
                }
                else
                {
                    Competence.Text            = "Intitule";
                    IntituleCompActuel.Text    = "Intitule";
                    DescriptionCompActuel.Text = "Description";
                }
            }
            ModifCompetence.ItemsSource = ListComp;

            //Membre et Tuteur
            Tuteur.BindingContext            = groupe.tuteur;
            ListMembreVue.ItemsSource        = ObservableCollectionConvert.ObservableCollectionConvertion(groupe.Participant);
            ModifListParticipant.ItemsSource = ObservableCollectionConvert.ObservableCollectionConvertion(groupe.Participant);
            ListEmploye.ItemsSource          = ListEmp;

            if (modif == false)
            {
                AvecModif.IsVisible = false;
                SansModif.IsVisible = true;
            }
            else
            {
                AvecModif.IsVisible = true;
                SansModif.IsVisible = false;
            }
        }