private void button_Click(object sender, RoutedEventArgs e)
 {
     SqlCommand cmd = new SqlCommand("SELECT USER_GSI FROM gsi_user WHERE USER_GSI=@user and PASS_GSI=@pass and POSICION_GSI=@admin", con);
     cmd.Parameters.AddWithValue("user", textBox.Text);
     //string pas = passwordBox.SecurePassword();
     cmd.Parameters.AddWithValue("pass", passwordBox.Password);
     cmd.Parameters.AddWithValue("admin", comboBox.Text);
     con.Open();
     SqlDataReader leer = cmd.ExecuteReader();
     if (leer.Read() == true)
     {
         if(comboBox.Text == "Administrator") {
             PanelMenu login = new PanelMenu();
             login.Show();
             Close();
         }
         else
         {
             Window1 lote = new Window1();
             lote.Show();
             Close();
         }
     }
     else
     {
         MessageBox.Show("Usuario y Contraseña no son validos", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     con.Close();
 }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            SqlCommand cmd = new SqlCommand("INSERT INTO gsi_user(USER_GSI, PASS_GSI, POSICION_GSI, NAME_GSI, APP_GSI) VALUES (@user, @pass, @Posi, @Nom, @Ape)", con);
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.AddWithValue("@user", textBox.Text);
            cmd.Parameters.AddWithValue("@pass", passwordBox.Password);
            cmd.Parameters.AddWithValue("@Posi", comboBox.Text);
            cmd.Parameters.AddWithValue("@Nom", textBox3.Text);
            cmd.Parameters.AddWithValue("@Ape", textBox4.Text);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();

            PanelMenu menu = new PanelMenu();
            menu.Show();
            Close();
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            SqlCommand cmd = new SqlCommand("INSERT INTO gsi_user(USER_GSI, PASS_GSI, POSICION_GSI, NAME_GSI, APP_GSI) VALUES (@user, @pass, @Posi, @Nom, @Ape)", con);

            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.AddWithValue("@user", textBox.Text);
            cmd.Parameters.AddWithValue("@pass", passwordBox.Password);
            cmd.Parameters.AddWithValue("@Posi", comboBox.Text);
            cmd.Parameters.AddWithValue("@Nom", textBox3.Text);
            cmd.Parameters.AddWithValue("@Ape", textBox4.Text);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();

            PanelMenu menu = new PanelMenu();

            menu.Show();
            Close();
        }