public void UtilisateurListe() { try { ListeUser = new List <CategoryItem>(); List <Employe> emp = (List <Employe>)EmployeDAO.selectEmployes(); if (emp != null) { foreach (Employe em in emp) { ListeUser.Add(new CategoryItem() { ButtonUserContent = em.prenom, ButtonUserTag = em.id, ButtonUserBackground = Brushes.Teal }); } } else { ListeUser.Add(new CategoryItem() { ButtonUserContent = "Erreur", ButtonUserBackground = Brushes.Teal }); } } catch (Exception e) { MessageBox.Show("Erreur chargement utilisateur" + e); } }
public void UpdateLigneFrais(int id_comptable, int id_ligne_frais, int id_fiche_frais, string etat_ligne_frais) { EmployeDAO employeManager = new EmployeDAO(); FicheFraisDAO ficheFraisManager = new FicheFraisDAO(); LigneFraisDAO ligneFraisManager = new LigneFraisDAO(); FicheFrais ficheFrais = ficheFraisManager.Read(id_fiche_frais, true); if (ficheFrais.Comptable == null) { ficheFrais.Comptable = employeManager.Read(id_comptable); ficheFraisManager.Update(ficheFrais); } LigneFrais ligneFrais = ligneFraisManager.Read(id_ligne_frais, true); ligneFrais.EtatLigne = (LigneFrais.EtatLigneFrais)Enum.Parse(typeof(LigneFrais.EtatLigneFrais), etat_ligne_frais); ligneFrais.Date_modification = DateTime.Now; if (ligneFrais.EtatLigne == LigneFrais.EtatLigneFrais.mise_en_paiement) { ligneFrais.Date_engagement = DateTime.Now; } else { ligneFrais.Date_engagement = null; } ligneFraisManager.Update(ligneFrais); }
public ActionResult Connexion(string login, string password) { EmployeDAO employeManager = new EmployeDAO(); Employe employe = employeManager.Connexion(login, password); Session["Employe"] = employe; ViewBag.Employe = employe; if (employe != null) { if (employe.Type == Employe.TypeEmploye.comptable) { return(RedirectToAction("Comptable", "Comptable")); } else { return(RedirectToAction("ConsultationRDV", "Commercial")); } } else { ViewBag.Message = "Accès refusé, veuillez vous authentifier"; return(View("Index")); } }
public void AddModifyRDV(int?id, string date, string time, string motif, int indice, int id_employe, int id_praticien) { RendezVousDAO rendezVousManager = new RendezVousDAO(); PraticienDAO praticienManager = new PraticienDAO(); EmployeDAO employeManager = new EmployeDAO(); RendezVous newRDV = id == null ? new RendezVous() : rendezVousManager.Read((int)id, false); //Debug.WriteLine("Debug.Time = > " + time); newRDV.Date_rdv = new DateTime(Convert.ToInt32(date.Substring(0, 4)), Convert.ToInt32(date.Substring(5, 2)), Convert.ToInt32(date.Substring(8)), Convert.ToInt32(time.Substring(0, 2)), Convert.ToInt32(time.Substring(3)), 00); newRDV.Date_bilan = newRDV.Date_rdv.AddDays(7); newRDV.Indice_confiance = indice; newRDV.Motif_rdv = (RendezVous.Rdv)Enum.Parse(typeof(RendezVous.Rdv), motif); newRDV.Praticien = praticienManager.Read(id_praticien); newRDV.Employe = employeManager.Read(id_employe); if (id == null) // ADD { rendezVousManager.Create(newRDV); } else // MODIFY { rendezVousManager.Update(newRDV); } }
private void ExecuteDeleteUser(UnUtilisateurVM obj) { Employe employee = (Employe)EmployeDAO.selectEmployeById(obj.idEmployee); EmployeDAO.deleteEmploye(employee); ListeEmployee(); }
public Employe GetEmploye(string email) { listeEmployes = EmployeDAO.List(myConnection); var empSearch = listeEmployes.Where(e => e.Email == email).FirstOrDefault();; return(empSearch); }
public static Employe OneByNom(string nom_prenom, bool full, int societe) { try { return(EmployeDAO.getOneByNom(nom_prenom, full, societe)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static Employe OneById(int id, bool full, int societe) { try { return(EmployeDAO.getOneById(id, full, societe)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public static List <Employe> List(string query, bool full) { try { return(EmployeDAO.getList(query, full)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void findAllTest() { List <Employe> desEmploye; EmployeDAO uneDAO = new EmployeDAO(); desEmploye = uneDAO.findAll(); int actual = desEmploye.Count; int expected = 2; Assert.AreEqual(expected, actual, "mauvais nombre d'employés"); }
public void findByLoginTest() { Employe unEmploye; EmployeDAO uneDAO = new EmployeDAO(); string login = "******"; string expected = "a"; unEmploye = uneDAO.findByLogin(login, expected); string actual = unEmploye.getMdp(); Assert.AreEqual(expected, actual, "erreur dans la récupération de l'employé"); }
public void findTest() { Employe unEmploye; EmployeDAO uneDAO = new EmployeDAO(); int id = 2; int expected = 3; unEmploye = uneDAO.find(id); int actual = unEmploye.getLesEnfants().Count; Assert.AreEqual(expected, actual, "erreur dans le nombre d'enfants de l'employé n°2"); }
public void ajouterUser(GestionnUtilisateursVM obj) { //listeEmploye = (List<Employe>)EmployeDAO.selectEmployes(); Employe employee = new Employe(obj._txb_Utilisateur_Name, obj._txb_Utilisateur_Prenom); if (employee != null) { EmployeDAO.insertEmploye(employee); Txb_Utilisateur_Name = null; ListeEmployee(); } }
public bool DeleteEmploye([FromBody] Employe employe) { bool status = false; if (ModelState.IsValid) { if (EmployeDAO.DeleteEmploye(employe, myConnection) > 0) { status = true; } } return(status); }
public WChoixJouet() { InitializeComponent(); EmployeDAO employDAO=new EmployeDAO(); Employe unEmployer = employDAO.find(1); LSubTitle.Content += " M. " + unEmployer.getNom(); ArrayList listeJouets= classJouet.findAll() ; foreach (CatalogueJouetPoulmane.Jouet unjouet in listeJouets) { CBChoixJouet.Items.Add(unjouet.getLibelle()); } //lesEnfants; }
private void ListeEmployee() { ListeUtilisateurs = new List <UnUtilisateurVM>(); List <Employe> employees = (List <Employe>)EmployeDAO.selectEmployes(); foreach (Employe em in employees) { ListeUtilisateurs.Add(new UnUtilisateurVM() { NameUtilisateur = em.nom, PrenomUtilisateur = em.prenom, idEmployee = em.id }); } }
// // GET: /Accueil/ public ActionResult Index(string id, string utilisateur) { distribCarteService = new DistributionCarteService(); carteService = new CarteService(); empService = new EmployeService(); typeEmployeService = new TypeEmployeService(); List <DistributionCarteVue> listCarteDistribue = distribCarteService.getAll(); List <Carte> listCarte = carteService.getAll(); TypeEmploye typEmp = typeEmployeService.findById(3); Employe emp = new Employe(typEmp); List <EmployeVue> listEmp = new EmployeDAO().search(emp); ViewBag.ListeCarteDistr = listCarteDistribue; ViewBag.ListeCarte = listCarte; ViewBag.ListEmp = listEmp; return(View()); }
// Action sur button utilisateur public void ClickSurUtilisateur(object User) { Button clickedbutton = User as Button; //Action qui suit si le button utilisateur est actionné if (clickedbutton != null) { //Si un utilisateur est en cours if (ClasseGlobale.employeeEnCours != null) { ColorUserConnect = Brushes.Orange; //Un processus est en cours if (accessUserControl != null) { MessageBox.Show("Un utilisateur est en cours d'utilisation \n Un processus est en cours"); } else { MessageBox.Show("Un utilisateur est en cours d'utilisation"); } } else if (accessUserControl != null) { MessageBox.Show("Un processus est en cours"); } //Changement d utilisateur else { try { ClasseGlobale.employeeEnCours = EmployeDAO.selectEmployeById(Int32.Parse(clickedbutton.Tag.ToString())); Label_Accueil_NomUser = "******" + ClasseGlobale.employeeEnCours.nom + " " + ClasseGlobale.employeeEnCours.prenom; ColorUserConnect = Brushes.Green; } catch (Exception e) { MessageBox.Show("" + e); } } } }
public static Employe OneById(int id, bool full, string adresse) { try { Employe employe = Constantes.EMPLOYES.Find(x => x.Id == id && (Utils.asString(x.Adresse) && Utils.asString(adresse) ? x.Adresse == adresse : true)); if (employe != null ? employe.Id < 1 : true) { employe = EmployeDAO.getOneById(id, full, adresse); if (employe != null ? employe.Id > 0 : false) { Constantes.EMPLOYES.Add(employe); } } return(employe); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void Button_Click(object sender, RoutedEventArgs e) { string username=TBUser.Text; string password=TBPassword.Text; //bool valide = Passerelle.identification(username, password); EmployeDAO DaoEmploye = new EmployeDAO(); Employe unEmploye = DaoEmploye.findlogin(username, password); bool admin=unEmploye.getAdmin(); try { if (unEmploye != null) { if (admin == true) { WAdmin windows=new WAdmin(); windows.Show(); } else { WChoixJouet windows = new WChoixJouet(); windows.Show(); } this.Close(); } else { lEtat.Content = "Nom d'utilisateur ou mot de passe incorrecte"; TBPassword.Text = ""; } } catch { MessageBox.Show("Connexion impossible"); lEtat.Content = "Connexion impossible"; } }
public Employe VerifierLogin([FromUri] string email, string password) { return(EmployeDAO.VerifierLogin(email, password, myConnection)); }
public EmployeService() { employeDAO = new EmployeDAO(); }
public IEnumerable <Employe> GetAllEmployes() { listeEmployes = EmployeDAO.List(myConnection); return(listeEmployes); }