private void contenedor_Load(object sender, EventArgs e) { Conexion.DSN = "prueba2"; MdiClient Chld; inv_ini = null; // rep_movs = null; np = null; cat = null; fm = null; mar = null; rstck = null; bod = null; fl = null; gr = null; dm = null; dbp = null; fmu = null; mem = null; mov = null; devc = null; doc = null; exbod = null; fac = null; kar = null; his = null; crearu = null; app = null; edi = null; camb = null; modap = null; desh = null; asper = null; edper = null; elper = null; repcom = null; foreach (Control crtl in this.Controls) { try { Chld = (MdiClient)crtl; Chld.BackColor = this.BackColor; } catch (InvalidCastException exe) { } } if (inv_ini == null) { inv_ini = new FormInventarioInicio(); inv_ini.MdiParent = this; inv_ini.FormClosed += new FormClosedEventHandler(FormInventarioInicio_FormCLosed); inv_ini.Show(); } }
private void btn_guardar_Click(object sender, EventArgs e) { //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< seguridad.bitacora ju = new seguridad.bitacora(); ju.Insertar("Se ha hecho el registro de: " + txt_ident.Text + "," + txt_descripcion.Text + "," + textBox1.Text + "," + cbo_bien.SelectedValue.ToString() + "," + cbo_categoria.SelectedValue.ToString() + "," + txt_existencias.Text, " Detalle_ Muestreo "); textBox1.Visible = true; if (textBox1.Text == "e") { textBox1.Text = "0"; SistemaInventarioDatos ds = new SistemaInventarioDatos(); int y = ds.detalle_muestreo("insert into detalle_muestreo (id_muestreo_pk, descripcion, existencia, id_bien_pk , id_bodega_pk, id_categoria_pk, existencia_auditada) values ('" + txt_ident.Text.Trim() + "','" + txt_descripcion.Text.Trim() + "', '" + textBox1.Text + "','" + cbo_bien.SelectedValue.ToString() + "','" + cbo_bodega.SelectedValue.ToString() + "','" + cbo_categoria.SelectedValue.ToString() + "','" + txt_existencias.Text.Trim() + "')"); if (y == 1) { DataTable dt = ds.Load_detalle(" select encabezado_muestreo.id_muestreo_pk, fecha, responsable, descripcion, existencia, existencia_auditada, id_bien_pk, id_bodega_pk, id_categoria_pk from encabezado_muestreo inner join detalle_muestreo on encabezado_muestreo.id_muestreo_pk = detalle_muestreo.id_muestreo_pk where encabezado_muestreo.id_muestreo_pk = '" + txt_ident.Text + "'"); dvg_detalle.DataSource = dt; txt_descripcion.Text = ""; txt_existencias.Text = ""; } else { MessageBox.Show("Error"); } } else { SistemaInventarioDatos si = new SistemaInventarioDatos(); int r = si.detalle_muestreo("insert into detalle_muestreo (id_muestreo_pk, descripcion, existencia, id_bien_pk , id_bodega_pk, id_categoria_pk, existencia_auditada) values ('" + txt_ident.Text.Trim() + "','" + txt_descripcion.Text.Trim() + "', '" + textBox1.Text + "','" + cbo_bien.SelectedValue.ToString() + "','" + cbo_bodega.SelectedValue.ToString() + "','" + cbo_categoria.SelectedValue.ToString() + "','" + txt_existencias.Text.Trim() + "')"); if (r == 1) { SistemaInventarioDatos ds = new SistemaInventarioDatos(); DataTable dt = ds.Load_detalle(" select * from detalle_muestreo where id_muestreo_pk = '" + txt_ident.Text + "'"); dvg_detalle.DataSource = dt; si.ActualizarBogedaproducto(textBox1.Text, txt_existencias.Text, cbo_bien.SelectedValue.ToString(), cbo_bodega.SelectedValue.ToString(), cbo_categoria.SelectedValue.ToString()); Detalle_bodega_producto dm = new Detalle_bodega_producto(); dm.id_bien = cbo_bien.SelectedValue.ToString(); dm.id_bodega = cbo_bodega.SelectedValue.ToString(); dm.id_categoria = cbo_categoria.SelectedValue.ToString(); dm.Show(); } else { MessageBox.Show("no se pudo ingresar el detalle de muestreo! "); } } }
private void dvg_detalle_DoubleClick(object sender, EventArgs e) { Detalle_bodega_producto dp = new Detalle_bodega_producto(); dp.Show(); }