Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string newNombre = this.newNombre.Text;
            string newContrasena = this.newContrasena.Text;
            int newtipo = this.tipoUsuario.SelectedIndex;

            Usuario newUsuario = new Usuario();
            newUsuario.UserName = newNombre;
            newUsuario.Pass = newContrasena;
            newUsuario.Tipo = newtipo;

            Service1Client try1 = new Practica2.ServiceReference4.Service1Client();

            int resultado = try1.crearUsuario(newUsuario);

            if (resultado != -1)
            {
                MessageBox.Show("Se creo el usuario correctamente");
                this.Close();
            }
            else
            {
                MessageBox.Show("No se creo el usuario correctamente, vuelva a intentarlo");

            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string newNombre     = this.newNombre.Text;
            string newContrasena = this.newContrasena.Text;
            int    newtipo       = this.tipoUsuario.SelectedIndex;

            Usuario newUsuario = new Usuario();

            newUsuario.UserName = newNombre;
            newUsuario.Pass     = newContrasena;
            newUsuario.Tipo     = newtipo;

            Service1Client try1 = new Practica2.ServiceReference4.Service1Client();

            int resultado = try1.crearUsuario(newUsuario);

            if (resultado != -1)
            {
                MessageBox.Show("Se creo el usuario correctamente");
                this.Close();
            }
            else
            {
                MessageBox.Show("No se creo el usuario correctamente, vuelva a intentarlo");
            }
        }