Exemplo n.º 1
0
        private void Home_Load(object sender, EventArgs e)

        {
            dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();

            dockPanel.Dock                       = System.Windows.Forms.DockStyle.Fill;
            dockPanel.DockBackColor              = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(48)))));
            dockPanel.DockBottomPortion          = 150D;
            dockPanel.DockLeftPortion            = 200D;
            dockPanel.DockRightPortion           = 200D;
            dockPanel.DockTopPortion             = 150D;
            dockPanel.Font                       = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
            dockPanel.Location                   = new System.Drawing.Point(0, 61);
            dockPanel.Name                       = "dockPanel";
            dockPanel.Padding                    = new System.Windows.Forms.Padding(6);
            dockPanel.RightToLeftLayout          = true;
            dockPanel.ShowAutoHideContentOnHover = false;
            dockPanel.Size                       = new System.Drawing.Size(810, 455);
            dockPanel.TabIndex                   = 12;
            dockPanel.Theme                      = this.vS2015DarkTheme1;
            this.panel1.Controls.Add(dockPanel);
            SetSchema(this.vS2015DarkTheme1, null);

            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "OSMaker.config");



            CloseAllContents();

            CreateStandardControls();
            m_propertyWindow.Show(dockPanel, DockState.DockRight);

            m_solutionExplorer.Show(m_propertyWindow.Pane, DockAlignment.Top, 0.5);
            m_propertyWindow.DockState = DockState.DockRightAutoHide;

            m_toolbox.Show(dockPanel, DockState.DockLeftAutoHide);



            dockPanel.ResumeLayout(true, true);

            Accueil MonAccueil = CreateNewAccueil();

            if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
            {
                MonAccueil.MdiParent = this;
                MonAccueil.Show();
            }
            else
            {
                MonAccueil.Show(dockPanel);
            }

            m_sortie.Show(MonAccueil.PanelPane, DockAlignment.Left, 0.5);
            m_sortie.Text      = "Output";
            m_sortie.DockState = DockState.DockBottomAutoHide;
        }
Exemplo n.º 2
0
        private void metroLink1_Click(object sender, EventArgs e)
        {
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();
        }
Exemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var q = from c in cl.users
                    where c.login == textlogin.Text && c.pass == textpassword.Password
                    select c;

            if (q.Count() == 1)
            {
                user u = q.FirstOrDefault();
                App.Current.Properties["connected"] = u.login;
                Accueil accueil = new Accueil();
                accueil.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Login ou Mot de passe incorret", "Erreur d'Authentification ", MessageBoxButton.OK, MessageBoxImage.Error);
            }


            /*if (textlogin.Text == "admin"*//* && textpassword.Password == "123456"*//*)
             * {
             *
             * }
             * else
             * {
             *  MessageBox.Show("Login ou Mot de passe incorret", "Erreur d'Authentification ", MessageBoxButton.OK, MessageBoxImage.Error);
             * }*/
        }
Exemplo n.º 4
0
        /*BtnConnexion_Click_1
         * Permet de ce connecter et d'ouvrir la view Accueil*/
        private void BtnConnexion_Click_1(object sender, EventArgs e)
        {
            bool test = false;

            test = UsersController.Connexion(txtLogin.Text, txtMotDePasse.Text);
            if (test == true)
            {
                Users user = UsersController.TypeUser(txtLogin.Text, txtMotDePasse.Text);

                if (user.eleveUser == 1 && user.tuteurUser == 0)
                {
                    AccueilEleve accueil = new AccueilEleve(user);
                    accueil.Hide();
                    accueil.Show();
                }
                if (user.eleveUser == 0 && user.tuteurUser == 1)
                {
                    AccueilTuteur accueil = new AccueilTuteur(user);
                    accueil.Hide();
                    accueil.Show();
                }
                if (user.eleveUser == 1 && user.tuteurUser == 1)
                {
                    Accueil accueil = new Accueil(user);
                    accueil.Hide();
                    accueil.Show();
                }
            }
            else
            {
                MessageBox.Show("Votre mot de passe ou login est incorrect");
            }
        }
Exemplo n.º 5
0
        private void btnDebut_Click(object sender, EventArgs e)
        {
            this.Hide();
            Accueil nouvPageAcc = new Accueil();

            nouvPageAcc.Show();
        }
Exemplo n.º 6
0
        private void ajoutBtn_Click(object sender, EventArgs e)
        {
            Entreprise ent = new Entreprise(siretBox.Text, entBox.Text, adresseBox.Text, cpBox.Text, villeBox.Text, tbxCommentaire.Text, false);

            AdoEntreprise.create(ent, "App");
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();
        }
Exemplo n.º 7
0
        private void Deco_button(object sender, RoutedEventArgs e)
        {
            Accueil win2     = new Accueil();
            var     myWindow = Window.GetWindow(this);

            win2.Show();
            win2.contentControl1.Content = new UConnexion();
            win2.contentControl2.Content = new Non_connecté();
            myWindow.Close();
        }
Exemplo n.º 8
0
        public void Action_Connexion()
        {
            try
            {
                if (vide())
                {
                    Afficher_Msg_Erreur("Champ(s) vide(s), tous les champs sont obligatoires");
                }
                else
                {
                    profile prof = new profile(TBLogin.Text, TBMDP.Password);
                    int     id   = profilC.authentification(prof);
                    prof.ID = id;

                    if (id == -1)
                    {
                        Afficher_Msg_Erreur("Erreur de connexion! veuillez contacter le service technique");
                    }
                    else
                    {
                        if (id == 0)
                        {
                            Afficher_Msg_Erreur("La combinaison login et mot de passe est incorrecte.");
                        }
                        else
                        {       //(id)
                            Accueil p = new Accueil(id, "");
                            //p.WindowState = WindowState.Maximized;
                            DateTime localDate            = DateTime.Now;
                            la_foire.Ent.JournalP journal = new la_foire.Ent.JournalP(id, localDate.ToString("F"), "Connexion");
                            la_foire.Dao.JournalPC.ajouterJournal(journal);
                            p.Show();
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Exemplo n.º 9
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            string satisfaction;

            if (this.pasSatisfait.Checked)
            {
                satisfaction = "0";
            }
            else if (this.peuSatisfait.Checked)
            {
                satisfaction = "1";
            }
            else if (this.satisfait.Checked)
            {
                satisfaction = "2";
            }
            else if (this.tresSatisfait.Checked)
            {
                satisfaction = "3";
            }
            else
            {
                satisfaction = "0";
            }

            Contrat cont = new Contrat(this.dteDebut.Value, this.dteFin.Value, satisfaction, dPoste.Text, tbxNomTuteur.Text, tbxTelTuteur.Text, tbxMailTuteur.Text, tbxNomApprenti.Text, tbxPrenomApprenti.Text, false, 1, laEntreprise.IdEntreprise, 1);

            AdoContrat.create(cont, "App");
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();

            // Contrat unContrat = new Contrat(0, this.dteDebut.Value, this.dteFin.Value, satisfaction, this.tbxCommentaire.Text, this.tbxNomTuteur, tbxTelTuteur, this.tbxMailTuteur, this.tbxNomApprenti, this.tbxPrenomApprenti, 0, 1, int idEntreprise, int idPromotion);
            // AdoContrat.create(unContrat, "App");
        }
Exemplo n.º 10
0
        private void cnx_Click(object sender, EventArgs e)
        {
            try
            {
                string    user  = username.Text;
                string    pass  = password.Text;
                string    param = "user_@string@" + user + "#passe@string@" + pass;
                DataTable dt    = Program.query.executeProc("Getuser", param);//kUPOUgsKHNWbvWfw

                //    string connString = "";

                //MySqlDataReader DbDataReader ;

                //var connectionString = "server=localhost; user id=root; password=; database=gs_stock; pooling=false;";//"Data Source=localhost; User Id=root; Password=; Initial Catalog=gestion_stock;persist security info=True; CharSet=utf8; Port=3306; pooling=false;"; // Provide connecction string here.
                //using (var connection = new MySqlConnection(connectionString))
                //{
                //      dt = new DataTable();
                //    MySqlCommand command = new MySqlCommand();
                //    command.CommandText = "SELECT * FROM users WHERE Login='******' AND Pass='******'";

                //    command.Connection = connection;
                //    command.CommandType = CommandType.Text;



                //    command.Connection.Open();
                //     DbDataReader = command.ExecuteReader();
                //   // _dataReader = cmd.ExecuteReader(); //(_command);
                //    dt.Load(DbDataReader);
                //    command.Connection.Close();
                //}

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        LoginInfo.UserID         = dt.Rows[0]["ID"].ToString();
                        LoginInfo.AdminID        = dt.Rows[0]["ID_admin"].ToString();
                        LoginInfo.LastName       = dt.Rows[0]["LastName"].ToString();
                        LoginInfo.Name           = dt.Rows[0]["Name"].ToString();
                        LoginInfo.mail           = dt.Rows[0]["mail"].ToString();
                        LoginInfo.Login          = dt.Rows[0]["Login"].ToString();
                        LoginInfo.pass           = dt.Rows[0]["pass"].ToString();
                        LoginInfo.Phone          = dt.Rows[0]["phone"].ToString();
                        LoginInfo.role           = dt.Rows[0]["role"].ToString();
                        LoginInfo.app            = dt.Rows[0]["appName"].ToString();
                        LoginInfo.dateExperation = DateTime.Parse(dt.Rows[0]["date"].ToString());

                        Accueil accueil = new Accueil();
                        //Login.ActiveForm.Hide();
                        accueil.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("NOP");
                    }
                }
                else
                {
                    MessageBox.Show("NOP");
                }
            }
            catch (Exception EX) {
                MessageBox.Show(EX.Message);
            }
        }
Exemplo n.º 11
0
        private async void simpleButton1_Click(object sender, EventArgs e)
        {
            progressPanel2.Visible = true;
            if (checkEdit1.Checked == true)
            {
                Properties.Settings.Default.CheckBeta = checkEdit1.CheckState.ToString();
                Properties.Settings.Default.PassBeta  = textEdit1.Text;
                Properties.Settings.Default.UserBeta  = textEdit2.Text;
                Properties.Settings.Default.Save();
            }
            else
            {
                Properties.Settings.Default.CheckBeta = "Unchecked";
                Properties.Settings.Default.Save();
            }
            await Task.Delay(500);

            try
            {
                string thisguid = getUniqueID("C");
                server.Connect("localhost", 80);
                string loginusername = textEdit1.Text;
                string loginpassword = textEdit2.Text;
                if (client.DownloadString(URL + "api.php?type=login&username="******"&password="******"&hwid=" + thisguid).Contains("0x05"))
                {
                    progressPanel2.Visible = false;

                    XtraMessageBox.Show("Connecté bon test !", "Succès!");
                    if (Properties.Settings.Default.LaunchAccueil == "PasOuvert")
                    {
                        Accueil AC = new Accueil();
                        this.Hide();
                        AC.Show();
                    }
                    else
                    {
                        Form1 F1 = new Form1();
                        this.Hide();
                        F1.Show();
                    }
                    //Open form, or do whatever people do here.
                }
                else if (client.DownloadString(URL + "api.php?type=login&username="******"&password="******"&hwid=" + thisguid).Contains("0x01"))
                {
                    progressPanel2.Visible = false;


                    XtraMessageBox.Show("HWID ne correspond pas :(", "Erreur");
                }
                else if (client.DownloadString(URL + "api.php?type=login&username="******"&password="******"&hwid=" + thisguid).Contains("0x02"))
                {
                    progressPanel2.Visible = false;

                    XtraMessageBox.Show("Veuillez remplir toutes les cases.", "Erreur");
                }
                else if (client.DownloadString(URL + "api.php?type=login&username="******"&password="******"&hwid=" + thisguid).Contains("0x03"))
                {
                    progressPanel2.Visible = false;

                    XtraMessageBox.Show("Nom d'utilisateur ou mot de passe incorrect.", "Erreur");
                }
                else if (client.DownloadString(URL + "api.php?type=login&username="******"&password="******"&hwid=" + thisguid).Contains("0x04"))
                {
                    progressPanel2.Visible = false;

                    XtraMessageBox.Show("Vous êtes banni.", "Erreur");
                }
            }
            catch (WebSocketException)
            {
                progressPanel2.Visible = false;
                XtraMessageBox.Show("Serveur pas disponible", "Erreur Serveur", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
            }
        }