private void button5_Click(object sender, EventArgs e) { Form10 coco = new Form10(); coco.Show(); txtCantidad.Enabled = true; }
private void button2_Click(object sender, EventArgs e) { txtCantidad.Enabled = true; using (SqlConnection conn = Conexion.obtenerconexion()) { SqlCommand uu = new SqlCommand("Select Id_Pro from Producto Where Id_Pro = @Cod_Art", conn); uu.Parameters.AddWithValue("@Cod_Art", txtCod_Art.Text); conn.Open(); uu.ExecuteNonQuery(); SqlDataReader Lector = uu.ExecuteReader(); if (Lector.Read()) { Desactivar(); } else { MessageBox.Show("El Producto no se encuentra en el sistema!!", "Información importante", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtCod_Art.Text = ""; d++; if (d == 2) { DialogResult ok = MessageBox.Show("¿Desea consultarlo", "Información importante", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (ok == DialogResult.Yes) { Form10 producto = new Form10(); producto.Show(); } } } } }
void desactivar() { using (SqlConnection COL = Conexion.obtenerconexion()) { string POL = "Select ID_Pro from Producto where ID_Pro = @identificador and ESTADO = 'ACTIVADO' "; SqlCommand OO = new SqlCommand(POL, COL); OO.Parameters.AddWithValue("@identificador", txtCod_Ar.Text); COL.Open(); OO.ExecuteNonQuery(); SqlDataReader lector = OO.ExecuteReader(); if (lector.Read()) { producto_bajo_cero(); COL.Close(); } else { DialogResult op = MessageBox.Show("El producto seleccionado está desactivado", "Información importante", MessageBoxButtons.OK, MessageBoxIcon.Error); if (op == DialogResult.OK) { DialogResult opi = MessageBox.Show("¿Desea activarlo?", "Información importante", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (opi == DialogResult.Yes) { Form10 producto = new Form10(); producto.Show(); } else { txtCod_Ar.Text = ""; } } } } }
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; } } } } }
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 = ""; } } } } }
private void button5_Click_2(object sender, EventArgs e) { Form10 coco = new Form10(); coco.Show(); }