Exemplo n.º 1
0
        void Producto()
        {
            using (SqlConnection conn = Conexion.obtenerconexion())
            {
                SqlCommand uu = new SqlCommand("Select ID_Pro from Producto Where ID_Pro = @Id_Producto", conn);
                uu.Parameters.AddWithValue("@Id_Producto", txtCod_Ar.Text);
                conn.Open();
                uu.ExecuteNonQuery();
                SqlDataReader Lecture = uu.ExecuteReader();
                if (Lecture.Read())
                {
                    desactivar();
                    conn.Close();
                }


                else
                {
                    DialogResult options = MessageBox.Show("El Producto no se encuentra en el sistema!!", "Información importante", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    o++;

                    txtCantidad.Text = "";
                    txtArticulo.Text = "";
                    txtPrecio_U.Text = "";
                    txtCod_Ar.Text   = "";
                    if (options == DialogResult.OK && o == 2)
                    {
                        DialogResult OPTIONS2 = MessageBox.Show("¿Desea desactivarlo?", "Información importante", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (OPTIONS2 == DialogResult.Yes)
                        {
                            Form10 col = new Form10();
                            col.Show();
                            o = 0;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        void Desactivar
            ()
        {
            using (SqlConnection conn = Conexion.obtenerconexion())
            {
                SqlCommand cmd = new SqlCommand("select ID_Pro, Articulo, Precio_U from Producto where ID_Pro = @pro and ESTADO ='ACTIVADO'", conn);

                cmd.Parameters.AddWithValue("@pro", txtCod_Art.Text);

                conn.Open();
                cmd.ExecuteNonQuery();
                SqlDataReader lector = cmd.ExecuteReader();
                if (lector.Read())
                {
                    Producto_bajo_cero();
                    conn.Close();
                }
                else
                {
                    DialogResult cim = MessageBox.Show("El producto está desactivado", "Información importante", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    if (cim == DialogResult.OK)
                    {
                        DialogResult resul = MessageBox.Show("¿Desea activarlo?", "Información importante", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        if (resul == DialogResult.Yes)
                        {
                            Form10 producto = new Form10();
                            producto.Show();
                        }
                        else

                        {
                            txtCod_Art.Text = "";
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void button5_Click_2(object sender, EventArgs e)
        {
            Form10 coco = new Form10();

            coco.Show();
        }