public UserControlTest(Operateurs op, Formateurs form)
 {
     InitializeComponent();
     IdTextBox.Text = op.Id.ToString();
     FullName.Text  = op.FullName;
     formateur      = form;
 }
        public async void RefreshData()
        {
            IsBusy = true;
            Windows.UI.Popups.MessageDialog msg = null;

#if WINDOWS_PHONE_APP
            // Si c'est une application Windows Phone, on affiche un message d'attente
            // dans la barre des status.
            var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
            statusBar.ProgressIndicator.Text = "Chargement des formateurs...";
            await statusBar.ProgressIndicator.ShowAsync();
#endif

            // On vérifie si l'utilisateur n'a pas changé l'adresse de l'api entre temps
            if (ApplicationData.Current.LocalSettings.Values.ContainsKey("apiUrl"))
            {
                var url = ApplicationData.Current.LocalSettings.Values["apiUrl"] as string;
                if (url != this.WebService._serviceUrl)
                {
                    this.WebService = new FormateurService(url);
                }
            }

            try
            {
                //await System.Threading.Tasks.Task.Delay(3000);

                IEnumerable <Formateur> formateursTemp = await WebService.GetAll();

                // Ajout de l'adresse complète pour les photos
                foreach (var aFormateur in formateursTemp)
                {
                    aFormateur.UrlPhoto = WebService.GetBaseUrl() + aFormateur.UrlPhoto;
                }

                this.Formateurs         = formateursTemp.OrderBy(f => f.Nom).ToArray();
                this.FormateursExternes = Formateurs.Where(f => f.IntervenantExterieur).OrderBy(f => f.Nom).ToArray();
                this.FormateursInternes = Formateurs.Where(f => !f.IntervenantExterieur).OrderBy(f => f.Nom).ToArray();

                //this.SaveInCache();

                this.IsDataLoaded = true;
            }
            catch
            {
                string message = "Assurez-vous d'être connecté à internet (via Wi-Fi ou Cellulaire). Si le problème persiste, vérifiez l'adresse du service web dans les paramètres.";
                msg = new Windows.UI.Popups.MessageDialog(message, "Problème de connexion");
            }

#if WINDOWS_PHONE_APP
            await statusBar.ProgressIndicator.HideAsync();
#endif

            if (msg != null)
            {
                await msg.ShowAsync();
            }

            IsBusy = false;
        }
        //private double time2;
        //private double Vitesse;

        public TestTaping(String _niveau, Operateurs op, Formateurs form)
        {
            InitializeComponent();
            niveau         = _niveau;
            formateur      = form;
            operateur      = op;
            nomLbl.Content = op.FullName;
            IDLbl.Content  = op.Id;
            brush          = pgBar.Foreground as LinearGradientBrush;

            OpenPort();
            Essaies.Content = tries;
            if (niveau == "Debutant")
            {
                target           = 110;
                time             = 3600;
                Niveau.Content   = "Débutant";
                Objectif.Content = "110 tour";
            }
            else if (niveau == "Intérmediaire")
            {
                target           = 130;
                time             = 3600;
                Niveau.Content   = "Intérmediaire";
                Objectif.Content = "130 tour";
            }
            else
            {
                target           = 180;
                time             = 3600;
                Niveau.Content   = "Avancé";
                Objectif.Content = "180 tour";
            }
            pgBar.Maximum = time;
        }
Exemple #4
0
        public TestCrimping(String _niveau, Operateurs op, Formateurs form)
        {
            InitializeComponent();
            operateur      = op;
            formateur      = form;
            niveau         = _niveau;
            nomLbl.Content = op.FullName;
            IDLbl.Content  = op.Id;
            brush          = pgBar.Foreground as LinearGradientBrush;

            if (niveau == "Debutant")
            {
                time           = 3600;
                Niveau.Content = "Débutant";
            }
            else if (niveau == "Intérmediaire")
            {
                time           = 2400;
                Niveau.Content = "Intérmediaire";
            }
            else
            {
                time           = 800;
                Niveau.Content = "Avancé";
            }
        }
 public HomeWindow(Formateurs f)
 {
     InitializeComponent();
     GridMain.Children.Add(new UserControlAjouterOperateur(f));
     user           = f;
     userLabel.Text = f.nom + " " + f.prenom;
 }
 public TestCutting(Operateurs op, Formateurs form)
 {
     InitializeComponent();
     formateur      = form;
     operateur      = op;
     nomLbl.Content = op.FullName;
     IDLbl.Content  = op.Id;
     brush          = pgBar.Foreground as LinearGradientBrush;
     pgBar.Maximum  = time;
 }
        public TestCrimpingSetup(Operateurs op, Formateurs form)
        {
            InitializeComponent();
            formateur      = form;
            operateur      = op;
            nomLbl.Content = op.FullName;
            IDLbl.Content  = op.Id;

            produit          = new Produit("7116-4288-(02) SB", "1308 E025", "0.35", 1.85, 1.65, 1.1, 1.0);
            this.DataContext = produit;
        }
Exemple #8
0
        private void addButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Formateurs formateur = new Formateurs();

            if (nomTextBox.Text.Length == 0)
            {
                errormessage.Text = "Entrez un Nom";
                nomTextBox.Focus();
            }
            else if (prenomTextBox.Text.Length == 0)
            {
                errormessage.Text = "Entrez un Prenom";
                prenomTextBox.Focus();
            }
            else if (passwordTextBox.Password.Length == 0)
            {
                errormessage.Text = "Entrez un Mot de passe";
                passwordTextBox.Focus();
            }
            else
            {
                formateur.nom      = nomTextBox.Text;
                formateur.prenom   = prenomTextBox.Text;
                formateur.password = passwordTextBox.Password;

                using (var unitOfWork = new UnitOfWork(new yazakiDBEntities()))
                {
                    unitOfWork.Formateurs.Add(formateur);
                    try
                    {
                        unitOfWork.Formateurs.Add(formateur);
                        unitOfWork.Save();
                        succesmessage.Text = "Formateur ajouter avec succès avec l'ID : " + formateur.Id;
                    }
                    catch (Exception ex)
                    {
                        errormessage.Text = "Une érreur c'est produite impossible d'ajouter le formateur";
                        MessageBox.Show(ex.ToString());
                    }
                }
            }
        }
        public TestInsertion(String _niveau, Operateurs op, Formateurs form)
        {
            InitializeComponent();
            niveau         = _niveau;
            formateur      = form;
            operateur      = op;
            nomLbl.Content = op.FullName;

            if (niveau == "Debutant")
            {
                time = 3600;
            }
            else if (niveau == "Intérmediare")
            {
                time = 2400;
            }
            else
            {
                time = 1800;
            }
        }
Exemple #10
0
        public TestMesure(Operateurs op, Formateurs form)
        {
            InitializeComponent();
            formateur      = form;
            operateur      = op;
            nomLbl.Content = op.FullName;
            IDLbl.Content  = op.Id;

            produits = new List <Produit>();
            Produit p1 = new Produit("7116-4288-(02) SB", "1308 E025", "0.35", 1.85, 1.65, 1.1, 1.0);
            Produit p2 = new Produit("7116-4225-(02) SB", "1308 F026", "0.36", 1.85, 1.65, 1.1, 1.0);
            Produit p3 = new Produit("7116-4878-(05) SB", "1308 E027", "0.39", 1.85, 1.65, 1.1, 1.04);
            Produit p4 = new Produit("7116-4285-(02) SB", "1308 F028", "0.37", 2.85, 1.59, 1.1, 0.9);
            Produit p5 = new Produit("7116-4785-(02) SB", "1308 F029", "0.42", 2.85, 1.59, 1.1, 0.9);

            produits.Add(p1);
            produits.Add(p2);
            produits.Add(p3);
            produits.Add(p4);
            produits.Add(p5);
            list.ItemsSource  = produits;
            list.SelectedItem = p1;
        }
        public TestInsertion(String _niveau, Operateurs op, Formateurs form)
        {
            InitializeComponent();
            niveau         = _niveau;
            formateur      = form;
            operateur      = op;
            nomLbl.Content = op.FullName;
            IDLbl.Content  = op.Id;
            brush          = pgBar.Foreground as LinearGradientBrush;


            if (niveau == "Debutant")
            {
                time = 3600;
            }
            else if (niveau == "Intérmediaire")
            {
                time = 2400;
            }
            else
            {
                time = 1800;
            }
        }
 public CheckLoginWindow(Formateurs _formateur)
 {
     formateur = _formateur;
     InitializeComponent();
     passwordBox.Focus();
 }
 public UserControlTest(Formateurs form)
 {
     InitializeComponent();
     formateur = form;
 }
Exemple #14
0
 public UserControlAjouterOperateur(Formateurs form)
 {
     InitializeComponent();
     formateur = form;
 }