Exemplo n.º 1
0
        private void btnCnx_Click(object sender, EventArgs e)
        {
            BaseDonneeConnecter.ouvrirconnection();
            SqlCommand    com = new SqlCommand("select * from users where login ='******' and password ='******'", BaseDonneeConnecter.connection);
            SqlDataReader dr  = com.ExecuteReader();

            if (dr.HasRows)
            {
                dr.Close();
                SqlCommand    com2 = new SqlCommand("select nameusers from users where login ='******' and password ='******'", BaseDonneeConnecter.connection);
                SqlDataReader dr2  = com2.ExecuteReader();
                while (dr2.Read())
                {
                    nameuser = (string)dr2["nameusers"];
                }
                dr2.Close();
                SqlCommand    com3 = new SqlCommand("select priorite from users where login ='******' and password ='******'", BaseDonneeConnecter.connection);
                SqlDataReader dr3  = com3.ExecuteReader();
                while (dr3.Read())
                {
                    priorite = (int)dr3["priorite"];
                }
                dr3.Close();
                Home h = new Home(nameuser, priorite);
                h.ShowDialog();
            }
            else
            {
                MessageBox.Show("Login ou le mot de passe sont Incorrect !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                dr.Close();
            }
        }
Exemplo n.º 2
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (lsPresence.SelectedItem != null)
     {
         BaseDonneeConnecter.addAbsenseInRealeTime(lsPresence.SelectedItem.ToString(), usingDate, usingNumjour.ToString(), cbGroupe.SelectedItem.ToString(), usingTimeStart.ToString());
         loadAbsense();
         loadNotAbsense();
     }
 }
Exemplo n.º 3
0
        private void loadNotAbsense()
        {
            lsPresence.Items.Clear();
            List <string> aa = BaseDonneeConnecter.getNotAbsenseInRealeTime(usingDate, usingNumjour.ToString(), cbGroupe.SelectedItem.ToString(), usingTimeStart.ToString());

            foreach (string ss in aa)
            {
                lsPresence.Items.Add(ss);
            }
        }
Exemplo n.º 4
0
 private void Home_Load(object sender, EventArgs e)
 {
     refreachTime();
     label1.Text = DateTime.Today.ToString("d");
     label3.Text = nameusers;
     foreach (string ss in BaseDonneeConnecter.getGroupes())
     {
         cbGroupe.Items.Add(ss);
     }
     cbGroupe.SelectedIndex = 0;
 }
 private void GestionEmploi_Load(object sender, EventArgs e)
 {
     foreach (string ss in BaseDonneeConnecter.getGroupes())
     {
         grop.Items.Add(ss);
     }
     grop.SelectedIndex = 0;
     foreach (Users ss in BaseDonneeConnecter.getAllUsersinfo())
     {
         cbusers.Items.Add(ss.nameusers);
     }
     clearfild();
 }
 private void btn_supr_Click(object sender, EventArgs e)
 {
     if (Utils.isVide(cbJour.SelectedIndex, cbtime.SelectedIndex, dgvEmploiTemps))
     {
         label3.Text      = "Cette Eregestrement est Deja vide !!";
         label3.ForeColor = Color.Red;
     }
     else
     {
         BaseDonneeConnecter.deleteEnregestrempent(grop.SelectedItem.ToString(), (cbJour.SelectedIndex + 1) + "", (cbtime.SelectedIndex + 1) + "");
         grop_SelectedIndexChanged(null, null);
         label3.Text      = "Supprission reussite";
         label3.ForeColor = Color.Green;
         clearfild();
     }
 }
 private void btnEmAjouter_Click(object sender, EventArgs e)
 {
     if (cbJour.SelectedIndex == -1 || cbtime.SelectedIndex == -1 || txtactivite.Text == "")
     {
         label3.Text      = "Vieullez remplir les champs !!";
         label3.ForeColor = Color.Red;
     }
     else if (Utils.isVide(cbJour.SelectedIndex, cbtime.SelectedIndex, dgvEmploiTemps))
     {
         BaseDonneeConnecter.addSeance(grop.SelectedItem.ToString(), (cbJour.SelectedIndex + 1), (cbtime.SelectedIndex + 1), txtactivite.Text, cbusers.SelectedItem.ToString(), txtsalle.Text);
         grop_SelectedIndexChanged(null, null);
         txtactivite.Clear();
         label3.Text      = "Ajoutation reussite";
         label3.ForeColor = Color.Green;
         clearfild();
     }
     else
     {
         label3.Text      = "Cette periode est Occupez vieullez selectionez une periode vide ou vider une preriode !!";
         label3.ForeColor = Color.Red;
     }
 }
Exemplo n.º 8
0
 public static void rempli_liste(ComboBox l)
 {
     jours = BaseDonneeConnecter.getJourFromGroupe(l.SelectedItem.ToString());
 }