コード例 #1
0
        public List <Accueil> GetAll()
        {
            List <Accueil> la = new List <Accueil>();

            using (SqlConnection con = new SqlConnection())
            {
                con.ConnectionString = connectionString;
                using (SqlCommand command = con.CreateCommand())
                {
                    command.CommandText = "select * from VueAccueil";
                    con.Open();
                    using (SqlDataReader read = command.ExecuteReader())
                    {
                        while (read.Read())
                        {
                            Accueil a = new Accueil();
                            a.brasserieId           = (int)read["brasserieId"];
                            a.nomBrasserie          = (string)read["nomBrasserie"];
                            a.brasseriePresentation = (string)read["brasseriePresentation"];
                            a.heureFermeture        = (string)read["heureFermeture"].ToString();
                            a.heureOuverture        = (string)read["heureOuverture"].ToString();
                            a.horraireDateDebut     = (DateTime)read["horraireDateDebut"];
                            a.horraireDateFin       = (DateTime)read["horraireDateFin"];
                            la.Add(a);
                        }
                    }
                }
            }
            return(la);
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            Accueil ap = new Accueil();

            laFrame.NavigationService.Navigate(ap);
        }
コード例 #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);
             * }*/
        }
コード例 #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");
            }
        }
コード例 #5
0
        private void btnDebut_Click(object sender, EventArgs e)
        {
            this.Hide();
            Accueil nouvPageAcc = new Accueil();

            nouvPageAcc.Show();
        }
コード例 #6
0
        private void metroLink1_Click(object sender, EventArgs e)
        {
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();
        }
コード例 #7
0
        public Accueil GetOne(int id)
        {
            Accueil a = new Accueil();

            using (SqlConnection con = new SqlConnection())
            {
                con.ConnectionString = connectionString;
                using (SqlCommand command = con.CreateCommand())
                {
                    command.CommandText = "select * from VueAccueil where brasserieId=@id";
                    command.Parameters.AddWithValue("id", id);
                    con.Open();
                    using (SqlDataReader read = command.ExecuteReader())
                    {
                        while (read.Read())
                        {
                            a.brasserieId           = (int)read["brasserieId"];
                            a.nomBrasserie          = (string)read["nomBrasserie"];
                            a.brasseriePresentation = (string)read["brasseriePresentation"];
                            a.heureFermeture        = (string)read["heureFermeture"].ToString();
                            a.heureOuverture        = (string)read["heureOuverture"].ToString();
                            a.horraireDateDebut     = (DateTime)read["horraireDateDebut"];
                            a.horraireDateFin       = (DateTime)read["horraireDateFin"];
                        }
                    }
                }
            }
            return(a);
        }
コード例 #8
0
ファイル: MainVM.cs プロジェクト: HugoBlans/resotelV2
        public MainVM()
        {
            ListPages = new ObservableCollection <UserControl>();
            Accueil acc = new Accueil();

            ListPages.Add(acc);
            CurrentPage = acc;
        }
コード例 #9
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;
        }
コード例 #10
0
        private Accueil CreateNewAccueil()
        {
            Accueil MonAccueil = new Accueil();


            MonAccueil.Text = "Welcome";
            //MonAccueil.Font = new Font("Microsoft Sans Serif", 7);

            return(MonAccueil);
        }
コード例 #11
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();
        }
コード例 #12
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();
        }
コード例 #13
0
ファイル: Mapper.cs プロジェクト: Nathan2503/Test3
        public static Accueil GetAccueilDal(this AccueilAPI accueilAPI)
        {
            Accueil accueilDal = new Accueil();

            accueilDal.brasserieId           = accueilAPI.brasserieId;
            accueilDal.brasseriePresentation = accueilAPI.brasseriePresentation;
            accueilDal.heureFermeture        = accueilAPI.heureFermeture;
            accueilDal.heureOuverture        = accueilAPI.heureOuverture;
            accueilDal.horraireDateDebut     = accueilAPI.horraireDateDebut;
            accueilDal.horraireDateFin       = accueilAPI.horraireDateFin;
            accueilDal.nomBrasserie          = accueilAPI.nomBrasserie;
            return(accueilDal);
        }
コード例 #14
0
ファイル: MainVM.cs プロジェクト: HugoBlans/resotelV2
        private void goAccueil(object dest)
        {
            UserControl destUC = null;

            switch ((string)dest)
            {
            case "accueil":
                destUC = ListPages.FirstOrDefault(x => x is Accueil);
                if (destUC == null)
                {
                    destUC = new Accueil();
                }
                break;

            case "clients":
                destUC = ListPages.FirstOrDefault(x => x is Clients);
                if (destUC == null)
                {
                    destUC = new Clients();
                }
                break;

            case "reservations":
                destUC = ListPages.FirstOrDefault(x => x is Reservations);
                if (destUC == null)
                {
                    destUC = new Reservations();
                }
                break;

            case "repas":
                destUC = ListPages.FirstOrDefault(x => x is Repas);
                if (destUC == null)
                {
                    destUC = new Repas();
                }
                break;

            case "menages":
                destUC = ListPages.FirstOrDefault(x => x is Menages);
                if (destUC == null)
                {
                    destUC = new Menages();
                }
                break;
            }

            CurrentPage = destUC;
        }
コード例 #15
0
ファイル: Form1.cs プロジェクト: secretMoi/MySyno
        public Form1()
        {
            InitializeComponent();

            Resize += Form1_Resize;

            Ssh = new SSH("82.212.177.233", "Quentin", "ee6f4e2b02", 3232);

            ThemePanel.SetConnection(Ssh);
            Accueil accueil = new Accueil();

            Ssh.Connect(accueil.ChangeEtatConnection);

            panelContainer.Controls.Add(accueil);

            SetSubMenus();
        }
コード例 #16
0
ファイル: MainWindow.xaml.cs プロジェクト: TarekDhibi/lafoire
        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);
            }
        }
コード例 #17
0
ファイル: AjoutContrat.cs プロジェクト: iLaziKx/SharPool
        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");
        }
コード例 #18
0
        public App()
        {
            InitializeComponent();

            MainPage = new Accueil();
        }
コード例 #19
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);
            }
        }
コード例 #20
0
 public MainWindow()
 {
     DataContext = this;
     InitializeComponent();
     PageEnCours = new Accueil();
 }
コード例 #21
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);
            }
        }