public Employe(TypeEmploye p_TypeEmploye, String p_NomUtilisateur, String p_Nom, String p_Prenom, String p_MotDePasse) { this.NomUtilisateur = p_NomUtilisateur; this.Nom = p_Nom; this.Prenom = p_Prenom; this.MotDePasse = p_MotDePasse; this.Type = p_TypeEmploye; }
public void update(TypeEmploye type_) { var query = bd.TypeEmploye.Find(type_.TypeEmployeid); if (query != null) { query.nomTypeEmploye = type_.nomTypeEmploye; } bd.SaveChanges(); }
public void insert(TypeEmploye typeEmp) { try { typeEmployeDAO.insert(typeEmp); } catch (Exception e) { throw new Exception("Erreur dans TypeEmployeService => insert:" + e.Message); } }
public void remove(TypeEmploye typeEmp) { try { typeEmployeDAO.remove(typeEmp); } catch (Exception e) { throw new Exception("Erreur dans TypeEmployeService => remove:" + e.Message); } }
public List <TypeEmploye> search(TypeEmploye typeEmp) { List <TypeEmploye> listAll; try { listAll = typeEmployeDAO.search(typeEmp); } catch (Exception e) { throw new Exception("Erreur dans TypeEmployeService => search:" + e.Message); } return(listAll); }
// // 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()); }
public void insert(TypeEmploye typeEmp) { conn = new DB().getConn(); try { string query = "insert into type_employe (id,libelle) values (nextval('seq_type_employe')," + typeEmp.Libelle + ")"; cmd = new NpgsqlCommand(query, conn); cmd.ExecuteNonQuery(); } catch (Exception e) { throw new Exception("Erreur dans CarteDao=>insert" + e.Message); } finally { conn.Close(); } }
public void remove(TypeEmploye typeEmp) { conn = new DB().getConn(); try { string query = "delete * from type_employe where id = " + typeEmp.Id; cmd = new NpgsqlCommand(query, conn); cmd.ExecuteNonQuery(); } catch (Exception e) { throw new Exception("Erreur dans TypeEmployeDAO=>remove " + e.Message); } finally { conn.Close(); } }
public void add(TypeEmploye type_) { bd.TypeEmploye.Add(type_); bd.SaveChanges(); }