Esempio n. 1
0
        public ListePatientHome(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, List <SVC.Patient> patientrecu, SVC.Client clientrecu)
        {
            try
            {
                InitializeComponent();
                proxy = proxyrecu;


                memberuser = memberrecu;

                callback    = callbackrecu;
                localclient = clientrecu;
                PatientDataGrid.ItemsSource = patientrecu;
                var disponible = (proxy.GetAllMedecin()).Where(list1 => list1.UserName == memberuser.UserName).FirstOrDefault();
                if (disponible != null)
                {
                    MedecinEnCours = disponible;
                }
                proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);

                proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
            }
            catch (Exception ex)
            {
                HandleProxy();
            }
        }
Esempio n. 2
0
        public DXWindowMain(SVC.ServiceCliniqueClient PROXYRECU, SVC.Membership memberrecu, ICallback callbackrecu, SVC.Client localclientrecu)
        {
            try
            {
                InitializeComponent();
                MemBerShip           = memberrecu;
                proxy                = PROXYRECU;
                callback             = callbackrecu;
                localClient          = localclientrecu;
                SESSSIONNAME.Content = localClient.UserName.ToString();
                //  VisiteAs ll = new VisiteAs();
                //ll.Show();

                FrameInterieur.Navigate(new Aceuill(proxy, MemBerShip, callback, this, localClient));

                autorisation(PROXYRECU, memberrecu, callbackrecu, localclientrecu);



                callbackrecu.callback += new ICallback.CallbackEventHandler(callbackrecu_callback);

                proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);

                proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 3
0
 public void ReceiverFile(SVC.FileMessage fileMsg, SVC.Client receiver)
 {
     try {
         if (Membershipsession.EnvoiRécéptFichier == true)
         {
             try
             {
                 FileStream fileStrm = new FileStream(rcvFilesPath + fileMsg.FileName, FileMode.Create, FileAccess.ReadWrite);
                 fileStrm.Write(fileMsg.Data, 0, fileMsg.Data.Length);
                 chatLabelSendFileStatus.Content = "Fichier reçu, " + fileMsg.FileName;
                 this.WindowState = WindowState.Normal;
                 if (chatCheckBoxSonore.IsChecked == true)
                 {
                     System.IO.Stream         str = Properties.Resources.facebookme_lZ4iKc6J;
                     System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str);
                     snd.Play();
                 }
             }
             catch (Exception ex)
             {
                 chatLabelSendFileStatus.Content = ex.Message.ToString();
             }
         }
         else
         {
             MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     catch (Exception ex)
     {
         HandleProxy();
     }
 }
Esempio n. 4
0
        public bool authentification(SVC.ServiceCliniqueClient testproxy, string usernameTextbox)
        {
            var query = from c in testproxy.GetAllMembership()
                        select c;

            var results    = query.ToList();
            var disponible = results.Where(list1 => list1.MotDePasse == usernameTextbox).FirstOrDefault();

            MemBerShip = disponible;
            if (disponible != null && disponible.Actif == true)
            {
                MemBerShip = disponible;
                username   = disponible.UserName;

                return(true);
            }
            else
            {
                this.Title            = "Cette Session n'existe pas ou inactif";
                this.WindowTitleBrush = Brushes.Red;
                this.localClient      = null;
                proxy.Close();
                return(false);
            }
        }
Esempio n. 5
0
 public Aceuill(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, DXWindowMain windowrecu, SVC.Client localclientrecu)
 {
     try
     {
         InitializeComponent();
         proxy       = proxyrecu;
         memberuser  = memberrecu;
         callback    = callbackrecu;
         windowmain  = windowrecu;
         localclient = localclientrecu;
         if (localclientrecu.Chat)
         {
             tile6.Visibility = Visibility.Visible;
             tile6.IsEnabled  = true;
         }
         else
         {
             tile6.Visibility = Visibility.Collapsed;
             tile6.IsEnabled  = false;
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 6
0
        public Caisse(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, SVC.Client clientrecu)
        {
            try
            {
                InitializeComponent();
                proxy      = proxyrecu;
                memberuser = memberrecu;
                callback   = callbackrecu;

                DateSaisieFin.SelectedDate   = DateTime.Now;
                DateSaisieDébut.SelectedDate = DateTime.Now;
                PatientDataGrid.ItemsSource  = proxy.GetAllDepense();
                txtDebit.Text   = Convert.ToString((proxy.GetAllDepense()).AsEnumerable().Sum(o => o.Montant));
                TxtCreebit.Text = Convert.ToString((proxy.GetAllDepense()).AsEnumerable().Sum(o => o.MontantCrédit));
                txtSolde.Text   = Convert.ToString(((proxy.GetAllDepense()).AsEnumerable().Sum(o => o.MontantCrédit)) - ((proxy.GetAllDepense()).AsEnumerable().Sum(o => o.Montant)));
                callbackrecu.InsertDepenseCallbackEvent += new ICallback.CallbackEventHandler18(callbackrecu_Refresh);
                CLIENTCONNECT = clientrecu;
                proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);

                proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 7
0
        private void buttonConnect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (proxy == null)
                {
                    callback = new ICallback();
                    InstanceContext cntx = new InstanceContext(callback);
                    proxy = new SVC.ServiceCliniqueClient(cntx);
                    string servicePath       = proxy.Endpoint.ListenUri.AbsolutePath;
                    string serviceListenPort = proxy.Endpoint.Address.Uri.Port.ToString();

                    ////////////////////////*************a supprimer***************///////

                    //this.localClient = new SVC.Client();
                    //this.localClient.UserName = txtMotDePasse.Password;
                    proxy.Endpoint.Address = new EndpointAddress("net.tcp://" + loginTxtBoxIP.Text.ToString() + ":" + serviceListenPort + servicePath);
                    //

                    proxy.Open();

                    var oper = authentification(proxy, txtMotDePasse.Password);
                    if (oper == true)
                    {
                        this.localClient          = new SVC.Client();
                        this.localClient.UserName = Membership.UserName;
                        this.localClient.Actif    = Convert.ToBoolean(Membership.Actif);

                        //      this.localClient.Status = true;

                        proxy.TestConnect(localClient.UserName);

                        TestConnecttCompleted();
                    }
                }
                else
                {
                    HandleProxy();
                }
            }
            /////


            catch (Exception ex)
            {
                // // loginLabelStatus.Content = "Offline";
                //Confirmer.IsEnabled = false;
                string Mess = "Error: " + ex.Message;
                textBlockss.Content    = Mess;
                textBlockss.Foreground = Brushes.Red;
                textBlockss.Visibility = Visibility.Visible;
                //    MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
            }
        }
Esempio n. 8
0
        private void txtMotDePasse_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (loginTxtBoxIP.Text != "")
                {
                    if (e.Key != System.Windows.Input.Key.Enter)
                    {
                        return;
                    }

                    // your event handler here
                    e.Handled = true;
                    if (proxy == null)
                    {
                        callback = new ICallback();
                        InstanceContext cntx = new InstanceContext(callback);
                        proxy = new SVC.ServiceCliniqueClient(cntx);
                        string servicePath       = proxy.Endpoint.ListenUri.AbsolutePath;
                        string serviceListenPort = proxy.Endpoint.Address.Uri.Port.ToString();

                        ////////////////////////*************a supprimer***************///////

                        //this.localClient = new SVC.Client();
                        //this.localClient.UserName = txtMotDePasse.Password;
                        proxy.Endpoint.Address = new EndpointAddress("net.tcp://" + loginTxtBoxIP.Text.ToString() + ":" + serviceListenPort + servicePath);
                        //

                        proxy.Open();

                        var oper = authentification(proxy, txtMotDePasse.Password);
                        if (oper == true)
                        {
                            this.localClient          = new SVC.Client();
                            this.localClient.UserName = Membership.UserName;
                            this.localClient.Actif    = Convert.ToBoolean(Membership.Actif);

                            proxy.TestConnect(localClient.UserName);

                            TestConnecttCompleted();
                        }
                    }
                    else
                    {
                        HandleProxy();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);
            }
        }
Esempio n. 9
0
        public Chat(SVC.Client LOCALCLIENTRECU, ICallback callbackrecu, SVC.ServiceCliniqueClient proxy1, DXWindowMain main, Membership memberrecu)
        {
            try
            {
                InitializeComponent();
                //  proxy.ReConnectAsync(LOCALCLIENTRECU);
                callbackrecu.callback                          += new ICallback.CallbackEventHandler(callbackrecu_callback);
                callbackrecu.callbackUserjoin                  += new ICallback.CallbackEventHandler1(callbackrecu_callbackjoin);
                callbackrecu.callbackUserLeave                 += new ICallback.CallbackEventHandler2(callbackrecu_callbackleave);
                callbackrecu.callbackMessageRecu               += new ICallback.CallbackEventHandler3(callbackrecu_callbackReceive);
                callbackrecu.IsWritingCallbackEvent            += new ICallback.CallbackEventHandler4(callbackrecu_callbackIswrite);
                callbackrecu.InsertReceiveFileCallbackevent    += new ICallback.CallbackEventHandler47(callbackrecureceiveFile_callbackIswrite);
                callbackrecu.InsertReceiveWhisperCallbackevent += new ICallback.CallbackEventHandler48(callbackrecureceiveWhisper_callbackWhisperReceive);

                Membershipsession = memberrecu;

                chatListBoxNames.SelectionChanged += new SelectionChangedEventHandler(chatListBoxNames_SelectionChanged);
                chatTxtBoxType.KeyDown            += new KeyEventHandler(chatTxtBoxType_KeyDown);
                chatTxtBoxType.KeyUp += new KeyEventHandler(chatTxtBoxType_KeyUp);
                proxy       = proxy1;
                localClient = LOCALCLIENTRECU;

                chatLabelCurrentUName.Content = localClient.UserName;
                main.AddEvent += new EventHandler(addClientWindow_AddEvent);
                proxy.ReConnectAsync(LOCALCLIENTRECU);
                proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);
                proxy.InnerDuplexChannel.Closed  += new EventHandler(InnerDuplexChannel_Closed);
                DirectoryInfo dir = new DirectoryInfo(rcvFilesPath);
                dir.Create();

                /*    var ist = proxy.GetAllClientDict();
                 *
                 *    foreach(var Item in ist.ToList())
                 *    {
                 *        MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("List Dictionnary "  +Item.Key.UserName.ToString()+" "+Item.Value.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.YesNo, MessageBoxImage.Question);
                 *
                 *    }
                 *
                 *   List<Client> ist1 = proxy.GetAllClient();
                 *
                 *   foreach(var Item in ist1.ToList())
                 *   {
                 *       MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("LIST CLIENT "+Item.UserName.ToString()+" ", Medicus.Properties.Resources.SiteWeb, MessageBoxButton.YesNo, MessageBoxImage.Question);
                 *
                 *   } */
            }
            catch (Exception ex)

            {
                HandleProxy();
            }
        }
Esempio n. 10
0
 private void chatListBoxNames_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try {
         ListBoxItem item = chatListBoxNames.SelectedItem as ListBoxItem;
         if (item != null)
         {
             this.receiver = this.OnlineClients[item];
         }
     }
     catch (Exception ex)
     {
         HandleProxy();
     }
 }
Esempio n. 11
0
        public MainAdministrateur(SVC.ServiceCliniqueClient proxyrecu, ICallback callbackrecu, SVC.Membership membershiprecu, SVC.Client clientrecu)
        {
            try
            {
                InitializeComponent();
                proxy       = proxyrecu;
                callback    = callbackrecu;
                MemBerShip  = membershiprecu;
                localClient = clientrecu;
            }

            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 12
0
        public ListePatient(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, SVC.Client clientrecu)
        {
            try
            {
                InitializeComponent();
                proxy = proxyrecu;

                memberuser = memberrecu;

                callback    = callbackrecu;
                localclient = clientrecu;
                chargerpatient(proxyrecu, callbackrecu);

                loadmedecin(proxyrecu);
            }
            catch (Exception ex)
            {
                MessageBoxResult resultc10 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 13
0
        public void ReceiveWhisper(SVC.Message msg, SVC.Client receiver)
        {
            try {
                if (Membershipsession.DiscussionPrivé == true)
                {
                    foreach (SVC.Client c in this.OnlineClients.Values)
                    {
                        if (c.UserName == msg.Sender)
                        {
                            //                    ListBoxItem item = MakeItem(" Message privé de la part de " + msg.Sender+" pour "+receiver.UserName +" :" + msg.Content );
                            ListBoxItem item = MakeItem(msg.Sender + "/" + receiver.UserName + " : " + msg.Content);

                            item.Foreground = Brushes.Green;
                            chatListBoxMsgs.Items.Add(item);
                            this.WindowState = WindowState.Normal;
                            if (chatCheckBoxSonore.IsChecked == true)
                            {
                                System.IO.Stream         str = Properties.Resources.facebookme_lZ4iKc6J;
                                System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str);
                                snd.Play();
                            }
                        }
                    }
                    ScrollViewer sv = FindVisualChild(chatListBoxMsgs);
                    sv.LineDown();
                }
                else
                {
                    MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(Medicus.Properties.Resources.MessageBoxPrivilége, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            catch (Exception ex)
            {
                HandleProxy();
            }
        }
Esempio n. 14
0
        public bool authentification(SVC.ServiceCliniqueClient testproxy, string usernameTextbox)
        {
            var query = from c in testproxy.GetAllMembership()
                        select c;

            var results    = query.ToList();
            var disponible = results.Where(list1 => list1.MotDePasse == usernameTextbox).FirstOrDefault();

            MemBerShip = disponible;
            if (disponible != null && disponible.Actif == true && disponible.ModuleAdministrateur == true)
            {
                MemBerShip = disponible;
                username   = disponible.UserName;

                return(true);
            }
            else
            {
                ;
                this.localClient = null;
                proxy.Close();
                return(false);
            }
        }
Esempio n. 15
0
 private void buttonConnect_Click(object sender, RoutedEventArgs e)
 {
     this.localClient = new SVC.Client();
     this.localClient.Name = loginTxtBoxUserName.Text.ToString();
 }
Esempio n. 16
0
        /// <summary>
        /// This is the second important method, which creates 
        /// the proxy, subscribe to connection state events
        /// and open a connection with the service
        /// </summary>
        private void Connect()
        {
            if (proxy == null)
            {
                try
                {
                    this.localClient = new SVC.Client();
                    this.localClient.Name = loginTxtBoxUName.Text.ToString();
                    this.localClient.AvatarID = loginComboBoxImgs.SelectedIndex;
                    InstanceContext context = new InstanceContext(this);
                    proxy = new SVC.ChatClient(context);

                    //As the address in the configuration file is set to localhost
                    //we want to change it so we can call a service in internal 
                    //network, or over internet
                    string servicePath = proxy.Endpoint.ListenUri.AbsolutePath;
                    string serviceListenPort = proxy.Endpoint.Address.Uri.Port.ToString();

                    proxy.Endpoint.Address = new EndpointAddress("net.tcp://" + loginTxtBoxIP.Text.ToString() + ":" + serviceListenPort + servicePath);


                    proxy.Open();

                    proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);
                    proxy.InnerDuplexChannel.Opened += new EventHandler(InnerDuplexChannel_Opened);
                    proxy.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Closed);
                    proxy.ConnectAsync(this.localClient);
                    proxy.ConnectCompleted += new EventHandler<ConnectCompletedEventArgs>(proxy_ConnectCompleted);
                }
                catch (Exception ex)
                {
                    loginTxtBoxUName.Text = ex.Message.ToString();
                    loginLabelStatus.Content = "Offline";
                    loginButtonConnect.IsEnabled = true;
                }
            }
            else
            {
                HandleProxy();
            }
        }
Esempio n. 17
0
 void chatListBoxNames_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //If user select an online client, make a client object
     //to be the receiver if the user wants to whisper him.
     ListBoxItem item = chatListBoxNames.SelectedItem as ListBoxItem;
     if (item != null)
     {
         this.receiver = this.OnlineClients[item];
     }
 }
Esempio n. 18
0
        void TestConnecttCompleted()
        {
            try
            {
                var disponible = (proxy.GetAllClient()).Where(list1 => list1.UserName == localClient.UserName).FirstOrDefault();


                if (disponible == null)
                {
                    proxy.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);
                    proxy.InnerDuplexChannel.Opened  += new EventHandler(InnerDuplexChannel_Opened);
                    proxy.InnerDuplexChannel.Closed  += new EventHandler(InnerDuplexChannel_Closed);
                    //  proxy.ConnectAsync(this.localClient);

                    //  bool test = proxy.VerificationCle1();

                    //     if (test)
                    //  {
                    proxy.ConnectAsync(this.localClient);

                    //   MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show(i.ToString(), Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Stop);

                    var listconnected = proxy.GetAllClient().Find(n => n.UserName == localClient.UserName);

                    if (listconnected != null)
                    {
                        connectionok            = true;
                        localClient             = listconnected;
                        proxy.ConnectCompleted += new EventHandler <ConnectCompletedEventArgs>(proxy_ConnecttCompleted);
                    }
                    else
                    {
                        textBlockss.Content    = "Nombre de connécté a été ateint "; //#3A8EBA
                        textBlockss.Foreground = Brushes.Red;
                        textBlockss.Visibility = Visibility.Visible;
                        proxy.Close();
                        connectionok = false;
                    }

                    //   }
                    // else
                    //{
                    //  textBlockss.Content = "la clé d'activation est absente ";//#3A8EBA
                    //     textBlockss.Foreground = Brushes.Red;
                    //   textBlockss.Visibility = Visibility.Visible;
                    // proxy.Close();
                    //   connectionok = false;
                    //}
                }
                else
                {
                    textBlockss.Content    = "Cette session est déja connéctée";//#3A8EBA
                    textBlockss.Foreground = Brushes.Red;
                    textBlockss.Visibility = Visibility.Visible;
                    proxy.Close();
                    connectionok = false;
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult resul03 = Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, Medicus.Properties.Resources.SiteWeb, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Esempio n. 19
0
        private void buttonConnect_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (proxy == null)
                {
                    callback = new ICallback();
                    InstanceContext cntx = new InstanceContext(callback);
                    proxy = new SVC.ServiceCliniqueClient(cntx);
                    string servicePath       = proxy.Endpoint.ListenUri.AbsolutePath;
                    string serviceListenPort = proxy.Endpoint.Address.Uri.Port.ToString();

                    ////////////////////////*************a supprimer***************///////

                    //this.localClient = new SVC.Client();
                    //this.localClient.UserName = txtMotDePasse.Password;
                    proxy.Endpoint.Address = new EndpointAddress("net.tcp://" + loginTxtBoxIP.Text.ToString() + ":" + serviceListenPort + servicePath);
                    //

                    proxy.Open();

                    var oper = authentification(proxy, txtMotDePasse.Password);
                    if (oper == true)
                    {
                        this.localClient          = new SVC.Client();
                        this.localClient.UserName = MemBerShip.UserName;
                        this.localClient.Actif    = Convert.ToBoolean(MemBerShip.Actif);

                        /*   if (chboxstatus.IsChecked == true)
                         * {
                         *     this.localClient.Status = true;
                         * }
                         * else
                         * {
                         *     if (chboxstatus.IsChecked == false)
                         *     {
                         *         this.localClient.Status = false;
                         *     }
                         * }*/
                        // this.localClient.Status = Convert.ToBoolean(chboxstatus.IsChecked);

                        proxy.TestConnect(localClient);
                        TestConnecttCompleted();
                    }
                }
                else
                {
                    HandleProxy();
                }
            }
            /////


            catch (Exception ex)
            {
                this.Title            = "Serveur Invalide";//#3A8EBA
                this.WindowTitleBrush = Brushes.Red;
                // // loginLabelStatus.Content = "Offline";
                //Confirmer.IsEnabled = false;
                string Mess = "Error: " + ex.Message;
                textBlock.Content = Mess;
            }
        }
Esempio n. 20
0
        public void autorisation(SVC.ServiceCliniqueClient proxyrecu, SVC.Membership memberrecu, ICallback callbackrecu, SVC.Client localclientrecu)
        {
            Dispatcher.BeginInvoke(new Action(() => {
                if (memberrecu.ModuleChat == true && localclientrecu.Chat == true)
                {
                    //   CL = new Chat(localclientrecu, callbackrecu, PROXYRECU, this, memberrecu);
                    CL = new Chat(localclientrecu, callbackrecu, proxyrecu, this, memberrecu);

                    ChatOpened = true;
                    CL.Show();
                    CL.WindowState = WindowState.Minimized;
                }

                if (localclientrecu.Stock == true && localclientrecu.Chat == true)
                {
                    this.Title = this.Title + " " + "(Medicus)";
                }
                else
                {
                    if (localclientrecu.Stock == true && localclientrecu.Chat == false)
                    {
                        this.Title = this.Title + " " + "(Medicus)";
                    }
                    else
                    {
                        if (localclientrecu.Stock == false && localclientrecu.Chat == true)
                        {
                            this.Title = this.Title + " " + "(Medicus)";
                        }
                        else
                        {
                            if (localclientrecu.Stock == false && localclientrecu.Chat == false)
                            {
                                this.Title = this.Title + " " + "(Medicus)";
                            }
                        }
                    }
                }
            }), DispatcherPriority.SystemIdle);

            //   Thread.();
        }