public static void InsertNewSkill(String name, String description, int level, Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var existing = from c in bie.competences where c.description.Equals(description) where c.name.Equals(name) select c; if (existing.Count() == 0) { competence comp = new competence { name = name, description = description }; bie.competences.AddObject(comp); bie.SaveChanges(); } var idComp = from c in bie.competences where c.name.Equals(name) where c.description.Equals(description) select c.id; user_competence uc = new user_competence { user = userId, competence = idComp.First(), level = level, }; bie.user_competence.AddObject(uc); bie.SaveChanges(); }
public static int InsertCompany(String name, String adresse, String tel) { bindedinEntities bie = SingletonEntities.Instance; var existingCompany = from s in bie.companies where s.nom.Equals(name) where s.adresse.Equals(adresse) where s.telephone.Equals(tel) select s; if (existingCompany.Count() == 0) { company sc = new company { nom = name, adresse = adresse, telephone = tel, }; bie.companies.AddObject(sc); bie.SaveChanges(); } var id = from s in bie.companies where s.nom.Equals(name) where s.adresse.Equals(adresse) where s.telephone.Equals(tel) select s.id; return(id.First()); }
public static int InsertSchool(String name, String description) { bindedinEntities bie = SingletonEntities.Instance; var existingSchool = from s in bie.schools where s.name.Equals(name) where s.description.Equals(description) select s; if (existingSchool.Count() == 0) { school sc = new school { name = name, description = description }; bie.AddToschools(sc); bie.SaveChanges(); } var id = from s in bie.schools where s.name.Equals(name) where s.description.Equals(description) select s.id; return(id.First()); }
//efface le message correspondant à l'id passé en parametre //mode=1 ->reception //mode=2 ->envoie public static void deleteMessage(int messageId, int mode) { bindedinEntities bie = SingletonEntities.Instance; //on recupere le messge à effacer var deleteMessages = from m in bie.messages where m.id.Equals(messageId) select m; if (mode == 1) { foreach (var me in deleteMessages) { me.isRemovedRecipient = 1; } } else { foreach (var me in deleteMessages) { me.isRemovedSender = 1; } } try { //on sauvergarde les modifs bie.SaveChanges(); } catch (Exception e) { Console.WriteLine(e); } }
public static List <Image> GetAllImages() { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images select i; return(retour.ToList()); }
public static List <school> GetSchools() { bindedinEntities bie = SingletonEntities.Instance; var formations = from c in bie.schools select c; return(formations.ToList()); }
public static List <formation> GetFormations() { bindedinEntities bie = SingletonEntities.Instance; var formations = from c in bie.formations select c; return(formations.ToList()); }
public static List <aspnet_Users> GetUtilisateurs() { bindedinEntities bie = SingletonEntities.Instance; var users = from c in bie.aspnet_Users select c; return(users.ToList()); }
public static List <company> GetCompanies() { bindedinEntities bie = SingletonEntities.Instance; var formations = from c in bie.companies select c; return(formations.ToList()); }
public static List <professional_experience> GetProferssionalExp() { bindedinEntities bie = SingletonEntities.Instance; var formations = from c in bie.professional_experience select c; return(formations.ToList()); }
public static List <aspnet_Users> GetUtilisateurs(Guid id) { bindedinEntities bie = SingletonEntities.Instance; var users = from c in bie.aspnet_Users where c.UserId.Equals(id) select c; return(users.ToList()); }
public static List <Image> GetCurrentImages() { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images where i.Current.Equals(true) select i; return(retour.ToList()); }
public static List <formation> GetFormations(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from uf in bie.user_formation from f in bie.formations where uf.user.Equals(userId) where uf.formation.Equals(f.id) select f; return(retour.ToList()); }
public static List <competence> GetSkills(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from uc in bie.user_competence from c in bie.competences where uc.user.Equals(userId) where uc.competence.Equals(c.id) select c; return(retour.ToList()); }
public static List <professional_experience> GetProferssionalExp(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from ue in bie.user_experienceprofessional from p in bie.professional_experience where ue.user.Equals(userId) where ue.experience_professional.Equals(p.id) select p; return(retour.ToList()); }
public static List <v_formation_schools1> GetFormationSchools(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from f in bie.v_formation_schools1 orderby f.end_date descending where f.user.Equals(userId) select f; return(retour.ToList()); }
public static List <recommandation> getRecommandations(Guid user) { bindedinEntities bie = SingletonEntities.Instance; // on recupere les messages var search = from r in bie.recommandations where r.recipient.Equals(user) select r; return(search.ToList()); }
public static List <v_xp_companies> GetProferssionalExpCompanies(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from p in bie.v_xp_companies orderby p.end_date descending where p.user.Equals(userId) select p; return(retour.ToList()); }
public static List <company> GetCompanies(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from uep in bie.user_experienceprofessional from pe in bie.professional_experience from c in bie.companies where uep.user.Equals(userId) where uep.experience_professional.Equals(pe.id) where pe.company.Equals(c.id) select c; return(retour.ToList()); }
public static List <school> GetSchools(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from uf in bie.user_formation from f in bie.formations from sc in bie.schools where uf.user.Equals(userId) where uf.formation.Equals(f.id) where f.school.Equals(sc.id) select sc; return(retour.ToList()); }
//renvoit tous les messages public static List <message> GetAllMessages() { bindedinEntities bie = SingletonEntities.Instance; // on recupere touts les messages var search = from m in bie.messages orderby m.date descending select m; return(search.ToList()); }
public static List <v_user_competences> GetSkillsUser(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from uc in bie.user_competence from c in bie.v_user_competences orderby c.level descending, c.name ascending where uc.user.Equals(userId) where uc.competence.Equals(c.id) select c; return(retour.ToList()); }
//passe un message à "lu" public static void ReadMessage(int idMessage) { bindedinEntities bie = SingletonEntities.Instance; message m = GetMessageById(idMessage); if (m != null) { //modele pas encore mise a jour m.isRead = 1; bie.SaveChanges(); } }
public static List <Image> GetImage(int imgId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images where i.id.Equals(imgId) select i; if (retour.Count() > 0) { return(retour.ToList()); } return(null); }
//renvoit tous les messages recus d'un utilisateur public static List <message> GetMessageByRecipientId(Guid recipientId) { bindedinEntities bie = SingletonEntities.Instance; message messageReturn = new message(); // on recupere les messages var search = from m in bie.messages where m.recipient == recipientId && m.isRemovedRecipient.Equals(0) orderby m.date descending select m; return(search.ToList()); }
public static List <UserProfile> GetUtilisateurs() { bindedinEntities bie = SingletonEntities.Instance; List <UserProfile> usersList = new List <UserProfile>(); var users = from c in bie.aspnet_Users select c; foreach (aspnet_Users u in users.ToList()) { usersList.Add(UserProfile.GetUserProfile(u.UserName)); } return(usersList); }
public static List <Image> GetAllImages(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images orderby i.Current descending, i.Date descending where i.UserId.Equals(userId) select i; //retour.OrderBy(i => i.Current).ThenBy(i => i.Date); return(retour.ToList()); }
public static List <Image> GetCurrentImages(Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images where i.UserId.Equals(userId) && i.Current == true select i; if (retour.Count() > 0) { return(retour.ToList()); } return(null); }
public static void deleteImage(int idImg, Guid userId) { bindedinEntities bie = SingletonEntities.Instance; var retour = from i in bie.Images where i.id.Equals(idImg) && i.UserId.Equals(userId) select i; foreach (Image img in retour) { bie.Images.DeleteObject(img); } bie.SaveChanges(); }
public static aspnet_Users GetUtilisateurById(Guid id) { bindedinEntities bie = SingletonEntities.Instance; var users = from c in bie.aspnet_Users where c.UserId.Equals(id) select c; aspnet_Users u = new aspnet_Users(); foreach (aspnet_Users userItem in users.ToList()) { u = userItem; } return(u); }