Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String nom    = textBox1.Text;
            String usr    = textBox2.Text;
            String contra = textBox3.Text;
            String tU     = comboBox1.Text;
            String dom    = textBox4.Text;
            String ti     = comboBox2.Text;
            String fi     = Fecha.Text;
            var    client = new ServicioLogClient();

            try
            {
                if (usr != null || contra != null || tU != null || dom != null || ti != null || fi != null)
                {
                    var ins = client.Insertar(usr, contra, nom, tU, dom, ti, fi);
                }
                else
                {
                    MessageBox.Show("Datos incompletos");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Usuario Insertado");
                Close();
            }
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     String nom = textBox1.Text;
     String usr = textBox2.Text;
     String contra = textBox3.Text;
     String tU = comboBox1.Text;
     String dom = textBox4.Text;
     String ti = comboBox2.Text;
     String fi = Fecha.Text;
     var client = new ServicioLogClient();
     try
     {
         if (usr != null || contra != null || tU != null || dom != null || ti != null || fi != null)
         {
             var ins = client.Insertar(usr,contra,nom,tU,dom,ti,fi);
         }
         else
         {
             MessageBox.Show("Datos incompletos");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Usuario Insertado");
         Close();
     }
 }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            String usuario = textBox1.Text;
            String contraseña = textBox2.Text;
            var client = new ServicioLogClient();
            try
            {
                if (usuario != null || contraseña != null)
                {
                    var login = client.GetLog(usuario, contraseña);

                    if (login.tipoUsuario == "admin")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }else{
                            MenuAdmin ma = new MenuAdmin();
                            ma.Show();
                            usuario = "";
                            contraseña = "";
                        }
                    }
                    else if (login.tipoUsuario == "socio")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }
                        else
                        {
                            MenuSocio ms = new MenuSocio();
                            ms.Show();
                        }
                    }
                    else if (login.tipoUsuario == "vendedor")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }
                        else
                        {
                            MenuVendedor mv = new MenuVendedor();
                            mv.Show();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Datos incompletos");
                }
            }
            catch (Exception )
            {
                MessageBox.Show("Error usuario no encontrado");
            }
        }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            String usuario    = textBox1.Text;
            String contraseña = textBox2.Text;
            var    client     = new ServicioLogClient();

            try
            {
                if (usuario != null || contraseña != null)
                {
                    var login = client.GetLog(usuario, contraseña);

                    if (login.tipoUsuario == "admin")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }
                        else
                        {
                            MenuAdmin ma = new MenuAdmin();
                            ma.Show();
                            usuario    = "";
                            contraseña = "";
                        }
                    }
                    else if (login.tipoUsuario == "socio")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }
                        else
                        {
                            MenuSocio ms = new MenuSocio();
                            ms.Show();
                        }
                    }
                    else if (login.tipoUsuario == "vendedor")
                    {
                        if (login.bloqueado == true)
                        {
                            MessageBox.Show("Usuario Bloqueado");
                        }
                        else
                        {
                            MenuVendedor mv = new MenuVendedor();
                            mv.Show();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Datos incompletos");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error usuario no encontrado");
            }
        }