Exemple #1
0
 private void Update2Btn_Click(object sender, EventArgs e)
 {
     if (Pass1textBox.Text == this.Pass2textBox.Text)
     {// save the new password
         UserCRUDOps.updateUserPass(GGAO.GGAOWindow.getCurrentUserID(), this.Pass2textBox.Text);
         MessageBox.Show("le mot de pass a été modifier", "Mettre a jour", MessageBoxButtons.OK,
                         MessageBoxIcon.Information);
     }
     else
     {// Msg Box
         MessageBox.Show("le Mot de pass n'est pas indetique", "Mettre a jour", MessageBoxButtons.OK,
                         MessageBoxIcon.Warning);
     }
 }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string conString = "";

            // update connection string
            if (ConnectionModeCombobox.Text.ToLower().Contains("server"))
            {
                StartPoint.Program.setConString(
                    "Server =" + GGAO.Properties.Settings.Default.ServerIP +
                    "\\" + GGAO.Properties.Settings.Default.InstanceName + ";" +
                    "Database=GGAO" + ComboBoxYear.Text.Trim() + ".mdf;" +
                    "User ID=sa;Password=ggaouser;");
            }

            /*
             *
             *                  "Database=NODATABASE" + ComboBoxYear.Text.Trim() + ".mdf;"+
             *      "User ID=sa;Password=NOPASSWORD;" ) ;
             *
             *
             *
             * */

            // Server = 192.168.1.20\MYGGAO14;
            // check the user if exist
            int userID = UserCRUDOps.checkUserPass(
                this.userText.Text.Trim(), this.passwordText.Text
                );

            button1.Text = "Connexion ...";
            if (userID > 0)
            {
                button1.Enabled = false;
                GGAO.GGAOWindow a = new GGAO.GGAOWindow(ComboBoxYear.Text.Trim(), userID);
                a.Show();
                this.Hide();
                StartPoint.Program.setTheMainWindow(a);
            }
            else
            {
                button1.Text    = "Connexion";
                button1.Enabled = true;
                MessageBox.Show("l'utilisateur ou le mot de pass est incorrect", "Login unauthorise");
            }
        }