private void btnActualizar_Click(object sender, EventArgs e) { try { if (this.grillaProductos.SelectedRows != null) { FrmProductos form = new FrmProductos(); int index = this.grillaProductos.SelectedRows[0].Index; form.tipooperacion = "A"; form.producto_id = Int32.Parse(this.grillaProductos.Rows[index].Cells["id"].Value.ToString()); var result = form.ShowDialog(); if (result == DialogResult.OK) { this.CargarGrilla(); } } else { MessageBox.Show("Debe seleccionar un registro", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception) { throw; } }
private void btnNuevoProducto_Click(object sender, EventArgs e) { FrmProductos form = new FrmProductos(); form.tipooperacion = "N"; var result = form.ShowDialog(); if (result == DialogResult.OK) { this.CargarGrilla(); } }
private void button1_Click(object sender, EventArgs e) { if (this.pnlControl.Controls.Count > 0) { this.pnlControl.Controls.RemoveAt(0); } FrmProductos hijo1 = new FrmProductos(); hijo1.TopLevel = false; hijo1.FormBorderStyle = FormBorderStyle.None; hijo1.Dock = DockStyle.Fill; this.pnlControl.Controls.Add(hijo1); this.pnlControl.Tag = hijo1; hijo1.Show(); }
private void grillaProductos_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 0) { FrmProductos productos = new FrmProductos(); int id = Int32.Parse(this.grillaProductos.Rows[e.RowIndex].Cells["id"].Value.ToString()); productos.producto_id = id; productos.tipooperacion = "V"; productos.Show(); } } catch (Exception ex) { MessageBox.Show("Se ha probocado un error al intentar carga el detalle del producto"); new Log(Global.log).GuardaError("", ex); } }