Exemplo n.º 1
0
        /// <summary>
        /// Metod som lägger till en friendRequest in i databsen.
        /// </summary>
        /// <param name="toUser"></param>
        /// <param name="currentUser"></param>
        /// <param name="answer">1 = request - 0 = vän</param>
        public void addFriendRequest(string toUser, string currentUser, int answer)
        {
            try
            {
                var context = new DatingEntities();
                Kontakter a = new Kontakter();

                a.Kontakt = toUser;
                a.Request = answer;
                a.Anvandare = currentUser;

                context.Kontakter.AddObject(a);

                context.SaveChanges();
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new Kontakter object.
 /// </summary>
 /// <param name="anvandare">Initial value of the Anvandare property.</param>
 /// <param name="kontakt">Initial value of the Kontakt property.</param>
 public static Kontakter CreateKontakter(global::System.String anvandare, global::System.String kontakt)
 {
     Kontakter kontakter = new Kontakter();
     kontakter.Anvandare = anvandare;
     kontakter.Kontakt = kontakt;
     return kontakter;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Kontakter EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToKontakter(Kontakter kontakter)
 {
     base.AddObject("Kontakter", kontakter);
 }