Esempio n. 1
0
 private void TxtMatricule_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (TxtMatricule.Text != "" && TxtConge.Text != "")
     {
         E     = new Employe(TxtMatricule.Text, FMenu.C);
         conge = new Conge(E, DateTime.Parse(TxtConge.Text), FMenu.C);
         if (conge.existance_matricule_date() == false)
         {
             BtnAjouter.Enabled   = true;
             BtnSupprimer.Enabled = false;
             BtnModifier.Enabled  = false;
             TxtType.Text         = "";
             TxtDuree.Text        = "";
         }
         else
         {
             BtnAjouter.Enabled   = false;
             BtnSupprimer.Enabled = true;
             BtnModifier.Enabled  = true;
             conge.recherch_matricule_date();
             String date = conge.GetConnextion().dt.Rows[0][1].ToString();
             TxtConge.Text = DateTime.Parse(date).ToShortDateString();
             TxtType.Text  = conge.GetConnextion().dt.Rows[0][2].ToString();
             TxtDuree.Text = conge.GetConnextion().dt.Rows[0][3].ToString();
         }
         TxtType.Select();
     }
 }
Esempio n. 2
0
        private void Fconge_annee_mois_Load(object sender, EventArgs e)
        {
            Conge C = new Conge(FMenu.C);

            C.statistique_durree_annee_mois();
            DGV.DataSource = C.GetConnextion().dt;
        }
Esempio n. 3
0
 //*******************************|| FUNCTIONS ||*******************************
 public void actualiser()
 {
     conge = new Conge(FMenu.C);
     conge.lister();
     DGV.DataSource    = conge.GetConnextion().dt;
     TxtMatricule.Text = "";
     TxtDuree.Text     = "";
     TxtType.Text      = "";
     msg.Text          = "";
     TxtConge.Text     = DateTime.Today.ToShortDateString();
 }
Esempio n. 4
0
 private void TxtMatricule_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (TxtMatricule.Text != "")
     {
         Employe E = new Employe(TxtMatricule.Text, FMenu.C);
         Conge   C = new Conge(E, FMenu.C);
         C.conge_employe();
         DGV.DataSource = C.GetConnextion().dt;
         TxtDuree.Text  = C.duree_totlal_eploye();
     }
 }
Esempio n. 5
0
 private void BtnAjouter_Click(object sender, EventArgs e)
 {
     if (TxtMatricule.Text == "" || TxtConge.Text == "" || TxtDuree.Text == "" || TxtType.Text == "")
     {
         msg_error("données non valide");
         return;
     }
     E     = new Employe(TxtMatricule.Text, FMenu.C);
     conge = new Conge(E, DateTime.Parse(TxtConge.Text), TxtType.Text, int.Parse(TxtDuree.Text),
                       FMenu.C);
     conge.ajouter();
     actualiser();
     msg_success("ajout effectué");
 }
Esempio n. 6
0
 private void BtnEtat_Click(object sender, EventArgs e)
 {
     try
     {
         DateTime.Parse(TxtDate1.Text);
         DateTime.Parse(TxtDate2.Text);
     }
     catch (Exception m)
     {
         MessageBox.Show(m.Message);
     }
     finally
     {
         Conge C = new Conge(FMenu.C);
         C.conge_periode(TxtDate1.Text, TxtDate2.Text);
         DGV.DataSource = C.GetConnextion().dt;
     }
 }
Esempio n. 7
0
 private void BtnSupprimer_Click(object sender, EventArgs e)
 {
     if (TxtMatricule.Text == "" || TxtConge.Text == "")
     {
         msg_error("matricule non valide");
         return;
     }
     if (MessageBox.Show("Etes vous sùr de vouloir supprimer l'employe "
                         + TxtMatricule.Text + "a la date " + TxtConge, "Confirmer",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
     {
         msg_success("suppression annulée");
         return;
     }
     E     = new Employe(TxtMatricule.Text, FMenu.C);
     conge = new Conge(E, DateTime.Parse(TxtConge.Text), FMenu.C);
     conge.supprimer();
     actualiser();
     msg_success("suppression effectué");
 }
Esempio n. 8
0
 private void TxtDate2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         try
         {
             DateTime.Parse(TxtDate1.Text);
             DateTime.Parse(TxtDate2.Text);
         }
         catch (Exception m)
         {
             MessageBox.Show(m.Message);
         }
         finally
         {
             Conge C = new Conge(FMenu.C);
             C.conge_periode(TxtDate1.Text, TxtDate2.Text);
             DGV.DataSource = C.GetConnextion().dt;
         }
     }
 }