public static void DeleteBorne(Borne borne) { FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); facSecondaireEntity.Borne.Remove(borne); facSecondaireEntity.SaveChanges(); }
public static void DeleteUser(User user) { FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); facSecondaireEntity.User.Remove(user); facSecondaireEntity.SaveChanges(); }
public static void DeleteUserbyId(string id) { User user = getUserID(id); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); facSecondaireEntity.User.Remove(user); facSecondaireEntity.SaveChanges(); }
public static void setBorne(Borne borne) { FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); facSecondaireEntity.Borne.Add(borne); facSecondaireEntity.SaveChanges(); }
public static void setUser(User user) { FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); facSecondaireEntity.User.Add(user); facSecondaireEntity.SaveChanges(); }
public static List <User> getAllListUsers() { List <User> listUser = new List <User>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var userEntities = from u in facSecondaireEntity.User select u; listUser = userEntities.OrderBy(u => u.nom).ToList(); return(listUser); }
public static string getLastIdUser() { User user = new User(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var userEntity = from u in facSecondaireEntity.User select u; user = userEntity.OrderByDescending(u => u.user_id).FirstOrDefault(); return(user.user_id); }
public static List <Borne> getAllListBorne() { List <Borne> listBornes = new List <Borne>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntities = from b in facSecondaireEntity.Borne select b; listBornes = borneEntities.OrderBy(b => b.user_id).ToList(); return(listBornes); }
public static Borne getLastNbPassageByUserID(string id) { Borne borne = new Borne(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntity = from b in facSecondaireEntity.Borne where b.user_id == id select b; borne = borneEntity.OrderByDescending(u => u.nb_passage).FirstOrDefault(); return(borne); }
public static List <Borne> getBorneByUserID(string id) { List <Borne> bornes = new List <Borne>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var broneEntities = from b in facSecondaireEntity.Borne where b.user_id == id select b; bornes = broneEntities.OrderBy(b => b.nb_passage).ToList(); return(bornes); }
public static List <Borne> getAvertissementBorneByUserID(string id) { List <Borne> bornes = new List <Borne>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntities = from b in facSecondaireEntity.Borne where b.user_id == id && b.nb_passage == -2 select b; bornes = borneEntities.ToList(); return(bornes); }
public static void DeleteBornebyUserID(string id) { List <Borne> bornes = getBorneByUserID(id); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); foreach (Borne borne in bornes) { facSecondaireEntity.Borne.Remove(borne); facSecondaireEntity.SaveChanges(); } }
public static Borne getPassageByNbPassage(string user_id, int nb_passage) { Borne borne = new Borne(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntity = from b in facSecondaireEntity.Borne where b.user_id == user_id && b.nb_passage == nb_passage select b; borne = borneEntity.FirstOrDefault(); return(borne); }
public static User getUserID(string id) { User user = new User(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var userEntity = from u in facSecondaireEntity.User where u.user_id == id select u; user = userEntity.FirstOrDefault(); return(user); }
public static List <Borne> getAvertissementAllListBorne() { List <Borne> listBornes = new List <Borne>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntities = from b in facSecondaireEntity.Borne where b.nb_passage == -2 select b; listBornes = borneEntities.OrderBy(b => b.nb_passage).ToList(); return(listBornes); }
public static List <User> searchUserNom(string nom) { List <User> users = new List <User>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var userEntity = from u in facSecondaireEntity.User where u.nom.Contains(nom) select u; users = userEntity.ToList(); return(users); }
public static List <Borne> getNombreTourAllListBorne() { List <Borne> listBornes = new List <Borne>(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntities = facSecondaireEntity.classementNbTours2(); foreach (classementNbTours2_Result borneResult in borneEntities) { Borne borne = new Borne(); borne.borne_id = 0; borne.user_id = borneResult.user_id; borne.nb_passage = Convert.ToInt32(borneResult.nb_passage); borne.temps = new DateTime(); listBornes.Add(borne); } return(listBornes); }
public static Boolean getExistBorne(string id) { Borne borne = new Borne(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var borneEntity = from b in facSecondaireEntity.Borne where b.user_id == id select b; borne = borneEntity.FirstOrDefault(); if (borne != null) { return(true); } else { return(false); } }
public static Boolean getExistUser(string id) { User user = new User(); FacSecondaireEntities facSecondaireEntity = new FacSecondaireEntities(); var userEntity = from u in facSecondaireEntity.User where u.user_id == id select u; user = userEntity.FirstOrDefault(); if (user != null) { return(true); } else { return(false); } }