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_nuevo_Click(object sender, EventArgs e) { FormNuevoProducto f = new FormNuevoProducto(); f.MdiParent = this.MdiParent; f.Show(); }
private void productoToolStripMenuItem_Click(object sender, EventArgs e) { if (np == null) { np = new FormNuevoProducto(); np.MdiParent = this; np.FormClosed += new FormClosedEventHandler(FormNuevoProducto_formclosed); np.Show(); } }
private void btn_editar_Click(object sender, EventArgs e) { try { string codigo = dgw_bienes.CurrentRow.Cells[0].Value.ToString(); string[] codigo_separado = codigo.Split('-'); string categoria = codigo_separado[0].ToString(); string id_bien = codigo_separado[1].ToString(); string descripcion = dgw_bienes.CurrentRow.Cells[1].Value.ToString().Trim(); string categoria_nom = dgw_bienes.CurrentRow.Cells[2].Value.ToString().Trim(); string precio = dgw_bienes.CurrentRow.Cells[4].Value.ToString().Trim(); string costo = dgw_bienes.CurrentRow.Cells[5].Value.ToString().Trim(); string medida = dgw_bienes.CurrentRow.Cells[6].Value.ToString().Trim(); string linea = dgw_bienes.CurrentRow.Cells[7].Value.ToString().Trim(); string marca = dgw_bienes.CurrentRow.Cells[8].Value.ToString().Trim(); SistemaInventarioDatos sd = new SistemaInventarioDatos(); FormNuevoProducto f = new FormNuevoProducto(); f.MdiParent = this.MdiParent; f.Show(); f.txt_desc.Text = descripcion; f.txt_costo.Text = costo; f.txt_precio.Text = precio; string comisdion = sd.ObtenerComision(id_bien, categoria); f.txt_comision.Text = comisdion; int indice_categoria = f.cbo_Categoria.FindString(categoria_nom); f.cbo_Categoria.SelectedIndex = indice_categoria; int indice_linea = f.cbo_linea.FindString(linea); f.cbo_linea.SelectedIndex = indice_linea; int indice_marca = f.cbo_marca.FindString(marca); f.cbo_marca.SelectedIndex = indice_marca; string medidareal = sd.ObtenerMedidaReal(medida); int indice_medida = f.cbo_medida.FindString(medidareal); f.cbo_medida.SelectedIndex = indice_medida; f.lbl_codigo.Text = codigo; f.cbo_Categoria.Enabled = false; f.Editar = true; f.id_bien = id_bien; f.id_categria = categoria; //f.MdiParent = this.MdiParent; // f.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void FormNuevoProducto_formclosed(object sender, FormClosedEventArgs e) { np = null; }
private void button1_Click_1(object sender, EventArgs e) { FormNuevoProducto np = new FormNuevoProducto(); np.Show(); }