Exemple #1
0
 /// <summary>
 /// Vraci objekt uzivatele dle jeho ID
 /// </summary>
 /// <param name="id_usr"></param>
 /// <returns></returns>
 public static ImUser Contact_GetContactById(int id_usr)
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             ImUser user = api.Contact_GetAllContacts().Where(c => c.ID_USR.Equals(id_usr)).FirstOrDefault();
             api.Close();
             return user;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }
Exemple #2
0
 /// <summary>
 /// Vrati vsechny kontakty systemu
 /// </summary>
 /// <returns></returns>
 public static List<ImUser> Contact_GetAllContacts()
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             List<ImUser> users = new List<ImUser>(api.Contact_GetAllContacts().ToList());
             api.Close();
             return users;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }