/// <summary> /// Carga el formulario frmAltaCliente /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAgregar_Click(object sender, EventArgs e) { var form = Application.OpenForms.OfType <FrmAltaCliente>().FirstOrDefault(); FrmAltaCliente frmAltaCliente = form ?? new FrmAltaCliente(); AddFormInPanel(frmAltaCliente); }
private void btnNuevo_Click(object sender, EventArgs e) { FrmAltaCliente frm = new FrmAltaCliente(); frm.lbl_title.Text = "Agregar"; frm.ShowDialog(); CargarClientes(); }
private void btnEditar_Click(object sender, EventArgs e) { if (tblCliente.CurrentRow != null) { //FrmModiCliente frm = new FrmModiCliente(); FrmAltaCliente frm = new FrmAltaCliente(); frm.lbl_title.Text = "Modificar"; frm.txtID.Text = tblCliente.CurrentRow.Cells["cli_ID"].Value.ToString();//////////////// frm.tbx_dni.Text = tblCliente.CurrentRow.Cells["DNI"].Value.ToString(); frm.tbx_nombre.Text = tblCliente.CurrentRow.Cells["Nombre"].Value.ToString(); frm.tbx_apellido.Text = tblCliente.CurrentRow.Cells["Apellido"].Value.ToString(); frm.tbx_direccion.Text = tblCliente.CurrentRow.Cells["Direccion"].Value.ToString(); frm.tbx_telefono.Text = tblCliente.CurrentRow.Cells["Telefono"].Value.ToString(); frm.ShowDialog(); CargarClientes(); } else { MessageBox.Show("Debe seleccionar una fila", "Importante", MessageBoxButtons.OK, MessageBoxIcon.Information); } }