public void SendFormalMessageToUser(FormalMessage p_message, string p_receiver_user_name)
        {
            int message_id = HelperFunctions.GetGUID();

            add_offline_meesge(p_receiver_user_name, new OfflineMessage(message_id, p_message.Get_sender_user_id, p_message.Get_message_text));
            if (IsLoggedIn(p_receiver_user_name))
            {
                start_send_to_client_fromal_message(p_receiver_user_name, p_message.Get_sender_user_id, p_message.Get_message_text, message_id);
            }
        }
        protected override void Fail()
        {
            remove_agreement(agreement_id);
            List <string> all_users_invited_names  = all_users_invited.Keys.ToList();
            FormalMessage agreement_failed_message = new FormalMessage("Admin", "your request for adding " + all_users_invited_names[0] + " was rejected");
            int           j = 0;

            while (j < 4)
            {
                try
                {
                    send_formal_message_to_user(agreement_failed_message, starter_user_name);
                    break;
                }
                catch (Exception)
                {
                    j++;
                    continue;
                }
            }
            RemoveAgreement();
            return;
        }
 public void SC_SendFormalMessageToUser(FormalMessage p_message, string p_receiver_user_name)
 {
     user_manager.SendFormalMessageToUser(p_message, p_receiver_user_name);
 }
 public Di_Mess_ClientInformFormalMessage(FormalMessage p_message, int p_message_id)
 {
     message    = p_message;
     message_id = p_message_id;
 }
 public void AllAg_SendFormlMessageToUser(FormalMessage p_message, string p_receiver_user_name)
 {
     send_formal_message_to_user(p_message, p_receiver_user_name);
 }
        protected override void Result()
        {
            List <string> all_users_invited_names    = all_users_invited.Keys.ToList();
            FormalMessage agreement_accepted_message = new FormalMessage("Admin", "your request for adding " + all_users_invited_names[0] + " was Accepted");

            add_agreement_done(agreement_id);

            int j = 0;

            while (j < 4)
            {
                try
                {
                    send_formal_message_to_user(agreement_accepted_message, starter_user_name);
                    break;
                }
                catch (Exception)
                {
                    j++;
                    continue;
                }
            }


            if (is_logged_in(starter_user_name))
            {
                try
                {
                    reload_friend_list(starter_user_name);
                    List <string>       new_friend_list            = get_online_user_friend_list(starter_user_name);
                    List <PersonStatus> new_friend_list_and_status = new List <PersonStatus>();
                    foreach (string t_friend in new_friend_list)
                    {
                        new_friend_list_and_status.Add(new PersonStatus(t_friend, get_user_status(t_friend)));
                    }
                    start_client_friend_list_changed_inform_dialog(starter_user_name, new_friend_list_and_status);
                }
                catch (Exception)
                {
                }
            }
            if (is_logged_in(all_users_invited_names[0]))
            {
                try
                {
                    reload_friend_list(all_users_invited_names[0]);
                    List <string>       new_friend_list            = get_online_user_friend_list(all_users_invited_names[0]);
                    List <PersonStatus> new_friend_list_and_status = new List <PersonStatus>();
                    foreach (string t_friend in new_friend_list)
                    {
                        new_friend_list_and_status.Add(new PersonStatus(t_friend, get_user_status(t_friend)));
                    }
                    start_client_friend_list_changed_inform_dialog(all_users_invited_names[0], new_friend_list_and_status);
                }
                catch (Exception)
                {
                }
            }

            RemoveAgreement();
            return;
        }