private void Btn_consultar_Click(object sender, EventArgs e) { if (presionado == false) { DeshabilitarBtn(); Btn_consultar.Enabled = true; presionado = true; } else { Consulta.Frm_consultaDepartamento conDepartamento = new Consulta.Frm_consultaDepartamento(); conDepartamento.ShowDialog(); if (conDepartamento.DialogResult == DialogResult.OK) { Txt_id.Text = conDepartamento.Dgv_consultaDepartamento.Rows[conDepartamento.Dgv_consultaDepartamento.CurrentRow.Index]. Cells[0].Value.ToString(); Txt_nombre.Text = conDepartamento.Dgv_consultaDepartamento.Rows[conDepartamento.Dgv_consultaDepartamento.CurrentRow.Index]. Cells[1].Value.ToString(); Txt_descripcion.Text = conDepartamento.Dgv_consultaDepartamento.Rows[conDepartamento.Dgv_consultaDepartamento.CurrentRow.Index]. Cells[2].Value.ToString(); Txt_id.Focus(); presionado = false; HabilitarBtn(); } } }
private void Btn_borrar_Click(object sender, EventArgs e) { if (presionado == false) { DeshabilitarBtn(); Btn_borrar.Enabled = true; presionado = true; } else { BorrarDatos(); Txt_id.Focus(); presionado = false; DeshabilitarCampos(); HabilitarBtn(); limpiar(); } }
private void Btn_aceptarlista_Click(object sender, EventArgs e) { //Aparezca el primer submenu Gpb_accion.Visible = true; Gpb_accion.Enabled = true; Btn_ModificarLista.Visible = true; Btn_ModificarLista.Enabled = true; Gpb_producto.Visible = false; Gpb_accion2.Visible = false; Gpb_costolista.Visible = false; Gpb_lista.Visible = false; Txt_nombreproducto.Text = ""; Txt_descuento.Text = ""; Dtp_fechainicio.ResetText(); TxtTipoLista2.Visible = false; Txt_FechaInicio2.Enabled = false; TxtTipoLista2.Enabled = false; Txt_FechaInicio2.Visible = false; Dtp_fechamodificacion.ResetText(); Cbo_NombreLista.Items.Clear(); Txt_NombreLista.Text = ""; Txt_NombreLista.Clear(); Txt_descuento.Clear(); Txt_FechaInicio.Clear(); TxtTipoLista2.Clear(); Txt_FechaInicio2.Clear(); Txt_nombreproducto.Clear(); Txt_TipoLista.Clear(); Cbo_codigoproducto.Items.Clear(); Cbo_NombreLista.Items.Clear(); Cbo_tipolista.Items.Clear(); Btn_CrearLista.Enabled = true; Btn_CrearLista.Visible = true; Txt_id.Clear(); Txt_id2.Clear(); Txt_precio.Clear(); MessageBox.Show("Lista Creada Con Exito"); }