//envoit une recommandations public static void SendRecommandation(Guid sender, Guid recipient, string me) { bindedinEntities bie = SingletonEntities.Instance; //on creait une nouvelle recommandation recommandation r = new recommandation(); r.sender = sender; r.recipient = recipient; r.message = me; //on sauvegarde le message dans la base bie.recommandations.AddObject(r); bie.SaveChanges(); }
public static recommandation getRecommandationsById(int id) { bindedinEntities bie = SingletonEntities.Instance; recommandation re = new recommandation(); // on recupere les messages var search = from r in bie.recommandations where r.id.Equals(id) select r; foreach (recommandation r in search.ToList()) { re = r; } return re; }
public RecommandationPlus(recommandation r) { this.message = r.message; this.sender = r.sender; this.recipient = r.recipient; this.id = r.id; UserProfile up = UserProfile.GetUserProfile(UserService.GetUtilisateurById(this.sender).UserName); this.senderName = up.FirstName + " " + up.LastName; up = UserProfile.GetUserProfile(UserService.GetUtilisateurById(this.recipient).UserName); this.recipientName = up.FirstName + " " + up.LastName; this.profilLink = "Profil.aspx?id=" + up.UserName; }
/// <summary> /// Deprecated Method for adding a new object to the recommandations EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTorecommandations(recommandation recommandation) { base.AddObject("recommandations", recommandation); }
/// <summary> /// Create a new recommandation object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="recipient">Initial value of the recipient property.</param> /// <param name="sender">Initial value of the sender property.</param> /// <param name="message">Initial value of the message property.</param> public static recommandation Createrecommandation(global::System.Int32 id, global::System.Guid recipient, global::System.Guid sender, global::System.String message) { recommandation recommandation = new recommandation(); recommandation.id = id; recommandation.recipient = recipient; recommandation.sender = sender; recommandation.message = message; return recommandation; }