private void button1_Click(object sender, EventArgs e) { try { TcpChannel cnl = new TcpChannel(); ChannelServices.RegisterChannel(cnl, false); IBibliothecaire obj = (IBibliothecaire)Activator.GetObject(typeof(IBibliothecaire), "tcp://localhost:1234/obj"); String b; if (memoire.Checked) { b = "memoire"; } else { if (livre.Checked) { b = "livre"; } else { b = "these"; } } Ouvrage o = new Ouvrage(mots.Text, auteurs.Text, title.Text, theme.Text, b, code.Text); Boolean br = obj.ajouter_ouvrage(o); Console.WriteLine(br); Console.ReadLine(); } catch (Exception m) { Console.WriteLine("erreur : " + m); Console.ReadLine(); } }
private void button1_Click(object sender, EventArgs e) { TcpChannel cnl = new TcpChannel(); ChannelServices.RegisterChannel(cnl, false); IBibliothecaire obj = (IBibliothecaire)Activator.GetObject(typeof(IBibliothecaire), "tcp://localhost:1234/obj"); if (obj.authentification(new Compte(user.Text, passe.Text))) { this.Hide(); Acceuil acceuil = new Acceuil(); acceuil.Show(); } else { MessageBox.Show("Authorization failed make sure you credentials are correct !"); } }