Esempio n. 1
0
 /// <summary>
 /// Vrati osobni kontakty daneho uzivatele
 /// </summary>
 /// <param name="nick"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static List<ImUser> Contact_GetMyContacts(int id_usr, string password)
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             if (api.User_Validate(id_usr, password))
             {
                 List<ImUser> users = new List<ImUser>(api.Contact_GetMyContacts(id_usr, password).ToList());
                 return users;
             }
             else
             {
                 return null;
             }
         }
     }
     catch (Exception)
     {
         return null;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Vrati vsechny uzivatelske zpravy
 /// </summary>
 /// <param name="nick"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static List<ImMessage> Message_GetMyMessages(int id_usr, string password)
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             if (api.User_Validate(id_usr, password))
             {
                 List<ImMessage> messages = new List<ImMessage>(api.Message_GetMyMessages(id_usr, password));
                 return messages;
             }
             else
             {
                 return null;
             }
         }
     }
     catch (Exception)
     {
         return null;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Overeni spravnosti zdali jmeno souhlasi s heslem
 /// </summary>
 /// <param name="nick"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static bool User_Validate(int id_usr, string password)
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             return api.User_Validate(id_usr, password);
         }
     }
     catch (Exception)
     {
         return false;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Odeslani(vlozeni) zpravy do systemu
 /// </summary>
 /// <param name="nick"></param>
 /// <param name="password"></param>
 /// <param name="msg"></param>
 /// <returns></returns>
 public static bool Message_InsertMessageForUser(int id_usr, string password, string msg_body, int msg_type, int[] dest_users)
 {
     try
     {
         using (MessagingServiceClient api = new MessagingServiceClient())
         {
             if (api.User_Validate(id_usr, password))
             {
                 return api.Message_InsertMessageForUser(id_usr, password, msg_body, msg_type, dest_users);
             }
             else
             {
                 return false;
             }
         }
     }
     catch (Exception)
     {
         return false;
     }
 }