/// <summary> /// Deprecated Method for adding a new object to the relation_status EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTorelation_status(relation_status relation_status) { base.AddObject("relation_status", relation_status); }
public static Boolean SendInvitation(String asking_userName, String asked_username, String message) { UserProfile loggedInProfile = UserProfile.GetUserProfile(asking_userName); String obj = String.Format("{0} {1} veut vous inviter dans son réseau !", loggedInProfile.FirstName, loggedInProfile.LastName); String messageToSend = message; messageToSend += "\n"; Uri uri = HttpContext.Current.Request.Url; String host = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port; String linkForInvitation = host + String.Format("/AcceptedInvitation.aspx?id_asking={0}&id_asked={1}", (Guid)(Membership.GetUser(asking_userName, false).ProviderUserKey), (Guid)(Membership.GetUser(asked_username, false).ProviderUserKey)); messageToSend += "<br />Voici le lien pour accepter cette invitation : <br /> <a href=\"" + linkForInvitation + " \" class=\"btn\">Accepter la demande</a>"; messageToSend += "\n"; messageToSend += "<br />Sinon ignorez tout simplement ce message"; messageToSend += "<br />Cordialement,"; messageToSend += "<br />Votre équipe BindedIn"; Business.MessageService.SendMessage((Guid)(Membership.GetUser(asking_userName, false).ProviderUserKey), (Guid)(Membership.GetUser(asked_username, false).ProviderUserKey), obj, messageToSend); bindedinEntities bie = SingletonEntities.Instance; relation_status newRelation = new relation_status(); newRelation.status = 1; newRelation.asked_date = DateTime.Now; newRelation.asked_user = (Guid)(Membership.GetUser(asked_username, false).ProviderUserKey); newRelation.asking_user = (Guid)(Membership.GetUser(asking_userName, false).ProviderUserKey); bie.relation_status.AddObject(newRelation); bie.SaveChanges(); return true; }
/// <summary> /// Create a new relation_status object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="asking_user">Initial value of the asking_user property.</param> /// <param name="asked_user">Initial value of the asked_user property.</param> /// <param name="status">Initial value of the status property.</param> /// <param name="asked_date">Initial value of the asked_date property.</param> public static relation_status Createrelation_status(global::System.Int32 id, global::System.Guid asking_user, global::System.Guid asked_user, global::System.Int32 status, global::System.DateTime asked_date) { relation_status relation_status = new relation_status(); relation_status.id = id; relation_status.asking_user = asking_user; relation_status.asked_user = asked_user; relation_status.status = status; relation_status.asked_date = asked_date; return relation_status; }