public void Modifier(string code_emp, string nom, string prenom, string sexe, string date_naissance,
                             string telephone, string email, string adresse, string surplus_salaire,
                             string code_dep, string code_grade, string code_poste, string debut, string motif)
        {
            try
            {
                double surplus = 0.0;
                if (surplus_salaire.Length > 0)
                {
                    surplus = Double.Parse(surplus_salaire);
                }

                DateTime naissance = DateTime.Parse("1/1/0001");
                if (date_naissance.Length > 0)
                {
                    naissance = DateTime.Parse(date_naissance);
                }
                Employe e = new Employe(code_emp, nom, prenom, sexe, naissance, telephone, email, adresse, surplus);

                StatutCarriere s = new StatutCarriere(code_dep, code_emp, int.Parse(code_grade), int.Parse(code_poste), DateTime.Parse(debut), motif);

                EmployeDAL.Update(e, s);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + " - Couche(APP)");
            }
        }
        public DataTable Rechercher(string keyWords, int type)
        {
            try
            {
                DataTable dt = new DataTable();

                switch (type)
                {
                case 0: dt = EmployeDAL.Trouver(keyWords);
                    break;

                case 1: dt = EmployeDAL.RechercherParNom(keyWords);
                    break;

                case 2: dt = EmployeDAL.RechercherParCodeEtNom(keyWords);
                    break;
                }

                return(dt);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + " - Couche(APP)");
            }
        }
Пример #3
0
        private void DeleteEmploye_Click(object sender, RoutedEventArgs e)
        {
            Employe RecupEmploye = dataGrid.SelectedItem as Employe;

            EmployeDAL SupprimerEmploye = new EmployeDAL();

            SupprimerEmploye.SupprimerEmployeMaintenance(idMaintenance, RecupEmploye.Id_Employe);

            this.NavigationService.Navigate(new DetailMaintenance(idMaintenance));
        }
 public Employe EmployePourModification(string code)
 {
     try
     {
         return(EmployeDAL.TrouverEmploye(code));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public void Eliminer(string code_emp)
 {
     try
     {
         EmployeDAL.Delete(code_emp);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public DataTable AnniversaireAVenir()
 {
     try
     {
         DataTable dt = EmployeDAL.Rapport(RapportGlobal.AnniversaireProche);
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public DataTable EmployesEnConge()
 {
     try
     {
         DataTable dt = EmployeDAL.Rapport(RapportGlobal.EmployesEnConge);
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public Payroll GetPayroll()
 {
     try
     {
         Payroll p = EmployeDAL.CalculerPayroll();
         return(p);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public List <Employe> All()
 {
     try
     {
         List <Employe> eList = EmployeDAL.All();
         return(eList);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public DataTable AbsenceAnnuelle(DateTime date)
 {
     try
     {
         DataTable dt = EmployeDAL.RapportPresence(RapportGlobal.AbsenceAnnee, date.Year);
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public DataTable PresenceMensuelle(DateTime date)
 {
     try
     {
         DataTable dt = EmployeDAL.RapportPresence(RapportGlobal.PresenceMois, date.Year, date.Month);
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
 public DataTable ComptageEmployeParDepartement()
 {
     try
     {
         DataTable dt = EmployeDAL.Rapport(RapportGlobal.ComptageEmployeParDepartement);
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + " - Couche(APP)");
     }
 }
Пример #13
0
        public AjoutEmploye(int id)
        {
            InitializeComponent();

            this.idMaintenance = id;

            EmployeDAL AfficherEmploye = new EmployeDAL();

            // dataGrid.ItemsSource = AfficherEmploye.ListeDesEmployesMaintenances();

            List <Employe> Test = AfficherEmploye.ListeDesEmployesMaintenances();
            List <Employe> EmployeMaintenance = new List <Employe>();

            foreach (Employe item in Test)
            {
                item.IsInTeam = true;
                EmployeMaintenance.Add(AfficherEmploye.IsInMaintenance(item, idMaintenance));
            }

            dataGrid.ItemsSource = EmployeMaintenance;
        }
Пример #14
0
        public DetailMaintenance(int id)
        {
            InitializeComponent();

            EmployeDAL RecupEmployes = new EmployeDAL();

            dataGrid.ItemsSource = RecupEmployes.ListeDesEmployesParMaintenance(id);

            MaintenanceDAL     ResumeMaintenance     = new MaintenanceDAL();
            List <Maintenance> DetailDeLaMaintenance = new List <Maintenance>();

            DetailDeLaMaintenance = ResumeMaintenance.ReadMaintenance(id);

            this.idMaintenance = id;

            getId.Text          = Convert.ToString(DetailDeLaMaintenance[0].Id_Maintenance);
            getTitre.Text       = Convert.ToString(DetailDeLaMaintenance[0].Libelle);
            getDescription.Text = Convert.ToString(DetailDeLaMaintenance[0].Description);
            getDebut.Text       = Convert.ToDateTime(DetailDeLaMaintenance[0].Date_Debut).ToString("dd/MM/yyyy");
            getFin.Text         = Convert.ToDateTime(DetailDeLaMaintenance[0].Date_Fin).ToString("dd/MM/yyyy");
            getIncident.Text    = Convert.ToString(DetailDeLaMaintenance[0].Id_Incident);
        }