private void buttonNuevo_Click(object sender, EventArgs e) { try { cFMTU110010 Catalogo = new cFMTU110010(); AddOwnedForm(Catalogo); Catalogo.FormBorderStyle = FormBorderStyle.None; Catalogo.TopLevel = false; Catalogo.Dock = DockStyle.Fill; this.Controls.Add(Catalogo); this.Tag = Catalogo; Catalogo.BringToFront(); Catalogo.Show(); } catch (Exception ex) { MessageBox.Show(String.Format("buttonNuevo_Click: {0}", ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonEditar_Click(object sender, EventArgs e) { try { if (dataGridViewData.RowCount > 0) { IdRowSelect = dataGridViewData.CurrentRow.Index; if (IdRowSelect >= 0) { cFMTU110010 Catalogo = new cFMTU110010() { IdTurn = Int32.Parse(dataGridViewData.Rows[IdRowSelect].Cells[TurnML.DataBase.Id].Value.ToString()) }; AddOwnedForm(Catalogo); Catalogo.FormBorderStyle = FormBorderStyle.None; Catalogo.TopLevel = false; Catalogo.Dock = DockStyle.Fill; this.Controls.Add(Catalogo); this.Tag = Catalogo; Catalogo.BringToFront(); Catalogo.Show(); } else { cFAT100010 Alert = new cFAT100010("InformaciĆ³n", "No tiene Seleccionado un Turno", MessageBoxIcon.Information); Alert.ShowDialog(); } } else { cFAT100010 Alert = new cFAT100010("InformaciĆ³n", "No hay datos", MessageBoxIcon.Information); Alert.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(String.Format("buttonEditar_Click: {0}", ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }