예제 #1
0
        public STR_MSG AppelCommunication(string invoke, object[] data)
        {
            if (this.Authentification == "Fournisseur")
            {
                this.Token = "C##FOURNISSEUR";
            }
            else if (this.Authentification == "Pharmacien")
            {
                this.Token = "C##PHARMACIEN";
            }
            else if (this.Authentification == "Preparateur")
            {
                this.Token = "DEFAULT";
            }
            else // client
            {
                this.Token = "C##CLIENT";
            }

            this.oMsg = CL_MESSAGE_Factory.msg_factory(this.ClientName, data, "", invoke,
                                                        this.ClientID, true, this.Token);

            // créer un thread pour le SERVICE
            servComp = new CL_SERVER_COMPONENT();
            Thread th = new Thread(new ParameterizedThreadStart(servComp.Service));
            th.Start((object)this.oMsg);
            th.Join(); // en attente du retour
            this.oMsg = servComp.iMsg;

            return this.oMsg;
        }
예제 #2
0
        public CL_WORK_COMPONENT()
        {
            this.ClientID = "@1234";
            this.ClientName = "PharmaProject_v1";
            this.Authentification = "";
            this.Token = "";

            servComp = new CL_SERVER_COMPONENT();
        }